Friday, December 11, 2009

Fundamentals of Modern Software: CGI

You might be asking, "CGI?  Are you talking about that 20th century web application technology?  Common Gateway Interface?"  Absolutely.  But not in the way that this blog title suggests.

Before I started writing Java software for a living, I went to school to learn about computer science.  I learned some good things, but I feel that, in retrospect, my educational experience in computer science is best characterized by a litany of the things omitted in my coursework.

School somehow fails to cover some important fundamentals.  Realizing the grief I could have been spared, if I had been exposed to these things a few years back,  I am compelled to spread the love.  Hopefully, I can save some young engineer some pain and suffering.

Today, I'm recommending CGI.  CGI is a mechanism that allows a web server to execute a local program that will prepare the response for the client, typically a dynamically generated HTML page.  Admittedly, CGI is an old school technology.  It's definitely still in use, but it's not J2EE or .NET by any stretch.  In fact, it's kind of low level.

However, it's low level stature makes it a perfect place to learn the fundmentals of HTTP based software.  These days, everything is a web application it seems.  But the technology that we build these applications on is at such a high level, that it's nearly impossible to see the cogs and wheels of what is, after all, a simple machine.

I've been writing web applications in Java, at a high level, for quite some time now.  I've even written a book about a popular Java web application framework, Struts 2 in Action.  But I still found it remarkably clarifying to do a little CGI work.  I've never done it before professionally.  And I never learned about it in school.  How much easier could my life have been if I would have done something like this tutorial while in school?  I think it might have saved me dozens of hours of suffering over the years.

Check it out and let me know what you think.


甜蜜滋味 said...
This comment has been removed by a blog administrator.
Anonymous said...

Great tutorial and it covers the fundamental html components.