A world without BASIC


Filed under Musings, Software showcase;
6 comments.

The computers that Apple II users grew up with were nowhere near as user-friendly as today's machines. They had unintuitive interfaces, inscrutable error messages, and limited capabilities.

But those same limitations also made them an excellent tool for learning such important concepts as problem-solving, game design, and especially programming.

The Apple II was especially practical for that last function, as it came with BASIC in ROM. Without any other software, a user could turn on her machine and start building a virtual world of her own design. The lack of advanced features meant that the user was playing in a sandbox of conceivable limits yet infinite possibilities.

Yet by 1997, when I started college as a computer science major, I was getting laughed out of the classroom by using BASIC where other students were relying on Java and C++, as I related in Juiced.GS. Today, BASIC is almost nowhere to be found, as detailed in the leading item on Computerworld.com last Thursday "How are students learning programming in a post-Basic world?"

The story is an interesting look at the variety of languages with which to introduce modern students to programming. For some parents and teachers, the old methods work best; "My son's math textbooks contained exercises in Basic, but we could not do the problems until we bought an old Commodore 64 online," said David Brin, author of "Why Johnny Can't Code". Others prefer more popular scripting languages, such as Python; still others use a language designed more for educational than practical use, such as MIT's Scratch, the language of choice of the computer science teacher where I used to teach. She's offering a camp this summer to introduce 13- and 14-year-olds to programming, using a different format from last year's camp: "I changed the language from Alice to Scratch. Alice was too glitchy for me. Scratch is easy to pick up, and hopefully will be fun for middle schoolers."

But none of these languages will offer the same experience as learning BASIC. Author Lamont Wood had once dabbled in BASIC programming but had fallen out of practice until his recent experiment with Python:

The thrill was not the same as in 1979; it hadn't taken months to get the hardware to work, and it sure ran quieter … with Basic, I felt like I was rummaging through a small box containing a few crude tools. With Python, I felt I had pushed open the door to a massive but unlit tool warehouse and was darting in to grab the few that I could see.

I learned BASIC by doing: I was running a Warp Six BBS and needed to make modifications. Eventually, I was inspired to write my own door game, though since it was a port, I had to concern myself only with the coding, not the design. In either case, I always had either the code or design to work with; I never had to conceive and build entirely from scratch (no pun intended).

My challenge in adapting those BASIC programming skills to a modern environment is not so much choosing a language as it is choosing an instruction method. Just as I learned BASIC to run a BBS, I've set a goal of learning PHP to help me run WordPress, a modern equivalent of an online community. But elementary concepts such as functions and arrays seem more confusing than they did twenty years ago.

