Everything I Needed to Know About Programming I Learned from BASIC

Edsger Dijkstra had this to say about Beginner's All Purpose Symbolic Instruction Code:


This is a companion discussion topic for the original blog entry at: http://www.codinghorror.com/blog/2008/04/everything-i-needed-to-know-about-programming-i-learned-from-basic.html
1 Like

Too funny. The 2600 basic programming cartridge to Atari 800 basic constituted my entry into the world of programming as well. At first, I had no tape drive and no disk drive, so youā€™d type in a program (usually from a magazine), play with it for a while and then press the reset button and start all over again. The best would be when a program listing had a whole bunch of assembly code that you would ā€˜pokeā€™ into some address. Youā€™d be typing in a huge string of gibberish and if there was one typo, nothing would happen when you ran program. Or if you were really lucky, youā€™d get some garbage displayed on the screen.

I wouldnā€™t trade that early experience for anything. :slight_smile:

Dijkstraā€™s quote does have a ring of truth to it.

My first programming language was VB5, followed by VB6, then only briefly Java until I went into college to study CS.

Looking over my old VB6 projects, and old emails with my first professor (I never delete emails), made me realize just how bad of a programmer I was. I still made cool stuff (it was amazing when I discovered the Microsoft Speech SDK - I totally had that thrill you described, jeff), but I didnā€™t understand OO at all. For a long time, when programming I would actually think only in VB.

But alas, I was saved. I graduated with a degree in computer science, having learned tons of languages and programming paradigms. But, if it wasnā€™t for a university CS education, I know Iā€™d still be stuck in the dark ages with that old VB mindset, even if I continued my hobbiest programming.

(Insert obligatory good-natured complaint about how ā€œFortranā€ is being used synonymously with ā€œbad codeā€, when these days itā€™s evolved into a perfectly good structured language thatā€™s got some significant advantages over C and C++ ā€“ which, by comparison, have remained largely stagnant since they were invented.)

commadore 64ā€¦ my uncle had one.

I grew up with Basic, too - back in the good old days of 80286 cpus :slight_smile: I started with GW-Basic as a 8-year old and learned to code my first game. Later I moved on to QBasic, Turbo Pascal, Delphi, ā€¦ Without Basic perhaps I would never have started programming. Dijkstra is a nice guy - but not always right :smiley:

I couldnā€™t agree more, especially considering Iā€™m one of those ā€œprogrammers of a certain ageā€.

I remember vividly one of the first programs I have analyzed - a phone book that was included in the (5 1/4", of course) floppy that came with my first computer, an Apple II.

Since I was learning my way into BASIC, I couldnā€™t understand how the software could keep the entries between boots, since there was no data file!

Then I looked the code, and it had some lines like these, in the beginning:

10 REM ......................................
20 REM ......................................

After insterting an entry, next time it would look like this (Iā€™m oversimplifying here):

10 REM Altimari, Rubens        257-9637  ....
20 REM ......................................

In other words, Iā€™ve learned, right in my first weeks as a developer, still in high school, the concepts of memory as a single repository for data and code, as well as several dirty tricks related to direct memory access, saving things on disk programmaticaly, and so on.

I wonder how Dijkstra would feel about thatā€¦ :-]

Rubens

Yes, a lot of us began learning to program with BASIC, but that doesnā€™t make it a good language. I learned to ride a bike with training wheels, but you wonā€™t see any of those on my bike now.

Iā€™m in high school and looking to start programming. I have the Programming for dummies book (it was a gift) and it includes tutorials in Liberty Basic and a disc for it. Is basic in general a good language to start with, with so many other languages available now? I donā€™t want to get stuck with the problems understanding Object Oriented programming that other people have describedā€¦

Great post. And just curious, did anyone get started with programming through Texas Instrument Graphing Calculators (TI-82, TI-85, etc.) like I did? I can honestly give credit to TI-BASIC for sparking my interest in programming.

Great post, brings back a lot of fond memories!

