Monday, July 11, 2005
I Can Already do That!
Some day around twenty years ago, back in the days when I knew absolutely nothing about computers and programming, I was nonetheless writing a sequence of statements in Basic – I don’t dare to call it a program. I’m talking about a time when, unlike now, there wasn’t a computer in almost every office and home, and kids didn’t start operating and programming computers long before their first love kiss.
I was at the time a young first-year college student in economics, and all my knowledge about what a computer was could be summarized in what I had so far seen in the movies. And I mean those times’ movies: a huge cabinet covering an entire wall and displaying a mystifying collection of tiny titillating colored lights.
But it was my fate that I got a job as the messenger boy for a computer hardware shop, and one day curiosity led me to a Basic Reference Manual besides an unoccupied Wang PC. Reading instruction descriptions in the manual and looking at the examples I began experimenting whit this computer thing after my working hours. Some days later I was able to paint a sequence of circles in the screen, varying its size and color, and making them zigzag and bounce on the screen borders. Trivial, yes, and absolutely useless too, but I was so proud of my recently acquired “programming skills” that I dared to show it to one of the engineers. He looked unemotionally at what I had written, and focused in a section that read something like this:
He then proceeded to show me how this could be expressed as:
or even better as:
After he explained me how these for and while worked, I looked at him with puzzlement. “But… isn’t that the same thing I had already written?” I humbly asked, thinking I was surely missing something. “It produces the same results, yes…” was his only response. “Then, what do I need that for? I can already do that!” I shoot back at him, all my humbleness suddenly lost. He didn’t respond. Instead, he gave me an enigmatic smile, a “you’ll eventually get to that, little grasshopper” kind of smile, and with that he walked away. It took me a while, but I did get to it, and I always thank him for letting me figure it out by myself.
But learning why using a for construction was better than writing its equivalent if-goto combination was only a part of what I got from that experience. I also learnt that rejecting something new just because “I can already do that”, is foolish and almost always a sign that I'm completely missing the point.
In software design and programming in particular, there are very few things, if any, that are absolutely needed in the sense that you can’t do it in some other way. But clearly some ways are better than others, at least in some situations, so why should I reject a proposed new way just because “I can already do that” in the older way?
We don’t need structured languages in order to write structured code, and we don’t even need structured code in order to write a given program. Similarly, we don’t need object oriented languages to write code in an object oriented way, and of course we don’t need object oriented code either. I may or may not like object oriented programming, or structured programming, or any of the languages that support them, but rejecting any of those on the basis that “I can already do that” without them, makes no sense. Still, I’m sure that when those ideas were initially proposed, many objections of that kind were heard.
Whenever I’m presented with a new idea and I find myself thinking “I can already do that”, I remember those circles in Basic and force myself to think again without saying anything; I know I might be entirely missing the point. When it’s me presenting something new and I got “I can already do that” as a response, then I know it’s my time for a “you’ll eventually get the point, little grasshopper” silent smile.
I was at the time a young first-year college student in economics, and all my knowledge about what a computer was could be summarized in what I had so far seen in the movies. And I mean those times’ movies: a huge cabinet covering an entire wall and displaying a mystifying collection of tiny titillating colored lights.
But it was my fate that I got a job as the messenger boy for a computer hardware shop, and one day curiosity led me to a Basic Reference Manual besides an unoccupied Wang PC. Reading instruction descriptions in the manual and looking at the examples I began experimenting whit this computer thing after my working hours. Some days later I was able to paint a sequence of circles in the screen, varying its size and color, and making them zigzag and bounce on the screen borders. Trivial, yes, and absolutely useless too, but I was so proud of my recently acquired “programming skills” that I dared to show it to one of the engineers. He looked unemotionally at what I had written, and focused in a section that read something like this:
310 I = 1
320 CIRCLE (X+I, Y+I), 30, 15
330 I = I + 1
340 IF I <= 50 THEN GOTO 320
He then proceeded to show me how this could be expressed as:
310 I = 1
315 DO
320 CIRCLE (X+I, Y+I), 30, 15
330 I = I + 1
340 LOOP WHILE I <= 50
or even better as:
310 FOR I = 1 TO 50
320 CIRCLE (X+I, Y+I), 30, 15
330 NEXT
After he explained me how these for and while worked, I looked at him with puzzlement. “But… isn’t that the same thing I had already written?” I humbly asked, thinking I was surely missing something. “It produces the same results, yes…” was his only response. “Then, what do I need that for? I can already do that!” I shoot back at him, all my humbleness suddenly lost. He didn’t respond. Instead, he gave me an enigmatic smile, a “you’ll eventually get to that, little grasshopper” kind of smile, and with that he walked away. It took me a while, but I did get to it, and I always thank him for letting me figure it out by myself.
But learning why using a for construction was better than writing its equivalent if-goto combination was only a part of what I got from that experience. I also learnt that rejecting something new just because “I can already do that”, is foolish and almost always a sign that I'm completely missing the point.
In software design and programming in particular, there are very few things, if any, that are absolutely needed in the sense that you can’t do it in some other way. But clearly some ways are better than others, at least in some situations, so why should I reject a proposed new way just because “I can already do that” in the older way?
We don’t need structured languages in order to write structured code, and we don’t even need structured code in order to write a given program. Similarly, we don’t need object oriented languages to write code in an object oriented way, and of course we don’t need object oriented code either. I may or may not like object oriented programming, or structured programming, or any of the languages that support them, but rejecting any of those on the basis that “I can already do that” without them, makes no sense. Still, I’m sure that when those ideas were initially proposed, many objections of that kind were heard.
Whenever I’m presented with a new idea and I find myself thinking “I can already do that”, I remember those circles in Basic and force myself to think again without saying anything; I know I might be entirely missing the point. When it’s me presenting something new and I got “I can already do that” as a response, then I know it’s my time for a “you’ll eventually get the point, little grasshopper” silent smile.
Labels: general



