Aug 27, 2008

Reinventing the wheel

Did you notice that we are just doing the same things trying to get different results? You can think the answer for that question could be 'who does exactly the same thing expecting different results is just an insane guy' and let me tell you something, I think in the same way. But if you take a look in the UI frameworks, tools, or however you want to call it, we are using the same principles, at least this is what I can see in my short experience as Java developer. In the Java world, we had, have, and probably we are still having frameworks like Struts, Struts2, Wicket, Tapestry, JSF, Echo2, GWT and there are a few more.
What I really don't understand is the fact that we want to write applications completely in Java, because Java is robust, easy to test, multi platform, and a huge list of advantages. But what happens when we need to do more things that aren't simply to do in a framework? The first answer could be 'Adapt your needs to the framework boundaries' ... what a f...!!! This sounds crazy?.. mmm, think for a moment... Have you ever worked in a Struts application and now you need to implement Web 2.0 (Ajax) 'simple' changes? Yes, I know, just do some changes here and some others here and voila! Now you are at the beginning of a 'nice Struts Ajax enable application'. Sadly this is a very common situation nowadays.
A different approach is to write Web applications in a 'cool' language and then automagically convert that code into java code. Nice. Now you have to have one thousand classes per each class in your super cool language, a very powerful solution, robust and great because is java code!
GWT, the last intend to reinventing the wheel. Now you write a few lines of code in Java, and then you have a Web 2.0 application. But the prize you need to pay is recompile the application if you want to change a simple javascript line.
I think that it is time to stop this crazy and sick way to make Web applications. Please, just stop. If the solution is write simple html and javascript (i.e. GWT) why don't do it as it is? Why are we trying to magically generate it? Maybe it's time to see that we need to separate UI work and leave it in some language that can handle it simple and use Java as a core language (if you still want to write code in Java).

Please keep in mind the KISS principle: Keep it simple, stupid!

There is no a solution for everything, just use your coffee machine to make coffee and don't try to use it to wash your dishes!