I’m learning to use a new Web application architecture called Struts, which is a Java framework for making complex websites that carefully separate the front-end pages (which creative folks build) from the back-end code (which the programmers write) from the business logic that orders the pages (which the client service teams change their minds about all the time.)
Web pundit Philip Greenspun has recently compared J2EE (that’s Java 2, Enterprise Edition) applications to SUVs. They’re big, heavy, unwieldy, and theoretically have more power than you ever could use, or want — especially if you do all your driving to and from the grocery store. Which is news to nobody. “Pick the horse for the course” is a standard mantra among experieced interactive architects. Writing a prototype? Great — use PHP and CGI. Writing a landing page that just captures names and addresses for a sweepstakes? Fine, use VBScript and get on with your life. Writing a shopping cart for a thousand simultaneous users? Okay, NOW you need to fire up the Hummer.
Anyhow, saying that Struts has a steep learning curve is, um… correct. What makes it especially difficult is the way that every piece of Java code you write depends on the one above it, which depends on the one above that. The chain runs all the way up the ladder, just like your name and address in your seventh-grade biology textbook went all the way up to “…the world, THE UNIVERSE!”
So when you break something in Java, you don’t just get an error message about the closing parenthesis you forgot. The server proceeds to read you the riot act, telling you about your code, then describing how your dumb mistake broke the thing above it, and now the thing above THAT doesn’t work. Java goes into great detail about your ancestry, what it thinks about the town where you came from, and how if your dog was as ugly as you, Java would shave its butt and teach it to walk backwards.
The only thing Java is lacking is the proper vocabulary.