August 7th, 2008

Learning new stuff: Java is king once again

In the span of the past 2 weeks, I’ve tried to pick up both GWT and TurboGears while on the clock for a project that needs to be done yesterday. Not much time to fiddle about, in other words.

TurboGears failed horribly and has been left by the wayside. GWT, on the other hand, is now something I’m already quite knowledgable about with about as much time spent working on either.

The key: auto-complete. For GWT, anytime I’m stumped I’ll auto-complete my way to an answer. Without moving away from the code file I’m editing, I notice that all graphical widgets are in the same package, so I copy/paste the package name, add a dot, and hit ctrl+space. There’s the whole list of all widgets GWT has to offer me, right there. Anytime I stop my scrolling and linger on a specific one, I get a popup with a little story on what it does, exactly.

In the mean time, TurboGears offers extensive documentation, multiple ‘quickstarts’ and ‘tutorials’, and a video that walks you through building a basic WIKI in about 15 minutes. None of this is available for GWT - all it has is some very simple sample apps, and 1 serious one (a mail app. I only looked at the CSS for some stylesheet tricks, not at the code).

I’ll accept that TurboGears tries to tackle more, but what with me writing a web server, and never having done fancy client-side styling before, the familiarity bonus definitely sides with TurboGears.

The key to this story is static typing. Between the javadocs, the auto-complete, and the instant red-line marker: Whoops, that’s wrong. Please fix that to keep me from having to wade through a very large series of silly mistakes when I get around to running my doodles, learning GWT was fun. A lot of fun. I was smiling all the way through, amazed at what I could build with only minutes and no reading of any documentation whatsoever.

TurboGears in the mean time threatened to wipe my left pinky out for having to press cmd+tab so often. Fun it wasn’t. In this phase, having a language that allows very compact code tricks is something that might be fun when learning how to program, but consider this:

If you’re like most people and only reach expert level in one programming language, you only go through that process once. Picking up new tools and libraries is something you do once a year if not more often.

Knowing how to navigate java’s verbosity with patterns and eclipse templates is something I can do already. I’ve learned that once. Getting a massive boost in picking up new tools is priceless, and pays out -every- time.

Making your language easier to pick up whilst making new libraries and tools harder to learn down the road is a bad trade-off that might create fuzzy feelings when you dive into the language itself (It certainly did for me. When I decided to try out python I really liked it - until I started writing actual serious projects in it, then I turned into the java evangelist you know), but bites you in the arse in the long run.

Sidenote: GWT is -really- cool, and if your project can operate in a primarily SPA (Single-Page-App) way, it makes web devving so much easy, it’d call it revolution.

Leave a Response

(Note: if you use a new name from an unknown ip address, your comment won't appear until I approve it. Anti-spam measure only, I don't censor).

Imhotep theme designed by Chris Lin. Proudly powered by Wordpress.
XHTML | CSS | RSS | Comments RSS