Tuesday, November 22, 2005

GUI Builders: Data vs. Code

Some people are of the concerted opinion that GNUstep, Cocoa, and indeed GNOME are on the wrong path when it comes to building GUIs when compared to editors of the likes of NetBeans or Eclipse. The first set of technologies have chosen to generate data (even though Glade can generate code... the GNOME project recommends against this), whether they are serialized streams or XML, to represent thier GUIs whereas most Java GUI builders generate code.

This is a fundamentally mistaken position for a very important reason: Metadata is portable across different languages. In GNOME there is a Java interface as well as a C and C++ interface to libglade. This means that my program, no matter which of these languages it's written in, can load my interface without any problems. In NetBeans or Eclipse, it's not necessary for them to consider that SWT or Swing will ever be used by anyone but them, so they can generate the code. However, data is better in general, since it can also be manipulated outside of the program. For instance, it's possible to apply a stylesheet to an XML file and transform it as needed. Why not do this to an interface file? This way an XML interface file can be manipulated like data inside the program and the resulting XML can be loaded as the GUI.

So I hope this settles any arguments about which type is better. In my opinion, Data generating GUI builders are better, hands down.

No comments:

Objective-C end of life?? Not a chance...

Recently, I saw this article regarding ObjCs "end of life" from JetBrains. The tiobe index seems to disagree. It’s also importa...