Everything I Needed to Know About Programming I Learned from BASIC

QBASIC…man I remember reading the source for Nibbles and Gorilla. It was beautiful.

I’m surprised no one has mentioned the Micro Adventure books!
http://en.wikipedia.org/wiki/Micro_Adventure
These were essentially a beguinner’s guide to BASIC, with a fun storyline to boot. I think I had most of them as a kid; I wonder if my parents have thrown them out already. I loved trying out the programs in them. Those were the good old days.

And long live the Pirate Adventure cartridge. Give fish to crocodiles. Say Yoho!

Oh my God, I hated that text adventure! I don’t think I ever got out of the first room, with the rug nailed to the floor…

http://www.gamesetwatch.com/2006/07/gamesetinterview_adventure_int.php

Dijkstra doesn’t backup any of his statements. So I see him as just another religious nut who thinks his way is the only way.
A piece from Code Complete comes to mind. We write WITH a programming language, and not IN a programming language. Meaning that we should use languages as tools and not as a distraction.

The article brought back fond memories of my TRS-80, and the things about performance, speed, and virsatility in development that it taught me. I never believed (and still dont) that I know everything I need to be a great programmer/developer. I still study new techniques, new languages, and try to bring everything together to build the best individual product that I can. I’m also not unwilling to revisit old code… and improve on it. I write mostly thin client now, and I find that ASP has many of the same issues with it as early basic had … performance = 1/(size*speed). Perhaps the guys who write MS Office and Vista should be required to spend a year writing software for the TRS-80 Model I. If it can’t be stored on the tape drive and loaded into 4K ram, it can’t be released!!

The BASIC Dykstra knew “in the day” bears about as much resemblance to VB-dot-anything as does an ox cart to the automobile. They both have wheels, and both can get you into accidents if you aren’t careful.

I learned about “real programming” which at the time meant “structured programming” after learning TRS-80 BASIC, a dialect somewhat better than Dykstra’s, though not much.

What was interesting about the structured programming course was that while it Taught structured programming, the FORTRAN dialect (FORTGI under IP/CMS iirc) didn’t really support it. This lead to lectures along these lines:

“This is a while loop…”

“And THIS is how you implement the while loop in FORTGI…”

That involved inverting the test condition and an unconditional goto to get back to the initial test.

Several years later I was using QuickBASIC, which supported all the structured programming constructs one might want, while hearing about this new language called “C” …

There was a Pascal compiler for the ZX Spectrum. I remember seeing a compiler advertised, but didn’t every see a copy of it.

From http://usuarios.lycos.es/scratchupload/spectrum/ it appears that the manufacturer was HiSoft.

August 1985 … Scientific American; Martin Gardiner’s “Mathematical Recreations” carried probably the first popularization of Mandelbrot sets and all that. That’s when I learned to do what I did so often later: on my C=64 I wrote a “microscope” in BASIC, using it to call BIOS and hand-crafted assembler routines. A coupla years later I did the same using the original QuickBasic 4.5 on an XT: use BASIC to string together Fortran routines for the math and C routines for mouse and graphics.

It’s quite possible to write good code in BASIC … it just ain’t likely!

thanks for this walk down memory lane

–bentrem

I guess kids of this generation ( that includes me ) are lucky because we have Python ! The first time I saw basic, it was in a computers class in school and I hated every bit of it. It looked disgusting. Python was excellent. The indentation, the readability… paradise. Python has excellent documentation and a community that loves teaching first-timers. I believe I saw a comparison once:

“Python is to Basic as Optimus Prime is to a truck.”

Great post Jeff. Like most here, the memories… thanks.
The first time I saw that comment by Dijkstra, some time close to getting my CS degree, I felt a wave of guilt, confusion, almost hopelessness. I didn’t know at the time, when I was 9 and I got tired of playing the Star Raiders game that came with the Atari 800 and my dad told me after dropping all that money on a computer I had to write my own games using Atari Basic, I was crippling my mind and coding ability and future. And after expending every keyword, learning how to peek and poke memory, digging even a little into assembler, I didn’t know I was dooming myself. And through the nights of GW-Basic, then QBasic, I didn’t know I was sentencing myself to…
Hey, wait a sec, I picked up OOP the same way, code C#, C++, Java, PHP, VB.NET, vb circa 5.0 6.0…
As much as I respect Djikstra and his contributions, Basic is what it is … A GATEWAY DRUG :slight_smile:

