Ask Hackaday: Should We Teach BASIC?

Suppose you decide you want to become a novelist. You enroll in the Hackaday Famous Novelists School where your instructor announces that since all truly great novels are written in Russian, our first task will be to learn Russian. You’d probably get up and leave. The truth is, what makes a great (or bad) novel transcends any particular language, and you could make the same argument for programming languages.

Despite the pundits, understanding the basics of how computers work is more important than knowing C, Java, or the language of the week. A recent post by [lackofimagination] proposes that we should teach programming using BASIC. And not a modern whizz-pow BASIC, but old-fashioned regular BASIC as we might have used it in the 1980s.

Certainly, a whole generation of programmers cut their teeth on BASIC. On the other hand, the programming world has changed a lot since then. While you can sort of apply functional and object-oriented techniques to any programming language, it isn’t simple and the details often get in the way of the core ideas.

Still, some things don’t change. The idea of variables, program flow, loops, and arrays all have some parallel in just about anything, so we can see some advantages to starting out simply. After all, you don’t learn to drive by trying it out in the Indy 500, right?

What do you think? If you were teaching programming today, would you start with BASIC? Or with something else? You can modernize a little bit with QB64. Or try EndBasic which just recently had a new release.

183 thoughts on “Ask Hackaday: Should We Teach BASIC?

  1. I’ll not write a biography of experience because that background is irrelevant to the discussion.
    Pertinent is that programming languages exist as tools to solve problems: be that math, control systems, or blinkin’ LEDs. Programming languages (today) often exist as code editors in some Integrated Design Environment, IDE. For novices, an efficient IDE will provide great editing including syntax checks, color highlighting of code elements, and decent auto-complete/help facilities. Within such an IDE, the specific language is not as important as the learning support provided.

    From the introduction, the context appears to be directed more to self-learning and not instructor-led/classroom.

    The IDE will likely bias the language decision; that is, the Arduino IDE 2.x obviously is biased to microcontrollers that have C/C++ Arduino-cores; a rather long list of supported hardware.

    Similarly, the PICaxe IDE ( https://picaxe.com/software/picaxe/picaxe-editor-6/ ) is a dialect of BASIC for PIC microcontrollers.

    And, PC platforms have numerous IDE environments, many will have opinions.

    Using the PICaxe IDE, we can list some useful components:
    – source code colour syntax highlighting and interactive tooltips
    – auto indentation
    – powerful preprocessor for #include and macros
    – syntax check and program download
    – code explorer to shown variable, label and constant values
    – full on screen simulation with animated chips and line by line code highlighting
    – simulation breakpoints by line number and variable value
    – debug and serial terminal windows
    – AXE027 download cable testing and port identification tools
    – various testing tools such as the analogue calibration wizard
    – various code generation wizards (pwmout, tune etc.)
    – full flowcharting support

    The above list is obviously very useful to a PICaxe programmer, much less so for a programmer writing a completely mathematical model. Thus, IDE selection suggest an understanding of the context of the work effort. IDE’s can facilitate problem solving and provide real-time feedback and learning opportunities, but the selection of language is driven by the statement of the problem to solve and the selection of hardware to compliment the end results.

    Early big-iron systems were programmed most often in a language suited to the customer: business & financial likely COBOL, scientific/engineering likely FORTRAN, and BASIC was often utilized for introductory programming concepts for non-engineering students.

    Would I recommend BASIC today? If just a blanket statement without student context, “No.”

    But, if asked by a student who only wanted to blink a few LEDs for a science fair project, “Yes” if they could use PICaxe and “No” if they were required to use Arduino. If they were just wanting to use their PC to calculate Pi to a million digits, then my response would be to use the language from the example you found on the Internet.

    When Einstein did thought experiments, I am fairly certain that the question of programming language did not need to be asked. Critical thinking does not require the selection of a specific programming language and educators should not be overly biased, the language selected for a course should compliment the curriculum. Training academies will select languages that will fill paying seats.

    Thus, in recommending a language to a non-programmer, I suggest requesting from the individual more information on how the knowledge will be utilize and what hardware platform they intend to use to support their journey. The answer will become simpler or maybe even obvious.

  2. Go back to line numbers and GOTO statements? Hell no, and I’m one who learned BASIC at age 14 and stuck with it for two decades. But now even Microsoft is ending support for it (finally). Learn a modern language like Python or even JS/TS.

    1. Line numbers and GOTO statements? That does show it is a long time since you used BASIC.
      Python originates from 1991. The same year as Visual Basic. Which of those languages is ‘modern’ ?

  3. Lemme take a look at this thread and see if anyone has mentioned Python yet.

    So yea. Basic was. I was there, and it kinda worked.

    But I’ve realized lately that I do *EVERYTHING* in Jupyter Notebooks these days… always have jupyterlab running, always have at least a strach ‘untitled’ notebook tab open at least in a full-screen browser session on it’s own desktop.

    I start the server and lab up (along with a full-screen tmux terminal on another desktop) as soon as I boot, and booth stay open for… months sometimes.

    And what it reminds me of is booting into Basic, and I want to boot into Jupyter-Lab instead. I don’t use much in the way of big actual applications (don’t have OpenOffice or anything of the sort installed), I just work out how to tell the machine to do what I want done in the notebook and then set it all running when I’m happy.

    Most of my notebook cells are temporary work like that and get deleted when I’m done – it’s somehow the best system shell I’ve ever had. In fact, on any given day most of my bash commands were probably actually issued by subprocess.getoutput(command_string) running in a loop in a notebook cell rather than actually typed at the terminal.

  4. I think that having options is always a good thing. Eben Upton asked very good questions in the article linked below and one of them was: What I’ve always wondered – particularly for developing markets – is there a story about ultra-low cost? How useful is an 8086 DOS machine? And if I could make a 50-cent machine that is a PC XT, is that actually useful?

    I played with Raspberry Pi Pico flashed with PicoMite and I have to say that it was a pleasant experience, even if I have never had any experience with BASIC before. There are also other cool emulators of old computers for this microcontroller. I think that if hardware is cheap enough and documentation good enough somebody will find given solution useful. I’m fat cat with access to whatever resources I want, but in some circumstances I think having access to very cheap machine machine running BASIC could be a blessing.

    https://www.theregister.com/2024/01/15/eben_upton_on_sinclair_acorn/

  5. Use Excel VBA. Beautiful language, and you get to learn object oriented programming. You get a complete UI and data table set out of the box. And it is very useful for work in an office

  6. Whilst not a programming language, a great place to start learning how to program and build things would surely be BASH, very simple, lots of basic maths and functions, i found it to be a great stepping stone

    1. bash is absolutely a programming language. A horribly convoluted mess of one, but turing complete, with parallel processing, timeouts, networking, job control, strings, numbers, associative arrays, and more. It has some odd spots though, like lack of a delay function, where you might use the system sleep command. Typical sore sources of confusion include the difference between environment and shell variables, quoting, and subshells.

      There are attempts to merge more regular languages into shells also, like fish or xonsh.

  7. I learned BASIC first, then 6502 Assembly, then Z80 assembly, then 8086, then C…

    If I was teaching again, I use to teach back in 1989… I would start people off with Assembly, not hard core, but simple DOS/86 assembly, and I would not spend more than 2-3 weeks on it. I would show how we can push and pop data and make simple functions. This would give a raw understanding of the low level stuff and show most everything is just a number and bytes of memory. after this I would actually jump to C and show how its akin to assembly and easier to define some bytes etc, and call functions as C handles the stack etc. maybe 3-4 weeks, then I would introduce something like BASIC.

    This would show as we go higher in abstraction, the more we give up in fine grain detail and let the compiler or language suite do the heavy lifting.

    But this would be an introduction to programming. Some may say BASIC should come first, but I am a strong believer BASIC was great back in the day for intro because it was easy to input a program, imagine doing assembly from a teletype!!! It was harder then to do lower level. When I was involved with Devry I would launch debug command and write assembly and save to a .com file and blow students minds.

    just my 2cent ramble

  8. The concepts in a first language set the student’s mind set forever. The problem with python as a first language is that all variable names are pointers to objects. In most other [low level] languages variable names are aliases for a memory location, and maybe with an assiciated data type and size for what is there.

    To me, that doesn’t make python a bad language. It is a very good high level language for a domain professional who wants the results of running programs to get work done. It is not a good first language for someone who needs to understand computers and other languages.

    What I loved about compiled QuickBasic 4 was its basic structured programming constructs, and meaningful function and data abstractions. I loved that, by DECLARE’ing subroutines, invoking them looked like I had added a statement to the language, extending QuickBasic into a domain specific language for my application.

    I loved the convenience of WHILE and UNTIL with the test at the top or the bottom, as I chose.

    I loved how little punctuation I needed to use. By using DEFINT, DEFLNG, DEFSTR, etc. and declaring the specific exceptions, I didn’t have to get involved with %, &, !, #, and $ variable suffixes.

    I used user defined data type structures, call by value and by reference, pointers, loading and saving arrays of structures with BSAVE and BLOAD for whole 64KB chunks.

  9. BASIC was the first programming language I taught myself. It helped me to learn how to learn and set the course of my long career.
    I would advocate employing the same principle we us in development for teaching programming. Keep It Simple, no FP or OOP and even a slow introduction to Procedural concepts will provide a much firmer basis for further learning and knowledge building.

  10. I would like the pages to have votes on what we would like to learn.
    Authors write a tree/path about what the article is about. e.g. math/algebra/number theory/how the hash works in an ATM card.
    Or wood/tools without electricity/how to use an axe.

  11. There is no use learning a way of thinking just because it happens to be simpler when you are going to have to un-learn it if you ever want to progress.

    GOTO/GOSUB… they are dead ends. Learning those just makes more work when you have to un-learn them.

    Just start with an easy subset of a real and modern language.

  12. Teaching BASIC to let newbies write very simple programs and learn not to fear the machine? Yes, totally, provided that as soon as they become accustomed to programming you bring them to structured programming, cleaner more powerful languages and better coding practices. Look at the damages VB did in the late 90s and early 2Ks: everyone used it, VB programmers became easier to find (and pay) compared to other ones, so that companies rushed to hire mostly VB programmers and the result has been an invasion of terrible code and practices. Don’t do that again, please.

  13. I came here, fellow Romans, to put a plug in for G-code, the langua franca of CNC.
    It is much like Basic with calling of sub routines, GOTOs, jump to lines, if then else, DO loops.
    Lots of cycle calls (Cycle 81, anyone?)
    haha
    I started with Basic, did some Flirtran in college, some Excel Vbasic stuff and now am doing Gcode.
    I have not progressed to python or to rust or to the new shiny shinies, but in the future I may be programming….as dust, a la Interstellar bookcase.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.