2009-02-05

Compiled code is bliss

In the past couple of days I've working on updating some functionality in one of our legacy apps at work. The app consists of many JSP pages and after making making one must considered minor changes, the Javascript on the page failed to function as it should. I keep getting an error stating that a hidden form field was no longer available. I was using Firebug in hopes of finding the issue and then resorted to looking thru all the HTML with my eyes and couldn't find any missing tags or anything of the sort. Also doing a "view source" was clearly showing me that the hidden form field was indeed there. So what was wrong?

After looking at the code I changed, I noticed that my IFRAME tag was not being closed with a corresponding IFRAME tag. And that is what cause the Javascript error. Of course nothing told me this was the case, so lost a couple hours of development trying to the root cause of my problem.

Needless to say in Flex this would have never happened. In Flex Builder, if I would have forgotten a closing tag in some MXML file the editor would have shown it to me right away and I would have corrected it immediately. And for those using only the command line Flex compiler, the same would have happened, the compilation would have failed and the appropriate error message displayed with the exact line number.

Needless to say compiled code is a bliss :)

Also, the amount of Java code written to populate HTML Comboboxes is crazy, long live Flex and its data-driven controls, where simple data-binding does wonders. Fewer lines of code, less error prone and thus better productivity.

No comments: