Basic Mental Mutilation

Once during a job interview I mentioned that I had been programming since I was ten. At the time BASIC was all the rage. Or maybe BASIC was all there was. Anyway there was no Internet so where could a kid find a GNU C compiler in 1985? Er - hang on, there was no GCC in 1985 … plus, even Bill Gates wrote programs using BASIC back then. So for all I knew I was on the bleeding edge of technology ha ha …

(Cue nostalgic aside only the author finds funny) I wonder if any of you have heard of Typing Tutor III with Letter Invaders for the IBM PC. I was mucking around with its source code, changing bits and pieces here and there to see how it works, until one day I went a bit too far and broke it. I didn’t know how to undo my changes, and I hadn’t made any backups. My Dad was not amused; I think he had spent good money to purchase a licensed copy.

But I digress. The point being, I now realize that just because I played around with BASIC when I was a kid, it doesn’t necessarily mean that I’m some kind of programming prodigy. Actually I think I sort of realized that all along, but after reading Code Complete 2 and Jeff Atwood’s Coding Horror, my thinking has crystallized.

This is what it boils down to: a good programmer will have a well-honed instinct for separation of concerns. In other words, to “break a computer program into distinct features that overlap in functionality as little as possible … achieved through modularity and encapsulation” [1]. The subroutine, or function, is the basic building block of modularization. It either takes years of experience or inborn talent to be able to come up with well-written functions that do one thing well, are loosely coupled, highly cohesive, astutely parameterized, and fits in a screen.

And BASIC … well, it goes by line numbers, and its building block is the GOTO statement. Sample BASIC program:

	10 GOTO 20
	20 GOTO 10

Always good for laughs, that one. But seriously, BASIC goes completely against modern programming best practice. BASIC programs turn out to be one big monolithic block, are completely unstructured, and logic flow jumps about like crazy. Edsger Dijkstra, a well-known computer scientist, even went so far as to say:

It is practically impossible to teach good programming style to students that have had prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration.

I think he was being rather tongue-in-cheek. But to be on the safe side, from now on I won’t ever mention that I started out with BASIC. I don’t want to be dismissed by my interviewer as being “mentally mutilated beyond hope of regeneration.”

Notes

[1] From Wikipedia, of course.

10 June 2008 | Software engineering | Comments

5 Responses to “Basic Mental Mutilation”

  1. 1 Gunja Farmer 10 June 2008 @ 3:33 pm

    Yup, i was there. He was pretty mutilated back then.

    10 CLS : Color 29,1,4

  2. 2 The Zik 10 June 2008 @ 8:45 pm

    Oh crap! BASIC flashback! Really loved that thing to pieces. Remember the gorilla game? Didn’t play it as much as i played with the codes! Especially love the infinity loops. Now i feel like making a Flash Application.

    Damn you Rizal Almashoor.

  3. 3 fadzlizuka 11 June 2008 @ 12:21 am

    ewww crap.. am i one of those.. ?

    me actually QBasic not Basic .. hahaha.. aci tak?
    so im not mentally mutilated beyond hope of regeneration kan? kan?

  4. 4 Ady 11 June 2008 @ 2:33 am

    Ya ya.. I played with QBasic myself. What was that snake game again? There was a name for it I can’t recall.

    Newer generations only know that game from Nokia cellphones.

  5. 5 Gunja Farmer 11 June 2008 @ 11:56 am

    TRON was something like the snake game…but cooler cuz u could play against a human opponent

Comments:

  1.  
  2.  
  3.