Monday, July 9, 2007

I do not embrace programming frameworks

In the beginning (ok, around 1994) there was HTML, it is so easy that everyone learned how to do <b> <i> tags.
But the most powerful tag is the <img src=file.gif> tag. You can add images! If the WWW only has text and no images, it would never grow to be this big. It was easy back then.

Soon there was need to do form entry! Textboxes, memo fields, radio buttons and dropdown were added. Though crude UI are pale compared to full blown Windows app people were still happy, even to this date.
Now it gets a bit harder. How do we process that form data? Little programs known as CGI to parse text was the first answer,

then there was quick-and-dirty VBScript, and there was Servlets, then everyone was tired of out.println("<title>Hello</title>"); that JSP was invented. A bit tougher than plain HTML but still very manageable.

If it is easy then there is no industry! So got to make it elaborate! Computer scientists need PhD theses. Industries need products! Ok, HTML is just markups and fixed set of tags. Too easy! So got to make it difficult to appear professional! How about you define your own tags: Enter XML. That alone flooded industry for parsing and all sorts of programs to support it.

Here is a fact of life: people write sloppy code if they can.

ASP and JSP are easy but they allow you to write sloppy stuff where you put your presentation code, logic and database code

all in one file. It isn't necessarily BAD, because at least I only have 1 file to look.

The industry's solution to remediate that is design patterns and frameworks! People blindly embrace them without really knowing the evils or merits of such things. XML configurations! Everyone is excited with it so let's let that spice up the framework with properitary XML configs. That makes the easiest tasks difficult. What file is called next? What method will be called by the frameworks? It becomes a very difficult question in frameworks as they are tied by hairy XML configs. Waita minute you are giving me a bunch of NEW HTML tags in the form of tag libraries? I wish JSP never even allow you to define your own tags. If you let people define their own tags, they go wild.

The disciplined programmer can do their own code nicely, without restricting themselves into any frameworks. Sometimes frameworks take away the creative factor in programming.

Oh frameworks can have new versions. And new versions are not compatible with older ones? Now that's nuts. Just why do I have to bend myself to fit your new framework? and new versions of it?

If people write sloppy code in easy environments, they would also write sloppy code in your framework. If something is broken, is it from the bad code or from the bad framework? Are frameworks good or are they evil?

No comments: