(Disclaimer: this is ranty. Don’t say I didn’t warn you.)
I’m old in internet years. I was there for the first browser war, fighting my way through layouts made with
<table> tags while adjusting margins with
I’m talking about Node.js, of course. Everybody wants to jump into the real-time web bandwagon, and Node.js is the passport to the promised Web 3.0 land (or is it 4.0 already?). Single-page apps! Asynchronous connections! Websockets! Webscale! Woo!
Of course it’s not all bad. There are amazing frameworks like Meteor and Derby that make it very easy to create real-time collaborative apps. Express is a pretty good platform to create JSON APIs and regular websites that, admittedly, perform way better than Sinatra (the Ruby equivalent). But I can’t help thinking I could achieve the same results with less hassle if, say, Python was picked up by the hipsters as the foundation of the “new” asynchronous web craze (it has Tornado after all).
To be honest, my hopes lie with Go right now. It’s still a bit rough around the edges, but so was Ruby when Rails exploded. Go is statically typed and compiles to native binaries, which makes it extremely fast and light. It’s also built for concurrency and includes pretty good standard packages to build networked and web applications. The only missing pieces are a decent package manager (the current state of affairs is frankly very messy) and a web framework that can bring all that potential to fruition. Revel is promising, but it’s still missing a few key parts to make it brilliant.
It’s interesting to note that Go and Node.js even share similar patterns. Error handling is a good example. Here’s a Go snippet to read a file and print its contents:
1 2 3
1 2 3 4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Go has type structures that can contain data and functions, therefore working just like classes (but only if you want to). It even provides inheritance through embedding.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
All things considered, it’s a good time to be a developer. It’s a pity the best technologies seldom become the most popular, while inexplicable fads take over the landscape from time to time. Such is life. But if people could realize that abandoning SQL completely wasn’t such a good idea, who knows? Maybe the best tools for the job can become more popular sooner rather than later.
* jRuby is a completely different story, though - particularly the latest release. But then you need to run your code in the JVM. Take that as you will.