I first learned BASIC on a machine (confusingly) called the BBC Basic, which was the only computer in my primary school. Consisting mostly of ā€œguess the numberā€ type games, and the occasional screen full of brightly coloured text I also felt the buzz of this ā€œbrave new worldā€ and was hooked. Next came the ZX Spectrum, and the weird and wonderful experience of cassette tapes, but then came the Amiga 600ā€¦ I soon left BASIC behind and became an ARexx lover, before going on to learn Pascal, which taught me the fundamentals of OOP - useful concepts that I still carry with me today.

I can see where Dijkstra is coming from, but without BASIC there wouldnā€™t be nearly as many hobbyist coders as there are. These days I work in a school, and see kids in the IT room getting their first taste of coding with VB scripting in Excel - not something Iā€™d want to be doing myself, but everyone has to start somewhere. Those of them that are determined enough to take it further will, just like our generation did - and these are the developers of tomorrow. As much as I dislike BASIC, I believe itā€™s a crucial first stage for a huge number of coders, and for that reason alone shouldnā€™t be entirely dismissed.

I grew up with GW-BASIC in the mid-80s. I loved programming, and I actually made some reasonably complex software. Iā€™m convinced the accounting software I created was what landed me a scholarship to a prestigious private school here in Sydney. Other software: a graphics program, many, many games (culminating in a loderunner type game with a level designer), a text editor and many others. I even built an interpreted language IN BASIC (these days the cool kids would call it a DSL, and yes, I was crazy and young).

Ah BASIC, like you said it was the first language I programed in (good ole TI-83) Thats why I am here now studying Computer Science Network Security. I fell in love with programing because of BASIC.

Arenā€™t you supposed to be working?

Yep, it is a bit of nostalgia there. I was programming in BASIC on my Apple IIe when I was about 6 years old. Havenā€™t stopped programming since.

I think the thing that Dijkstra was getting at had more to do more with the notion of knowing how to program in BASIC does not really demonstrate oneā€™s mental ability and maturity of thought processes to program more sophisticated solutions demanded of harder problems only realistically implemented in more sophisticated languages.

ie: Just because you are in command of the BASIC language and perhaps can even use it so solve some potentially useful problems, does not necessary demonstrate you have the inherent skills needed to solve more complex problems. Of course, somewhat contrary to Dijkstraā€™s exact word choice, just because you only know BASIC doesnā€™t necessarily mean that you donā€™t have that ability once truely enlightened by a superior language.

Joel, I think, addressed this bent on the topic well relative to his comments about Java in the following article:

http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html

I never got around to code in BASIC, i see it as a reserve for the oldies (programmers who started in the 90ā€™s).I guess you didnā€™t need to know OOP then, concluding from your title.

"If anything, BASIC opened the minds of millions of young programmers. "

Yes, thatā€™s all good and well. But young kids grow up, move past a language for Beginners and move on to something else.

The whole IDE ā€œmethodā€ of software development introduced by Microsoft (with Visual Basic) got too deeply in some peopleā€™s heads, allowed too many bakers and butchers to ā€œprogramā€, and were never able to dig their way out. Plonking controls on a form is fine - but hooking up datasets and controls on a form, text boxes, dropdown lists, etc. to datasets on the form is a horrendous way of doing things. Not to mention polluting all the code in the forms with database connections, SQL statements, etc. - you end up with a massive ball of spaghetti. This way of doing things, at least for anything but the five minute Microsoft demo showing off Visual Basic, some article or anything even remotely more substantial, itā€™s just not kosher. Sure, great to get you started, and you can improve as a developer with BASIC, but a lot of people donā€™t move on and stay with corrosive habits learned early on. And I donā€™t necessarily mean move on away from BASIC, I mean to move on with learning new and better skills. Basically, BASIC has a lot to answer for - especially Visual Basic 6.

I grew up on Spectrum Basic and was very surprised to find out recently that it had support for functions. Amazing.

I owned the Atari 2600 BASIC cartridge when I was about eight and taught myself how to ā€œprogramā€ on it. The only thing I ever really used it for was writing programs that would play little songs Iā€™d write in BASIC. I still hum one of my mutant compositions to this day. :slight_smile:

The good that came out of it is that my parents saw how enthusiastic I was about it and bought me an Atari 800, which I used to teach myself Atari BASIC and write a bunch of silly applications and games on that.