CMP -- United Business Media

Intelligent Enterprise

Better Insight for Business Decisions

UBM
Intelligent Enterprise - Better Insight for Business Decisions
Part of the TechWeb Network
Intelligent Enterprise
search Intelligent Enterprise





December 10, 2003

Code Confessions

You can teach old programmers a new trick, but they still know a better way.

by Joe Celko

I've decided I'm getting old. Everyone else I know had already arrived at the conclusion a while back, but I didn't pay attention.

The first sign of old age was when I realized that the trade show giveaways I use everyday are going for big bucks on eBay. I've never had to buy a mouse pad, but I've worn them out. I've a drawer full of t-shirts with computer company logos on them — most of the companies have been out of business for decades. My luggage includes canvas tote bags with logos for those same companies. The only items I'm now forced to buy for myself are pocket protectors (plain, no logo, special order at Staples or Office Depot). That's a real sign of being an old geek!

Best of the Best

But what really brought my aging home was when my company sponsored the 2003 TopCoder Open. I was invited to drop in on the chat room for the contest. I know people on SQL newsgroups, but it was a whole new community and medium for me. Yes, let it be known, I had never been in a chat room before Oct. 1, 2003.

With newsgroups, you have plenty of time to consider and edit your stupid, misspelled remarks before you actually post them. You have no such luxury in a chat room. I watched as more than 350 people with various nicknames came in, milled around, and left the chat room. Their virtual movements made the screen scroll so fast that I couldn't read a comment, ponder it, and post a reply before it left the window. Apparently, the regulars have no such problems.

When the contest started, there was nothing to do but look at a grid that displayed the time left and the progress of each contestant on the three problems they were assigned. Or go and get a beer and come back when the results could be displayed.

And once more I felt old when I looked at the grid; these guys were fast! Programming contest problems aren't real-world situations. The problems tend to be more abstract than in real life, such as "given the binary representation of a number ..." or "given an (n) by (n) array of letters and the following rules for transforming the array...."

You also don't have to document your answer (as if you'd have time during the contest!). The judges and the observers do perform a quasi-quality assurance after you release your answer, but it isn't part of the original specifications. And if you have a bug, you lose points without a chance to repair it and put it back through quality assurance.

The Good Old Days

Now for a confession: I don't do procedural programming anymore. I started life as an honest, hardworking FORTRAN programmer in the days when you spelled the name in all uppercase letters. I moved on to Algol, C, Pascal, and specialized statistical languages later in life. I didn't know the languages the contestants were using. Oh, I could figure the C-based languages the same way I can muddle through a Latin-based human language to get the flavor of the algorithms. But that isn't the same as being able to read the language.



Rate This Article

Comments:

Optional e-mail address:

While the judges were awarding points, the system exposed the problem specs to the observers in the chat room. I looked at them. I came up with a way to do all three problems using SQL, and I'm planning to code the easiest one this week for fun. I know how to do the job in fewer lines of code than Java or C++ — that is SQL. I like to think I can do it faster than most of the contestants — that is vanity. And I also know that you should never do this kind of "bit fiddling" in SQL — that is wisdom.

And it's also the final sign of old age. You have one tool left in your toolbox, can do anything with it, and you're finally old enough to know better.


Joe Celko [celko@northface.edu] is vice president of RDBMS at North Face Learning in Salt Lake City and author of five books on SQL.







IE Weekly Newsletter
Subscribe to the newsletter
    Email Address