July 30, 2010

Adios, Java! I hardly knew ye

Posted in Uncategorized at 3:17 pm by dgcombs

After some sincere reflection on how I spent my time building a little firewall logger/reporter, I realized that I’d spent way more time digging through Java documentation to get JSP calls working than I had designing or developing anything else. Java is a very complex programming language and I wonder if that complexity is often mistaken for powerfulness. Apparently, I’m not the only one who wondered. Misko Hevery wrote a treatise on this topic.

But JSP pages provide a powerful process to present data dynamically derived from programs (say that five times fast!). What on earth would I use to replace such a key feature of the bot-search engine? PHP? The AQA has removed PHP from its requirements. As much as I like PHP and as much as Caucho’s Resin supports PHP natively in Java, I just didn’t want to further muddy the waters with another programming language.

Misko mentioned Node.js in his blog post, I thought, “Perhaps I should look into that.” I began to notice that other folks not only noticed Node.js, but also thought it was important. So I set out learning about it. No sooner had I stepped onto the plain of learning, than I found myself in the middle of a flame war between avid Noders and avid Erlangers and avid Haskellers! Tossed this way and that way, dodging the slings and arrows I retreated a step. What was my goal?

To simplify my life. To get focused. To get things done like a Zen Master.

So I decided to keep my head down, my ear to the ground and my nose to the grindstone. How I got anything done in that position, I’ll never know! But I finally got smart enough to get Hello, World! off the ground. I used a little help from Naked Javascript. And a lot of help from How to Node.

#!/usr/local/bin/node
var http = require(‘http’);
var sys = require(‘sys’);
http.createServer(function(request,response) {
        response.writeHead(200,{‘Content-Type’: ‘text/plain’});
        response.end(‘Hello World\n’); }).listen(8214);
sys.log(‘Server Running at http://127.0.0.1:8124‘);

Now that I’ve gotten this far, I’m starting to use JavaScript and Node.js for everyday things. It’s like trying to do 100 pushups. You have to start small. If you’re a 90 pound weakling like me, you have to start really small.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: