Apr 30 2008

Unlimited CPU Power, Endless Memory and Syntactic Sugar, or “How I Learned to Stop Obsessing and Love Scripting Languages” (*)

Published by David HM Spector at 3:44 pm under C/C++, Java, OS X, Programming, Ruby/Rails

*

 Apologies to Stanley Kubric and Dr. Strangelove.

This is sort of like an intro to some 12-step program..

Hi, I’m David, and I’ve been a computer language bigot.

There. I feel better already.

But seriously, I’ve been a programmer for a long, long time. Not quite as long as my friends Richard, Pete, and Bill who have between 14 and 22 years on me, but even in Internet years, my ~30 yrs of professional software work is not a small amount of time. In all that time I’ve had some very strong views on programming languages: I loved compiled ones. You know, like the Algol family that includes, Algol, PL/1 C, Pascal, Modula, and, tho’ not my fave’ by any stretch, even Ada. Of course Fortran is a great language too. COBOL and I never really got along, not because it wasn’t useful, it was just too sleep-inducing.

Assembly languages were fun too. My first assembler was Macro-36 on the PDP-10; I was also fluent in 6502, x86, and 680×0 too.

These are all real manly languages. They take work, you have to understand the metal. yadda yadda.

As a Systems Programmer and system admin for many years, I also learned to live with, and sometimes even like Perl, which though not a compiled language is probably one of the most useful tools on the planet if you’re writing accounting packages for your boss or you need to write lots of quick and dirty little tools.

In the 90s and forward I, like most people, dove into Java which, for all intents and purposes, is a compiled language — the JiT runtime in every modern Java environment generates native machine code. Java is a pretty serious language. I use it a lot. It’s powerful, has more connections to more things/services than most older traditional languages and, unlike C++ is pretty consistent from platform to platform with regard to what works and what’s going to bite you in the butt.

With the return of NeXT.. er, I mean Apple I also got into Objective-C which is very, very elegant in it’s terseness and even though it’s only really useful on one platform (IMHO the world’s most elegant user experience and my personal fave’ having been an developer for all things Apple since the late 70s) it’s a great programming environment and I’ve learned a lot from it.

Well, I resisted all things “scripty” (read: Python, Ruby/Rails, Groovy, etc) since they became the rage because there was just something fundamentally wrong about these little languages and their diabetes inducing amounts of syntactic sugar, an their utterly horrible performance on all but the most up to date machines. Of course with Python there’s that whole silly white-space issue which I still detest, but am learning to overlook. ..but I digress…

Well… I’ve had a “come to <pick your deity>” moment. CPU speeds have leveled off for the moment, but the number of cores and cache available to your j-random machine keeps getting bigger. Memory isn’t costing $500/mb like it was in the 80s and well.. I guess my great concession is: “so what if I am burning CPU through cycles like Paris Hilton blows through cash..?”

I’m finding that unless we’re all forced to go back to PDP-11/04s it just doesn’t matter. I am sure if several of my old professors like Robert BK Dewar and Michael Overton saw this they’d start throwing up and never stop, but… this is the difference between an academic exercise and the reality of the everyday computing world where PoGE — “the Principal of Good Enough” — rules. People optimize where there are bottlenecks not just becauze they can.. and this is, now finally, as it should be. Don’t worry, be happy: computer power is bascially free. This is probably the great conclusion of the scripters versus the compilers … (We won’t talk for now about the power required to actually run those data centers where these machines live — different conversation.)

One thing I have decided is that I am out of the language wars. Java, Ruby, Python, Groovy, Scala. What. Ever. Bring’em on. The advent of projects like jRuby, and Jython (these are versions of Ruby/Python that run inside the JVM) are probably the biggest boon to software development in years - with these tools you get the best of ALL of these worlds, all at the same time: you get access to Java’s deep and wide libraries/packages for connecting to just about everything in the enterprise and corporate universe(s), and with all the sugary goodness of Ruby and Python (and Groovy, scala, et al) you get really, really fast iterative development cycles.

The really nice thing is that you can scale from tiny little apps which are fast to cook up and and run on a single server (I am working on a small financial service app for a client in Ruby/Rails right now that will only ever support a few hundred users) to enterprise scalable/supportable apps with the same code. Just change the runtime .. e.g., native Ruby for tiny apps, jRuby when you need to scale up.

I think the folks in the scripting language camp (and the Java camp too) need to get over themselves a bit more tho’ ..Hybrid apps are more and more going to be the way to go. Use the right tool for the right job — that doesn’t mean you can’t do any particular job in any of particular language.. it means, to steal a Ruby-ism: “DRY” — Don’t Repeat Yourself. If there’s a Java package that’s already available that does heavy lifting for you in your project: use it! Don’t reinvent wheels… who has the time for that any more? Ditto for the Java universe where constructing UIs is like taking your own appendix out with a rusty beer tab. Ick.

What makes, for larger apps, this hybridization model really scale is that if you add in Terracotta, you’ve got distributed clustering basically for free.

Oh, did I mention you can do all this wonderful stuff in IDEs that would have costs you thousands of dollars just a few years ago, but are also free like Eclipse, NetBeans, and even XCode? (IDEA is great, but it’s ~US$800…) I mean what a great time to be writing software …

I think the takeaway for software developers of every stripe is: being an agnostic polymath is the way to go. What’s another language? ~10 days of learning it and it’s another arrow in your quiver. All of these languages/tools have their warts.. use what works in the best context to get the job done in the most supportable way.

The take away for management everywhere is: if you’re not a programmer, don’t try to dictate how your programmers work. You should insist systems/products be 1) well documented, 2) supportable (i.e., they scale and have appropriate management interfaces and tools) but don’t get hung up on the languages; you’ll only hurt your own development efforts if you do. Oh, and of course, you’ll be giving an opening to your competitors who are not so hung up on these no-longer-relevant details…

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.