Major flashbacks here too. I had that Atari cartridge too. Got bored pretty quickly when I realized that no persistent storage=waste of time.

I guess I qualify as one of the ancients too. I wrote basic code on:
The Atari 2600 Cartridge.
Commodore 64
Apple II, II+, IIE, etc.
ColecoVision Adam
GWBasic/QBasic on a 286, 386, 486.
VB4 through .NET.

I guess that pretty much means my mind is permanently warped.

I also had every one of those books you showed. I used to also like typing programs from magazines too.

you don’t necessarily gain much by looking at things dijkstra slagged off. you can find a quote from him dismissing virtually any technology of the data with much venom and vitriol.

It’s amazing what you can find at the back of your bookcase:
http://theamicableprogrammer.blogspot.com/2008/04/my-old-basic-programming-books.html

Jeff,

I started reading your blog not too long ago, and I enjoy it. You’ve got a fresh approach that’s more personal than most technical blogs and more technical than personal blogs. I like the fact that you give thought to the IT industry and approach them from an intellectually honest perspective.

Usually, I find myself nodding in recognition when you talk about experiences growing up as a technically oriented kid. I wasn’t quite on board, though, when I started reading your blog entitled “Everything I needed to know about programming I learned in BASIC”. BASIC was a long time ago for me, and my my memories of it do not exude a rosy glow. I was thinking that maybe Edsger Dijkstra’s position wasn’t all that outrageous. I didn’t count BASIC as the foundation of my career.

My attitude changed when you reprinted the graphic of the covers of the “BASIC Computer Games” books. The effect was somewhat akin to finding an old scrapbook and discovering that I had spent my childhood in China, but that I had forgotten about it. If you had just cited the books, it would have meant nothing to me. But seeing the pictures of the cheesy computer/robots brought a visceral reaction.

I read the post again. This time it came right at me. It reminded me of writing BASIC on the Apple II’s at my high school’s computer lab. It reminded me of when one of my first girlfriends asked to me to “teach her how to program computers” – so I wrote her a BASIC program on my Commodore 64 that put her through a battery of questions that seemed super suave to my hormone-addled brain. The relationship didn’t last, but the program was the least of it. Although, the experience snuffed out any small hope I had that programming skill would impress girls.

The most startling memory, though, was about a sequence of events that happened when I was in grade school. My school got a Commodore PET – the first computer I ever got to touch. They put the computer in the library, so all the kids saw it – but some administrator had the idea that only the kids in the “gifted” program would be able to use it. This, of course, was an act of breathtaking stupidity by the faculty. Not only did it reinforce the notion that we kids were different, but it rubbed the other kids’ noses in the fact that we got a privilege that they did not. Any time I wanted to use the computer, I sat in the middle of the library, surrounded by kids who could not. Put that unpleasantness aside, though. I was happy to use the computer, under whatever terms I needed to.

The Commodore BASIC that it ran felt natural to me. Line numbers, GOTOs, GOSUBs – loved it. I recall some quantity of stilted documentation, but I couldn’t tell you whether it was in a spiral binder or something more permanent. It wasn’t long until my interest turned to creating games. I had an idea for an outer space game. The details are lost to me, but I remember it being conceived something like the modern version of minesweeper. You had a series of spaces on a grid that you “explored”; sometimes there would be enemies and sometimes there would be treasure. Or something like that. There were no graphics, of course. Just a command line and feedback, based on your choice of quadrants.

I remember working on it when a teacher got interested. He was the adviser to the gifted program, and probably the one who had a brainstorm about restricting the computer’s use. We talked a lot about it. Went over the code, the algorithm, etc.

At some point, the teacher gave a demo of the game to one of my classes. I kept expecting him to mention that I wrote and “produced” the game. He never did. He took credit for the whole thing. It was disturbing and confusing to me that an adult, much less a teacher, would do something like that. Even thinking about it now, with a lot of years between then and now, it’s a difficult memory. Something like this is impossible to analyze rationally. Maybe in the teacher’s mind, giving me the opportunity to use the computer was just as important as what I did with it. I never talked with him to find out what he was thinking. Maybe there was a perfectly good reason that I can’t tease out. Maybe I’ve distorted it in some way.