What's the best computer and language to teach programming — and where does one go from there?

  1. Hi Ken,

    My own experience with BASIC was short-lived, but as a tool to write some simple logic, do basic IO and teach young grasshoppers the basics of procedural programming it was tough to beat. Where I really cut my teeth was in Pascal, many years later, but Pascal is also a procedural language and now no trace of it remains anywhere in my professional landscape. Of course, nobody's doing industrial software development in BASIC either!

    As always, you should consider your learners and contexts. Who are you hoping to teach programming to and why? Are these computer enthusiasts who are toying with the idea of pursuing careers in software development, or is programming simply a possible means to an end for them? If it's the latter, then I see no need for you to concern yourself with what's hot or not; just find a tool with a clear syntax that does what your learners are likely to need, and use that. But if it's the latter, I couldn't overstress the importance of C syntax. Almost all new languages are at least partly based on it: C, C++, C#, Objective-C, Java, Actionscript, Javascript, Perl, Python, PHP – so it would behoove you to get your learners acquainted with it early.

    In any case, the preponderence of visual development environments in the modern landscape is something you shouldn't overlook. Programming is not simply about writing lines of gobbledygook anymore; it's about interaction design, user interface architecture, and advocating for the user. I wouldn't want to teach anyone programming these days without also teaching them how to build a UI – and how not to.

    At the risk of starting a flame war about the foibles or future viability of Flash, I can't help thinking that Actionscript 3.0 is an ideal learning tool. It has an extremely clear, C-style syntax based on the ECMAScript standard. It has the benefit of being a bytecode-compiled language rather than a purely interpreted one, so learners can rely on compiler errors and debuggers to guide them. It's not purely object-oriented, so you can start with the basics of procedural programming and move up to object-oriented development from there. It features a very robust library of graphical objects and UI components, and a strong visual metaphor to help learners get comfortable with building visual interaction, mouse interaction and even touch interaction. It works in several different visual development environments, and you can do all of your work using free, open source tools.

    Actionscript 3.0 is also platform-agnostic, and there are innumerable advantages to such an approach for learners. Let those who would learn to talk to computers pick their own computers, say I; platform dependence creates needless complication at the outset, and runs the risk of immediately taking learners out of an established comfort zone. Better to let them get straight into focusing on the language itself, rather than familiarizing themselves with a new OS or piece of hardware.

    Just my $0.02. :-)

    Hope you're well,

    -r

  2. Jeff Blakeney says:

    BASIC is not dead nor has it completely disappeared from use. Since VisualBASIC for Windows switched to the .NET framework, it has waned in popularity because VB wasn't very fast to begin with and adding the .NET overhead made it worse. However, there are still a lot of people using VB 6, the pre .NET version.

    And VB isn't the only BASIC in town. There are some game BASICs for Windows as well as some more general ones. There is BlitzBASIC, ThinBASIC, PureBASIC and many others.

    My current development language of choice on my Windows machines is called PowerBASIC. It started out as TurboBASIC for DOS. The name was changed and it has evolved from a DOS based language to be able to write Windows DLLs to being a full fledged Windows compiler. Version 10 came out a short while ago but the number of great new features is getting a little low. They do keep adding other new features but they are ones that I find unnecessary. They also have a "GUI" version and a "console" version of the language which I guess is a way to make more money as some people buy both versions.

    The only drawbacks to PowerBASIC are its price (200 USD) and that it is not usable outside of Windows. Users have been asking for years for a Unix version but none has appeared yet. The compiler is extremely fast and it creates very small and very fast executables.

    I won't be giving up BASIC any time soon.

  3. Excellent topic. I fit into the BASIC camp, and believe there are things about programming that one can learn from BASIC that most anyone can do.

    On the other hand, it could be hard to keep up the attention of younger people these days when they are doing things that are text-only (to an extent), and don't have the multi-media capabilities of today's computers, i-devices, and such.

    Whether or not there is a good BASIC-like language (like the Actionscript mentioned by the previous commenter), I simply don't know. Because I am not actively programming these days, I have on dabbled in those that I need (Applescript, PERL, PHP).

  4. I went to high school in the mid-80s where we had a 3-year computer science program: Programming I, II, then AP Computer Science. Programming I and II were two years of running apps/BASIC whereas AP CompSci was based on Pascal.

    I started AP CompSci my 2nd year. A few others in the class were taking about C and UNIX. So I picked up the "The C Programming Language" and "The UNIX Programming Environment". I was sold, this was clearly the future. But to get through AP CompSci it was going to have to be Pascal.

    After a week of learning Pascal I was pissed that I had wasted a year on BASIC and also having to unlearn a few bad habits. IMHO, the focus should be on where things are heading, and not on building a foundation with tools that you will most likely never use. The same argument could be said about learning statistics and probability vs. calculus.

    I would have preferred a class that focused on what a computer is in depth and that required us to learn assembly language, then C. Pointers make more sense if you understand a bit more about the machine.

    I am not a BASIC hater. I'll admit that BASIC allows someone to quickly focus on "what it does" as apposed to "what it is". But I do not think that is a strong enough argument to justify using a "learning" language.

    If I were an educator today I'd have two tracks, "what it does", where I would focus on Javascript and HTML 5. Javascript runs just about everywhere whereas Java and Flash do not. And all modern browsers have JIT compilers that really speed things up. Google for jslinux sometime and witness the booting of an x86 emulator with Linux on your iPad. And there are gobs of other Javascript-based emulators out there too, including an Apple II.

    For the "what it is" track I'd start with assembly. Which assembly is a bit harder. The Z80 is still a popular embedded processor and CP/M emulators are all over the place. ARM however may be the best since it is used in powerful embedded devices and runs modern OSes such as Linux. After that I'd be C/C++, but a popular school program needs to move with the times. Java is still popular, and Objective-C is on the rise.

    To summarize. I am not a fan of creating computer languages just for the teaching of computer programming. You can learn the "basics" with existing languages used for real work.

    P.S. I reserve the right to be completely wrong. I've failed to teach my own kid how to program or use a CLI. She has absolutely no interest. I still struggle with GUIs, and frequently use "Terminal" on her Mac to help her out with not-well-packaged warez and she always looks on, wide-eyed, as if I am performing an OS autopsy.

  5. Jeff Blakeney says:

    Egan, when I took Electronics Technology in college, we had one semester where we learned programming that they did just what you suggested. They taught us assembly language before they taught us C. However, the reason they gave is that assembly was easier to learn than C and I have to agree with that.

    I haven't used C since that college course over twenty years ago. Still don't like it. That is why I'm so happy to have found PowerBASIC. Keep in mind that this is not Applesoft. It is not an interpreted BASIC. It is a compiler and the language is structured and based on procedures. It also supports COM based objects for object oriented programming techniques and a set of commands known as Dynamic Dialog Tools (DDT) to ease writing a Windows GUI.

    I've done verb for verb translations of C code to PowerBASIC in the past. However, I usually end up modifying the code to make use of some of PB's strengths such as using strings instead of pointers to an array of characters.

  6. This is really interesting. My formal education in software development, beginning in 1989, consisted of 3 semesters of VAX Pascal (Turbo Pascal for DOS was an invaluable boon), 1 semester of 8086 assembly language and half a semester of C. Everything else has been on-the-job training.

    So, I really don't have a lot to say about BASIC. In fact there are are only two kinds of BASIC I'm familiar with: the kind with line numbers and lots of GOTO statements, and the kind with the word "Visual" in front of it. They're nothing alike whatsoever. I would think that Visual Basic would be an excellent teaching tool, but it's been a while since I've been dealing with Microsoft development tools in the workplace. I wasn't aware that VB.NET had become unpopular as Jeff stated above.

    There's a lot to be said for exposing learners to the languages that are currently viable in the job market. But I would not expose new learners to Objective-C unless I knew that they were specifically interested in developing for OSX and iOS. (I don't LIKE Objective-C, but that's beside the point.) Dignified as its roots may be, it's just too different from everything else. Throw it in casually with Javascript and BASIC, and you will only confuse people. However, like I said, depending on the context, it may be the only tool that will fit your learners' needs.

    So, it really does all come down to instructional design:

    – What skills are your learners hoping/expected to gain?
    – What skills and knowledge do they already possess?
    – What specific tasks do they need to perform?
    – How WELL do they need to perform those tasks, and under what conditions?
    – How are you going to assess how well they've performed them?
    – Who are the stakeholders, and how are they going to be satisfied that the performance needs have been met?

    If there's nothing in the above questions that can't be answered with BASIC or some variant thereof, then there's no reason for your learners to stray from that language.