Tuesday, February 5, 2013

An early Valentine for my beloved JSPs

JSPs have had a bad rap for the past several years. JSF wants to replace them, but please - anything you can do in a JSF page I can do in a JSP. Anything I can do in a JSP you cannot do in a JSF page. And with the right code organization, I don't need Expression Language (EL) either, thank you very much.

So why no love for JSPs any more? I think that, along with a lot of other trends in Java programming, coders are getting lazier and stupider - yes, I said stupider. Go ahead and bloat your WAR file to 100 mB with all those frameworks for your latest "Hello World!" webapp because you're afraid to write core java + JSP. I'll develop mine faster and in 100 kB instead.

I swear it's like the latest generation of coders doesn't really understand core java any more. I was helping a colleague debug some code recently and his complete lack of understanding of how to make some code thread-safe and reentrant was truly mind boggling. And he has 5 years of Java experience since getting his college degree in computer science.

"JSPs are soooo yesteryear" I hear them groan. And from the same coders that love to reinvent the wheel in ways that are truly breathtaking. Not to beat the dead horse of JSF, but that's a mighty big framework to re-solve a problem I can do in well under 1000 lines of my own framework code.

And when it comes to HTML-only pages instead of JSPs, go ahead and create some Java POJOs to wrap with some GSON to send to an HTML/JS-only client. Meanwhile I'll generate javascript right in a JSP from the Java beans I already have. You think that makes my code hard to read? Try Perl sometime. This ain't nuttin but a lil bit o' java code.

Don't get me wrong - HTML5 + javascript is great. But HTML5 + javascript + JSP is even more powerful and more efficient as well. But maybe I'm just too old; been around the programming block a few too many times and long for the olden days. Or maybe the founding fathers of Java had it right all along when they wanted to design a language that was simple, powerful, accessible, and not bloated. They stewards of Java have moved away from that over the years. The original JDK download was a fraction the size of just JSF - and that speaks to me.

So to all you gen-X Y Z whatever of coders I only ask that you stop disrespecting JSPs. Oh - and get off my code-lawn.

No comments:

Post a Comment