Thursday, January 10, 2008

The Craptaculous Web Framework

At No Fluff, Just Stuff, Sunday after lunch is reserved for the speaker's panel and poll. Jay polls the audience to find out what version of Java everyone is using, which Ajax libraries, IDEs, and that sort of stuff. One of the questions he always asks is "Which web frameworks are people using"? Generally, Struts still rules the numbers (although, recently, he's been asking how many people would use Struts on a new project and the numbers plummet). He rattles off the litany of web frameworks (there are dozens in the Java world, after all). And, on the panels I'm on, I pipe in by asking people how many are using their own, home grown "Craptaculous" framework. Interestingly enough, there are always hands. And the home grown Craptaculous framework generally beats out some well known rivals, like JSF (thank heavens) and Tapestry (what a shame).

This really shows the confusion in the Java world around about web frameworks. The only clear consensus is around Struts, and only because there are lots legacy projects that started with it. I put this down to the The Paradox of Choice, which Scott Davis references in his keynote No, I Won't Tell you Which Web Framework to Use (or, the Truth, with Jokes). Yes, there is an entire hour-long keynote about this topic. The Paradox of Choice shows that people's decision making capacity shuts down when presented with too many choices. The classic example from the book is the store selling jam. A little boutique store started presenting jam samples to entice customers. When they put out 3 different flavors, customers sampled them and the sales of jam soared. More must be better, right? So they put out 10 difference flavors...and the sales plummeted. When presented with too many choices, people's decision making ability shuts down.

Which I think it at play now in the Java web space. Scott's keynote is a direct result of this. Inevitably, at No Fluff, Just Stuff shows, the question comes up on the expert panel: "Which web framework should I use?" If there were only 3, you could reasonable go compare them. When the number reaches 10 or 20, there is no time to go sample each one. Thus, paralysis sets in and you end up using Struts (again), or creating another version of your home-grown Craptaculous framework.

For better or worse, other markets don't suffer from this. In the .NET world, there is only one: ASP.NET. But that is a different kind of market. Despite the efforts by many in the ALT.NET space, open source isn't nearly as prevalent in the .NET world as in others (I can't tell you how many clients I've talked to that created their own logging framework for .NET -- it just never occurred to them that this problem has already been solved over and over). In the Ruby world, there is really only Ruby on Rails (although there are others, they have a very small following compared to Rails). Same in the Python world: there are several frameworks, but as an outsider looking in, it seems that Django has all the buzz now.

Which suggests a clear new front runner in the Java world: Grails. Because it is based on Groovy, not Java, the perception is that it is the only game in town. That will help drive the adaptation of Groovy like wildfire. In fact, I think that Grails is the engine driving the interest in Groovy. New languages are cool and all, but until you have something to do with them, they don't catch on (look at what happened with Java when servlets came along).

Of course, I would be remiss not to mention that Rails now runs on the JVM via JRuby. However, I think this is perceived by many in the Java world as a bigger transition than Groovy and Grails. Ruby is a completely different language, with different idioms. To hard-core Java-ists, Groovy is practically Java, with most of the stinky parts removed. Once Grails becomes 1.0 and beyond, it may be salvation from the home-grown Craptaculous framework that Java developers are still using.


Unknown said...

I agree that technologically, Grails is the true competitor to Tapestry 5. Fortunately T5 has some very nice features, a kind of scaffolding, to help you get up and running reasonably quickly (as opposed to a Rails / Grails instance app). That will have to come in the future.

JSF has some market penetration in a top down manner, but people are very, very frustrated with it.

Unknown said...

I often thought to myself that the web-framework space is too fragmented in the Java world. Everytime I read those "choice is good" comments on theserverside I think that there is actually too much choice: Too many projects without momentum (hard to good find books, employees, consultants etc.).

Of course there should be some competition. In the case of the JVM something like: Rails vs. Grails (agile/scripting frameworks), Wicket vs. JSF (component-based) and maybe an old classic action-based frameowkr like Struts 2. This sums up to 5 frameworks

Unknown said...

I see no reason to use web frameworks when said frame work will be MIA in a few short years. I use servlets, EL, pojo/dto, xml/json/xsl, javascript, and pl/sql in the database (oracle). I have code that generates all my java and pl/sql and some of the javascript (I create a table in the database that contains tuples which describe relationships). No reliance on the currently cool framework. I try hard to write clean, maintainable code, using best practices. Any other programmer worth their salt can then jump in. I make exceptions for JavaScript frameworks as I currently use YUI.

Michael Easter said...

I've seen Scott's keynote. Really great stuff....

It's interesting to me how every language now showcases a web framework. I was at a talk on Scala recently and they mentioned its upcoming one (Lift?). I groaned. Anything except another web framework!

Jay R. Wren said...

Don't tell all those people using MonoRail that their web framework doesn't exist! I think it may confuse them.

MonoRail is an alternative to ASP.NET WinForms. It is getting so much traction that MS had to copy it and call it their unreleased ASP.NET MVC

Unknown said...

Neal: about the Python world comment, that's not what I get the feeling of. I get the sense that the Python web space is very fragmented a although the number of frameworks has reduced from 20 to like 4, there definitely not one that stands out. In a recent python users group meeting I attended, analysis paralysis was the word used to describe our inability to pick a framework to build our website.

Sergio Oliveira Jr. said...

The United States of America is a FREE country. People are free to do whatever they want. Competition is not just allowed but highly encouraged. Intervention of any kind, from government, crazy people, etc. is not cool!

If I want to start a new web server in Java, a email client, a new browser, I will. And I will not place a gun in your head for you to use it or like it. You are free to ignore it, not like it, etc. as much as you are free to like it and use it. So this argument would be very interesting in Cuba, but not in a free country.

By the way, check the Mentawai online book:

Check the Mentawai recipes:

I am very happy I did not listen to comments like that when I started the project. It is very successful now with a lot of people using it.

Unknown said...

Smart young programmers who are trying to come over to Java from PHP, Perl, Ruby, or other technologies ask: "where do I start?" And that is a huge problem. Lately I've steered the one or two fellas who actually ask me (of all people!) for advice toward Groovy and Grails.

It's a great place to start out and get used to working with Java technologies.

Without that clear "start here" landing place it's hard to know where to begin and some people I know avoid Java all together because of that.

So if you've worked LAMP and are moving to Java start with Grails. That's my advice. Grails cuts so much noise out that you can actually get productive fast without spending months learning about application servers and deployment environments.

And yes, I know several professionals with years (some of us decades) on LAMP and RoR who are looking around at new frameworks and are considering Java again. Grails could be just in time for many of them to consider coming back to Java in Groovier clothes.

Patrick Moore said...

@rance -- you do have a framework it is a craptaculous framework!