Last minute geek

last minute tech news from around the net

You are here: English WTF Theory Versus Reality

Theory Versus Reality

User Rating: / 0

I went to college at the State University of New York at Albany, where back then, most of the Computer Science curriculum courses were entitled Theory of xxx. The programming assignments were the usual small-scope demonstrations of some feature of programming, typically something an experienced developer would code in 15-20 LOC.

My Masters project was to modify the TeX typesetting system (by Knuth) to leverage the more advanced features of a new typesetting system. It took me about two months to reverse engineer it only to find that the entire required modification amounted to a single character change.

Albert Einstein c1890s

The theory sunk in, but there was no practical application of it to reality.

Fast forward to my first programming job, where one of my tasks was to write a stand alone program that would read connection names from a file, verify that they were valid, and use them for something. There were about 350 different connection names, but they didn't follow any discernible pattern. There were a variety of letters and numbers in no particular ordering. However, there was a lot of substring duplication within the names.

Being a clueless but diligent noob, it dawned on me that I could leverage those semi-duplications so I wrote a huge progressive if-then-else statement to determine whether a name was valid.

For example, the list contained names like:


The code was in FORTRAN IV, so I'll just use pseudo code here. The logic for that little sub list looked like this:

   if (name.startsWith("AXLP11"))
      if (name.substring(6) = "22 or name.substring(6) = "33")
          name is valid
   else if (name.startsWith("BC")
      if (name.substring(2) = "XQ5566" or name.substring(2) = "YZ7788")
          name is valid
   else ...

This proceeded to about 5 levels deep and comprised several hundred lines of code. I even built a test case to verify every single one of the names.

Then I proudly turned it in to my boss, who instantly proceeded to laugh in my face. He pointed out that it would take forever to run through all of that logic for each of the millions of records (back then, the CPUs ran at a little below 4MHz with very little RAM), and that perhaps I should consider using an array and a binary search lookup.

It was at that moment that I realized the fallacy of taking only courses entitled Theory of xxx, that perhaps my college tuition didn't buy me all I had hoped, and started a years-long effort to learn Practical Application of xxx to make myself better at what I did.

[Advertisement] Manage IT infrastructure as code across all environments with Puppet. Puppet Enterprise now offers more control and insight, with role-based access control, activity logging and all-new Puppet Apps. Start your free trial today!

Read all
Comment Policy:
We pre-moderate any comments and welcome all kinds of thoughts, supportive, dissenting, critical or otherwise. We delete or censor comments that are:

* abusive
* off-topic
* contain personal attacks, or against any company or organization
* promote hate of any kind
* use excessively foul language
* is blatantly spam or advertising

We do not discriminate based on the person who is posting, and we never censor comments for political or ideological reasons. We never delete an appropriate comment because we disagree with its viewpoint or ideology, and we never publish an inappropriate comment because we agree with or support its viewpoint or ideology.

Attention spammers: we manually approve all comments. Spamming and blatant advertising will NOT be published on this site and is deleted immediately, you've been warned, do not waste your time here.

Add comment

Security code