Monday, April 18, 2011

Java GUI Builders: To Use or Not To Use

Picture a kid riding a bicycle on the highway in first gear... He has to make it 40 miles and he's traveling at about 5 miles an hour. 8 hours to get to the destination--Totally inefficient, right? Why not just shift into a higher gear so you can travel at 18 miles an hour, reaching your destination in a little more than two hours? Unlike VB.NET or Visual C++, there is no acceptable visual editor for Java!

I'm here to explain why you should avoid it at ALL COST!

Reason #1: It's not efficient...at all

The Netbeans (A popular IDE) does the best that it can to create a GUI to your liking with it's drag-and-drop approach, but it takes 3X the amount of code to accomplish this feat. 3X the code is usually accompanied by 3X the inefficiency. For a programmer (at least for me), It's kind of like a punch below the belt when you realize you could have made your program 3X more efficient if you would have taken a different approach. This is something that no programmer likes to hear (and definitely shouldn't tolerate).

Reason #2: It's a MONSTER to maintain


Going off of Reason #1, since there is 3X the code, there is 4X the unnecessary clutter. Not only that, but because of the way in which Netbeans organizes the code, it is impossible for a mere mortal to comprehend what is going on. For those of you who have posted erroneous code, this isn't good news for you. The more experienced coders won't even bother sifting through the jungle of disaster to find the errors you are experiencing, simply it's because it is a BEAST to understand and keep organized in your thoughts. It's not that GUI Builders are reserved solely for the genius's use, but that it is unwise to use such a product in the first place. There is absolutely no rhythm to the code that Netbeans produces.

Reason #3: It's downright lazy

No offense to those of you who use it because you were never told otherwise--I'm telling you now. It's a fact that GUI Builders encourage lazy coding habits. It seems very simple on the surface of things--drag the different components into place AND... presto, a working application( if only it were so simple). But you are left with the problems described in Reason #1 and #2. It's better off to study the GUI classes and components then piece together an efficient, manageable version of your program in which you understand every single detail contained within it. This is the pinnacle attribute of a good programmer. Not only will you understand your own code, but if you have small problems, other experienced coders will understand how your program should work at a brief glance.

No comments:

Post a Comment