Remembering QBasic

Screen Shot 2014-09-20 at 2.03.48 PM

All programmers have a first language, me being a child of the early 90’s, my first programming language was Microsoft’s QBasic.  Let me set the stage a bit, this was the early 90’s, before most people would have access to some sort of network with their computer.  There were old books floating around in school libraries featuring games that could be typed into a BASIC interpreter.  Their heyday being more focused around the Apple II or Commodore 64 era computers, when BASIC was almost unavoidable.  You can find some of these books published online now, here is the series I remember: BASIC Computer Games by David H. Ahl.

By the time I found these books it was actually confusing how one would actually use them, since they focused on BASIC but by the early 90’s BASIC was hidden, or unavailable on computers.  Lucky for me Microsoft shipped QBasic with versions of Windows, so for kids with more spare time to poke around on computers, they would find it eventually.

QBasic was an environment that had many features that make it a nice environment for beginners:

  • Instant feedback on syntax errors – at each newline QBasic would check the last expression for syntax errors so that the programmer wouldn’t get far with an obvious error
  • Fast run-edit cycle – the BASIC was interpreted and was run by hitting the F5 button which would immediately jump into execution so a beginner could see quickly the results of his code.  I’d beg for that level of feedback in iOS development today.
  • Large body of published code – there were many dialects of BASIC so while it was unlikely that their basic worked without tweaking, the tweaking if students could persevere would reward with deeper understanding.
  • Free games – related to the last point, much of the code available were games.  Today kids have access to so many free games on mobile devices, it isn’t as much of a motivator.  But then, kids would do anything for free games, even deal with the messy business of coding.
  • Multiple graphics modes – there were graphic modes, some that allowed for easy graphics.  We liked to make programs that just drew pretty things.  They were easily accessible and integrated into the environment.  This is a big drawback for popular learning languages of today like Python.
  • Fullscreen – to avoid distractions
  • Good language documentation inside the editor

QBasic had some problems too.  For example it was kind of a pain to use functions.  To this day I’m not sure what the difference between a sub and a function is.  I could easily look it up now, but it didn’t occur to me as a kid and alot of BASIC instruction seemed to avoid the topic.  I remember there being some sort of dialog to add subroutines, I’m not sure if it was required or if you could do it alone with code.  I’m sure I could come up with more problems but they are moot because what it did, it did well enough to set me on my way to become a good programmer.  I’m not permanently damaged by QBasic’s shortcomings.  Sometimes we get caught up in these details about what languages are best for learning programming.  After considering it, the things that are most important are environments that are easy to explore and when I consider all the environments I know today, maybe no environment has done that better than QBasic.

If you want to try out QBasic its easy to find with an internet search.  Try looking for QBasic 1.1 by Microsoft that’s what I used.  I just ran mine in DOSBox on Mac OS X with freedos, seems to run perfectly.