Not only the new glitters
Connecting state and local government leaders
Even the most rational info-tech journalist can get caught up in hype. Good thing skinning a few knuckles on an actual project can jolt one into a more pragmatic view. We're just wrapping up a technical feature story on new Web application platforms, a story that will appear next week. We're going to get you caught up on a lot of exciting new technologies'Ruby on Rails, Ajax, ASP.NET, Flex. We're actually excited about all of these new ways of enhancing Web content.
So when we decided to build our own Web application last weekend, a simple page that included a function that would automatically count down the number of days left until an upcoming event, we knew that any one of those technologies could tackle the problem.
The problem was, not being intimately conversant in any of these technologies, we saw that each potential approach as one involving a long climb up a learning curve, not the kind of hike we wished to take on a sunny Sunday afternoon. And we kept looking. Sure, Perl could work, but the technical forums advised installing specialized math modules, and the project would still require digit-by-digit conversions from the Unix timestamp. Plus Perl's dense syntax always gives us a headache ('Write once, read never' one programmer quipped to us). Another forum suggested even writing a C program for the task.
In the end, the software we found could do the job most simply was a trusty old standby, the Unix BASH shell, along with the almost-antique Common Gateway Interface. After a bit of digging, we found that BASH could subtract one date from another, as long as you remembered to convert the strings into actual numbers. Once we figured that out, we then wrote an entire Web page as one long BASH echo statement. We established variables to represent the calculated numbers. Once it all looked pretty, we set permissions and threw a few headers on top of the script so that the Web server's CGI would parse the file correctly when it was called by a Web browser.
Even with our rudimentary scripting skills, there is a lesson here: Look for the best tool for the job, and don't stop searching at the latest and greatest. CGI, which has been kicking around for over a decade now, is offered by just about every Web hosting service in the world. BASH hails back to the late 1980s, and comes with every distribution of Linux. For us, both were readily available, both were free and they both did the job quite nicely.
--Posted by Joab Jackson
NEXT STORY: DOD to revamp contracting in Iraq