Temporary Solutions Usually Become Permanent

There’s a saying that temporary solutions usually become permanent. And there is no better place validate this than version control systems. I noticed this comment today in the Eclipse SWT framework:

	/*
	* TEMPORARY CODE. When a graphics object is
	* created and the device parameter is null,
	* the current Display is used. This presents
	* a problem because SWT graphics does not
	* reference classes in SWT widgets. The correct
	* fix is to remove this feature. Unfortunately,
	* too many application programs rely on this
	* feature.
	*/
	protected static Device CurrentDevice;
	protected static Runnable DeviceFinder;
	static {
		try {
			Class.forName ("org.eclipse.swt.widgets.Display"); //$NON-NLS-1$
		} catch (ClassNotFoundException e) {}
	}

/*
* TEMPORARY CODE.
*/
static synchronized Device getDevice () {
	if (DeviceFinder != null) DeviceFinder.run();
	Device device = CurrentDevice;
	CurrentDevice = null;
	return device;
}

I decided to check when this “temporary” code came to existence, and found it was added about 12 years ago (June 2001 to be exact). Since then, it hasn’t changed. And neither has the comment.

And on a related subject, I am not sure if I would have endeavored in this search if git and github didn’t exist. Since they were created, the world is definitely a better place.

Enhanced by Zemanta

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.