6 Comments:
I have never done any programming in my life, but this is still a very good post.
By
Sparkling, at 12:08 PM, July 14, 2005
I started picking up PHP this year and I can honestly say I've been there. For example, I spent ages writing an if statement to add the correct extension to a date (nd, st, etc) and then shortly realised soon after that the date function already had something to do it for me.
Not quite the same, but your post made me think of that, heh. Interesting blog btw (surfed in via BE)
By
Jem, at 12:30 PM, July 18, 2005
So true, I remember my early days programming Basic in the 80s, who would think that it would stand me in such good stead for my future career?
By
Ben Dash, at 1:32 AM, July 23, 2005
After having done two years of high school Pascal programming, I was fairly confident that I was one of the best programmers around. After all, I did score a 5 on the A.P. exam!
Then I began studying computer science in college. My professor started teaching us OOP using Object Pascal. I remember thinking to myself, "This is stupid. Why should I make my functions a part of my 'objects' when normal functions/procedures do the job just fine?"
Fortunately, I took a two year break from school after my freshman year (not for academic reasons) and when I returned, Java had overtaken Pascal as the introductory language of choice at my alma mater (BYU). I was forced to write in Java (I had pretty much forgotten Pascal, anyway, after two years of absolutely zero programming). After that two year detatchment from my old ways, OOP sunk in immediately and it has made a world of difference!
I'm also reminded of a quick story my co-worker related to me about his early experiences in computing. A friend of his tried to show him how cool it was that you could put files into folders and even subfolders. My co-worker thought that was only mildly interesting. If everything's in the root folder, after all, you don't have to look very far to find it. Incidentally, these many years later, I've seen my co-worker's email inbox. He has hundreds (perhaps even thousands) of emails in his inbox, and virtually zero in any folders. :)
By
Stephen Ward, at 12:30 PM, July 26, 2005
You started programming on this day 20 year ago, I born on this day 23 year ago :).
By
Alok, at 3:54 AM, August 09, 2005
I started my programming life a few years earier, but in the same general tarpit.
I am often intrigued and amused by the 'purist' remarks - usually made by the very young people I meet in the class I teach on starting up a website. They seem to have engineered a collective fetish for hand coding everything in Notepad. Or maybe it's a twisted form of inheritance.
If you wanted to create a screen full of different sized and coloured shapes to bounce around the screen today, would you dig out a copy of Wang Basic? And a 7 inch Floppy Drive? If the answer is 'yes' then you're in luck - I found someone who still has a couple of Wang minis! DigiBarn
By
StoryCharms, at 8:18 PM, September 07, 2005
Post a Comment