It’s also difficult to put the memory into context. Even though I programmed throughout my youth and loved it; it took me several years in the workforce before I gave serious thought to making a career of software development. Did the intensely negative experience have any contribution to that? Or did it not really matter? Until I read your column, I hadn’t even thought of the issue for – I don’t know – 10 years, 15 years. Maybe longer. Maybe I would have a similar gut reaction if someone wrote a piece about youth swimming, and it brought back a memory of being DQ’d after winning a race.

Wow. Kind of strange this much heat came from a technical blog post, not strictly on this topic. But those robots, man. Those crazy, cheesy robots on the cover of those books.

Keep up the good work.

C64, Ti83+ BASIC, Javascript
That was the order in which I learned my first three imperative languages for dominating the machine.

Wow! I had not heard that quote in 10+ years. I think I heard it from my C teacher in college for the first time. I personally want to thank the creator of BASIC. It has netted me a career for 20+ years now. I still work in BASIC. (Ok, VB.NET.) But still a warped and twisted form of BASIC.

I spent years on TRS-80 mod iii and my Timex-Sinclair with a lousy 12 inch BW tv punching in code. Although, BASIC lead me to assembly because there was some stuff I could not do in BASIC.

I always considered BASIC a gateway drug.

Great article.

Dan…

Maybe I am the only one person alive that thinks BASIC is not worse than any other language. Think of it: you can write crap in PERL, Java, C#, Lisp, FORTRAN, you name it. Ever heard the expression “write-only code”?

BASIC… oh, the nostalgia. I had a program called “Learn to Program BASIC” by a company called Interplay, in 4th grade. I’ve since become a C# developer for web applications. I don’t really see how learning BASIC could hold one back… if nothing else, it gave me the initial passion for development.

http://en.wikipedia.org/wiki/Learn_to_Program_BASIC

Fact is, BASIC as an intro to programming is awesome.

With kids it is about getting them “hooked”… BASIC did that for me starting with an Atari 400 and then an Atari 800. I actually started coding at around 6 years old… when I got to 10, I’d spend hours reproducing the code from magazines.

From there graduating up through the versions of BASIC (GW, Q, etc).
On to VB3 and 4 which I found fascinating, if not difficult for making valuable software. Still very cool for the groundbreaking concepts of “Visual” development and the IDE.

Then VB6, which while often produced spaghetti code, really could make some useful stuff. OOP… no… useful, yes.
Ignored VB.net until asp.net 2.0… .net 1 was awful, but I guess it did have some OOP oportunity.

Finally OOP in VB. (asp.net 2, 3, 3.5)

I respect C#, and can code in it, but why???
Why relearn syntax I already know like the back of my hand just to use braces and save a few words?

In the end, the code will be parsed by the .net runtime anyway, so there is not an appriciable difference in the cusotmer’s product or performance.

VB.net is NOT the same as BASIC used to be. From where I sit, VB, C#, is just which syntax you prefer. You can use the same techniques in VB as C#.

BASIC as a beginners language does teach the most fundamental concepts of programming; MOST importantly it opens up the idea that “I” can actually make a computer do what “I” want it to.

That is powerful stuff… and I think more important now days when kids are just used to googling to find what they want.

To me coding is a creative effort, and if BASIC lets people express their creativity, why knock it?

Are there more efficient (even necessary) programming methods, you bet… but let’s at least give BASIC the credit it deserves!

I grew up in India long before anyone there heard of IT. I used to go to ‘Digital Computers’ when I was 12 dragging a water bottle where a man in his 60’s used to teach BASIC. Beyond programming, I got to BASIC graphics from there.

I must admit though, that BASIC was my second step to programming. LOGO with the obedient turtle was the first language I got to.

As I graduated from Engineering, my friends were all into VB, VC++ etc. and were quite shocked when I used GWBASIC to interface to a 320x240 LCD display through the printer port. Ah… good times.