back to article 10 PRINT "Happy 50th Birthday, BASIC" : GOTO 10

Wanna feel old? Thursday marks the fiftieth anniversary of the invention of BASIC, the programming language that took the computing world by storm during the PC revolution of the mid-1970s and 1980s. A version of BASIC shipped with practically every home computer of the era, but the language actually dates back to 1964, when …

COMMENTS

This topic is closed for new posts.
    1. Fibbles

      "As I learnt a lot about programming with this simple language, I decided used that idea 25 years later to teach students at college how to program, but by using Python. Apart from the for loop, Python was a really good way to teach programming for absolute beginners."

      www.codecademy.com/tracks/python

      This is now my go to link for when somebody asks me how they can learn to program. The course is well written and the interpreter runs in the browser. I've seen kids writing programs after only a few days and I'm not talking about the usual "Hello World", I'm talking functions and flow control. A teenage son of one of my relatives was even writing passable object orientated code after a week.

      On topic; I've always liked the look of BASIC but I missed out on the age of micros and grew up with the IBM PC clones. When I got interested in coding at college they taught us Pascal. I'm not sure why, presumably because it's what the lecturer knew best.

      1. Peter Gathercole Silver badge

        @Fibbles re: Pascal

        Pascal was created as a teaching language. It's prime goal was to be highly structured, and have a very concise syntax that encouraged students to think in the way that matched the good programming practices of the time (highly structured, functional and procedural programming). It generally succeeded in these aims.

        It is quite clear that someone who learned Pascal could convert to other scientific languages (like Fortran or or Algol) relatively easily, and I know lots of people who moved to C with little difficulty.

        But as a language, it was strongly disliked by students. Because of the precise syntax and strict type checking, it was a very pedantic language to write. In other languages at the time, you might get a successful compile, but have a completely broken program because of an escaped syntax error.

        Now Pascal would never force you to write programs that worked, but it would protect you from some of the pitfalls that other languages might allow. But the repeated compile/fix cycles without a run caused many colourful moments in the classes I was involved in. But I'm not sure whether that was preferable to the compiler incorrectly attempting to fix simple errors like the PL/1 subset teaching compiler called PL/C, which is what I learned formal programming in.

        The other drawback of strict Pascal implementations (and here I am explicitly excluding all Borland/Zortech and other 'extended' products) was that there was comparatively little support for some operations that were needed in order to cope with real-life problems. Files with multiple record types were complex (you had to use a construct like variant records to do this), and the very strong data typing did not have the equivalent of a cast operation (I'm still talking strict Pascal here), which made some of the tricks that you do in other languages difficult or impossible. There was also no variable length string construct (there were fixed length character arrays), and as a result, almost no what you would describe as string operations. This meant that you quite often had to do code some comparatively simple operations yourself. And there was no form-filling or screen handling features at all. But at least that was not unique to Pascal. Almost none of the high level languages of the time had that built into the language itself (it was normal for these to be added by library routines, the most obvious example being Curses for C).

        This meant that kids who learned BASIC on 8-bit micros at home regarded Pascal as a backward language that restricted what they could do, whereas people from a formal teaching environment regarded it as very good language for precisely the same reason!

        The other reason kids had difficulty with any compiled language was the fact that it was not interactive. The whole compile thing compared to just running it seemed wrong to them.

        1. Destroy All Monsters Silver badge

          Re: @Fibbles re: Pascal

          But as a language, it was strongly disliked by students.

          Frankly, this is still the case these days. And judging from cow-orkers, the people who go into computers would like to be able to write working programs with the same attention and care as they put in writing tweets. Frankly, they are in the wrong domain.

          The whole compile thing compared to just running it seemed wrong to them.

          Of course, and this is why REPL-supporting languages are good.

        2. Fibbles

          @ Peter Gathercole Re: @Fibbles re: Pascal

          A cogent explanation. I did pick up Pascal reasonably quickly and learned enough to pass the course. However, as a new programmer I found it to be rather 'fiddly'. I wouldn't say it completely put me off programming but it did make rapid prototyping difficult and that certainly dampened my enthusiasm. As I went off to university to study graphic design the only real coding scripting I did for years was Javascript for web development. Then I got into games development as a hobby and taught myself C++. I probably couldn't write a Pascal program today (can't remember a lot of the syntax,) but all the arsing about it made me do with data types definitely gave me a head start with C++.

        3. Roland6 Silver badge

          Re: @Fibbles re: Pascal

          >The other reason kids had difficulty with any compiled language was the fact that it was not interactive. The whole compile thing compared to just running it seemed wrong to them.

          This sentiment could be applied to computing professionals working with Ada where getting some code out of the multi-pass compiler, rather than error and warning messages, was a cause for celebration.

    2. Anonymous Coward
      Anonymous Coward

      Locomotive BASIC on the CPC is great. It's a really decent implementation that is streets ahead of what Sinclair or Commodore offered.

  1. Destroy All Monsters Silver badge
    1. Anonymous Coward
      Anonymous Coward

      Re: The BASIC of today

      try bf ?

      1. Destroy All Monsters Silver badge
        Facepalm

        Re: The BASIC of today

        Why would you try "bf"?

        Actual programming languages are meant to be used and open the functionality of the machine in a most agreeable way, not to have a good wank over being close to theoretical computer science and minimalist languages useful in mathematical proofs.

        1. Destroy All Monsters Silver badge

          Re: The BASIC of today

          Woah downvotes. Must be the backblast of barely literate "programmers".

    2. HippyFreetard

      Re: The BASIC of today

      No, BASIC was a real programming language :P

      Python is BASIC's modern successor (if you don't count VB - which I don't)

  2. This post has been deleted by its author

  3. heyrick Silver badge
    Happy

    BBC BASIC FTW

    PROC, FN, could write entire programs without a single GOTO/GOSUB in sight, decent graphics, built in 6502 assembler...

    1. Teiwaz

      Re: BBC BASIC FTW

      Yup, I never needed to got/gosub anyhting on BBC Basic. Procedures all the way.

      Hehe, once wrote a simple program that pretended to be the command prompt on the school ethernet network, then sat back and watched teacher try to logout, as it responded to most common commands apropriately, but logout and some others generated false error messages.

      Think I have my school project on a 5 1/4 inch disk somewhere...

      1. Peter Gathercole Silver badge

        Re: BBC BASIC FTW @Teiwaz

        Was probably and Econet network. And the login screen was in BBC Basic anyway. We told users to do a <Ctrl>-<Break> before logging on to prevent this type of thing.

        I ran a Level 3 Econet network back in the 1980s. If only the security had been better enforced (the concepts were good, but it was trivial to get around), then it would have been a great low-cost network for file and print sharing. But there was no concept of privilege mode in the BBC Micro OS, so it was simplicity itself to set the bit in the Econet page in memory to give you privilege at the network level. And once you had this, you did not need a users password to be able to get at their files.

        Still, I suppose that you can't have everything in a single-user 8-bit micro. But I agree, the BASIC was good, with the exception of it not having a while-wend construct.

    2. HippyFreetard

      Re: BBC BASIC FTW

      Yeah, DEF PROC and DIM!

      [

      and 6502 assembly :)

      ]

  4. Sarev

    Try BBC BASIC on your Raspberry Pi

    Free download or pre-installed on an SD card for a fiver. What's not to love? https://www.riscosopen.org/content/sales/risc-os-pico

  5. I ain't Spartacus Gold badge

    My first program

    10 PRINT "LUKE SMELLS OF POO!"

    20 GOTO 10

    Then, as my skills developed, I could do this in larger text size, cycle the screen border through many bright colours and cycle the text colour as well. I'm afraid that's as far as I got with programming, before going back to playing games. Apart from a brief course in C++ 20 years ago.

    1. Amorous Cowherder
      Facepalm

      Re: My first program

      You got further than most of us!

      My mates and I'd walk into Boots, type:

      10 print "SHIT! ",

      20 goto 10

      Run out the shop very quickly!

      The comma after the quotes would force some BASIC's to print the same thing to the end of the line, then loop back to the start like a typewriter, so the screen would fill up with the chosen offending word for the day as opposed to the naff down-screen-scroll!

      1. Anonymous Coward
        Anonymous Coward

        Re: My first program

        More fun with the Oric that had ZAP, EXPLODE, PING and SHOOT sound effect commands, so you could REALLY cause a nuisance and draw attention to it, LOL.

        Of course that really did call for a bit more sophistication - an initial delay loop of a minute to give you time to retire to safe distance from where to observe the commotion!

        1. Jess

          Re: More fun with the Oric

          WHSmiths?

          A pause

          A poke to turn off the keyboard

          A ping using a random number

          go to the previous line

          1. Peter Gathercole Silver badge

            Re: More fun with the Oric

            When there were display ZX81s in the WH Smiths, I would type in a REM statement in the first line of a program, using the Sinclair special block characters, a small piece of assembler that would put a different value in the Z80's I register that was re-purposed by Sinclair to point to the page number of the first page of the character generator table in the ROM, and then call the code from the relevant address. I often added this to the program that was loaded, and then run the program.

            What this resulted in was a screen of garbage, You could see that there was something there, and it would respond to all of the right commands like list, but the text was unreadable. If I remember correctly, the funniest thing was to put a value in that was the base page of the character table offset by one. This had the effect of shifting the displayed characters along by a number (32?) of characters, so the result was effectively a block-shift cypher of the program.

      2. Skyraker

        Re: My first program

        (Pedant mode)

        It was a ;

      3. DJV Silver badge
        Happy

        Re: My first program

        Some tricks for shop computers I used to employ were:

        1) A POKE to the VIC-20 video chip to change the screen width from 22 columns to 23 or 21. This would cause anything on the subsequent lines to be offset left or right by one extra character each line. Really annoying for the shop assistants who couldn't figure out why their program listings were going diagonally down the screen.

        2) Running a simple loop to copy the CBM-64 ROM into the underlying RAM, a POKE or two to keep it there, then a few more POKEs to change the SYNTAX ERROR text (now in RAM) to something far less pleasant. Then I'd stand back to watch kids (usually) cause an error and ask their unsuspecting parent what that meant!

        3) Enter a short program into a Spectrum that changed the screen to 2 shades of blue, print "COMMODORE 64 BASIC V2", "64K RAM SYSTEM 38911 BYTES FREE" and "READY" with a loop to flash a cursor. That got lots of people confused! I once even convinced someone that a Spectrum had had a CBM-64 ROM installed in it by mistake!

        1. JeffyPoooh
          Pint

          Re: My first program

          One of my circa-1980 hacking tricks was padding the BASIC lines (multiple BASIC commands allowed per line of course) with REM and placeholder characters ("/") quantity equaling the length of the code, followed by fake code as the rest of the REM. Then executing a machine code routine that would replace the placeholder character with ^H. The resultant BASIC would look like whatever I wanted, while the actual code was hidden by the ^H.

          It became trivial to do things like this:

          LIST

          10 PRINT "Hello!"

          RUN

          Good bye!

          The actual code was thus:

          10 PRINT "Good bye!": REM ///////////////////////// 10 PRINT "Hello!"

          where the '/' got replaced by the ASCII of ^H, thus instantly backspacing over the real code upon LIST.

          This made almost anything possible and confused the uninitiated.

          I sometimes suspect that the same ^H in Source Code trick could still be done in some environments. Beware.

      4. JeffyPoooh
        Pint

        Re: My first program

        How about the 'One-liner Contests' in Rainbow magazine?

        I wrote a joystick-controlled graphics game in one line of code (about 240 characters).

        And I wrote a Text-based Adventure game engine in one line of code, plus as many DATA statements as rooms.

  6. a_mu

    basic for today

    once upon a time,

    no mater what computer I was on, I could knock up a basic bit of basic to do something I wanted done,

    then the 80's came along, and basic was BAD

    so now I have to know and use, TCL, Python, VBasic, C in all its forms, Jscript, and a few more,

    and I'm a hardware developer just trying to use the computer..

    Yes I have a fond heart for Basic, like all languages , it can be used worng,

    one place I worked at, used a fortran 77 program they had written to word process !

    and another has a cobol based spread sheet like program,

    but basic, its still in my heart and soul,

    youngsters today just don't learn to program, but then, neither did we, we just had fun making things bleep and pixels flash, that doesn't do it for the kids now days.

  7. Amorous Cowherder

    MS Small Basic

    My little girl came home the other day talking about the Small Basic stuff they'd been doing at school that day, I'd never heard of it before then.

    It's only got something like 20 keywords in total, the interface is really simple so kids can get started quickly. It has one data type, simple I/O and graphics handling libraries built in, I spent a quite a few hours playing around with it, writing silly utilities and games! A good laugh!

    1. This post has been deleted by its author

  8. adam payne

    Hello World

    Hello World

  9. Chewi
    Thumb Up

    AMOS BASIC FTW!!!

  10. 45RPM Silver badge

    I'm pretty sure that 'Beginners All-purpose Symbolic Instruction Code' is a backronym. Allegedly BASIC was originally styled Basic, and it didn't stand for anything other than what it was - a basic programming language. I can't remember where I read that, and I concede that it may be bollocks.

    1000 GOSUB PutFlameProofPantsOn

    1010 GOSUB BeAPedantOnTheReg

    1020 IF YouAreWrong THEN END

  11. ForthIsNotDead

    Bad memories...

    10 PRINT "EMMA'S SWEET JOY JUICE ";

    20 GOTO 10

    That got me into a lot of trouble at the age of 14 in WH Smiths.

  12. Mark Simon
    Pint

    True Basic

    The rest may be history, but there’s an important footnote to that history.

    By the mid 1980s, John Kemeny and Thomas Kurtz began to despair of what was happening to BASIC on the micro computer. In particular, the limited memory and processing power of the computers at the time had led to a fairly naïve programming language, lacking many of the structures and features of the more modern languages.

    Meanwhile, back at the ranch, BASIC had been developing into a more sophisticated product. Kurtz & Kemeny implemented and marketed a more advanced version called True Basic, a structured programming language which, among other things, dispensed with line numbers and the dreaded GOTO statment.

    You can, of course still rewrite the title of the article as:

    FOR i = 0 TO 1 STEP 0 : PRINT "Happy 50th Birthday, BASIC" : NEXT

  13. Destroy All Monsters Silver badge
    FAIL

    Also, fail for not alluding to Bill's Butthurt Missive about people copying his precioussss paper tapessss of Basic.

    Already back then, the "YOU BE STEALING MUH INTELLECTUAL PROPERTY" meme was prevalent.

    1. Destroy All Monsters Silver badge

      Bill probably didn't exactly pay Dartmouth College for the idea of Basic either. Rip-off from the get-go.

  14. John Tserkezis

    I used to be fluent in 7 different dialects of basic back in the day.

    Back in the day, I was proud of that, it was a challenge to work with.

    But after learning real programming languages, I'm glad I left it behind.

  15. Mpeler
    Pint

    Those were the days (and acronyms)

    "Wanna feel old?" Heyyyy, I resemble that remark (Hi, Kingsley). I don't think BASIC is a "backrony", as back in the old days (50s, 60s) computer languages were "acro-named" after their purpose, e.g.

    COmmon Business-Oriented Language, ALGOritm Language, FORmula TRANslator, etc. There were others, SNOBOL (not sure what it mapped to), LISt Processor. I think Pascal was the first language to show its Wirth without an accompanying (justifying?) acronym, shortly followed by Ada and Babbage (just kidding there...strong typing, weak typing, touch typing...).

    Then "a", "b", "c", `c+, c++ Seems they hit a wall before "d"...kind of like the energy efficiency ratings that used to end at "A", but now we have "A+", "A++", "A+++"....looks like they painted themselves into an alphabetical corner...

    And who could ever forget Programming Language / I And plugboards....that wasn't just close to the hardware, it WAS hardware....ahhh, those were the days...

    Someone (here in Germany) said to me that the reason IBM called it "Batch" processing is that that's the sound the card deck makes when you drop it and it hits the floor....unnumbered, of course....

    Here's to beer-soaked cards, card sorters, and the good old 029 punch....and, erm, extra class registration cards mysteriously allowing 26 people to show up in a EE class limited to 12....

    1. Richard Plinston

      Re: Those were the days (and acronyms)

      > Then "a", "b", "c", `c+, c++

      There wasn't actually an 'A'. 'B' (the forerunner of 'C') was derived from BCPL: Basic CPL; where Basic was used in the sense of reduced rather than being related to BASIC and CPL was 'Combined Programming Language'. CPL was designed to be a combination of ideas from APL (Atlas Programming language), ACL (Atlas Commercial Language) and others.

      1. Peter Gathercole Silver badge

        Re: Those were the days (and acronyms)

        I have a copy of the book "A Programming Language" from the 1970s (I bought it second hand in 1978), which defined both the language and it's name!

        Of course there could have been an "Atlas Programming Language", but that's not the APL we know now.

  16. Anonymous Coward
    Anonymous Coward

    The Basic I remember using on my first job was, err, challenging:

    - limited memory footprint, although separate program files could be 'chained' together to run sequentially (each one overwriting the previous one in memory)

    - comments included in what used up said memory

    - variable names limited to 2 characters (plus trailing $ for arrays, iirc)

    - return n statement that returned control to n lines before/after the line with the matching call

    I have a vague memory of using a paper grid ( letters x digits ) to help keep track of which variable names had been used (command line editor only), but I think (hope) I must be imaging that.

    All in all it was an inspired choice for the financial applications we were developing.

  17. Billy Bob Gascan

    Horrible Travesty of BASIC

    BASIC was a RETARDED language. It was a toy language created for writing toy programs on toy computers. All of the variables were global. It didn't support any of the features of a real language, like pointers. You could use it to write a small program but it couldn't be used to write structured programs. If you tried to write a large program you got spaghetti code. The syntax was crap. And it was interpreted. I got my first big break in programming by re-writing a BASIC program in C for my potential employer. My C version ran in one percent of the time and I was hired. C was available at the same time as BASIC and is still the backbone of modern programming while BASIC has (thankfully) been cast upon the ash heap of history. I am so glad that I learned C instead of BASIC and that my exposure to it was limited because it sucked.

    1. J.G.Harston Silver badge

      Re: Horrible Travesty of BASIC

      "All of the variables were global."

      All the global variables are global, all the local variables are local, don't complain just 'cos you used a crap version of BASIC.

      "It didn't support any of the features of a real language, like pointers."

      Versions of BASIC that didn't have pointers didn't have pointers. Don't complain just 'cos you used a crap version of BASIC.

      "You could use it to write a small program but it couldn't be used to write structured programs."

      Versions of BASIC that didn't have structures didn't have structures. Don't complain just 'cos you used a crap version of BASIC.

      "If you tried to write a large program you got spaghetti code."

      Versions of BASIC that didn't let you write modulaised code didn't let you write modularised code. Don't complain just 'cos you used a crap version of BASIC.

      1. Billy Bob Gascan

        Re: Horrible Travesty of BASIC

        Back then, ALL versions of BASIC were crap.

      2. Dig

        Re: Horrible Travesty of BASIC

        So true, of course early limited versions could be missused, of course the best was QL Superbasic where the following could be done

        for f = 1,3,-7, 15 to 12 step -1

        next f.

        It wass fully procedural and I wrote a Superbasic subset compiler in it (only integer arithmatic) for my A levels which was faster than the comercially available supercharge compiler.

        Not only that but goto exists in C so you can, and people do write spaghetti code in C. What is it with open source stuff where people insist that all variables can be a maximum of 2 character long.

        QL rules yeah ( except that useless graphics layout)

    2. Destroy All Monsters Silver badge
      Holmes

      Re: Horrible Travesty of BASIC

      jake, is that you?

      I am so glad that I learned C instead of BASIC and that my exposure to it was limited because it sucked.

      Your passport to leet elitism, sir. Valet parking included!

      Ok, so anyone owned the

      Power C compiler or any other C compiler fitting into the 64KiB (or 32 Kib) of RAM of those times?

      "Due to the limited memory available in the C-64, the compiler may not be able to handle some very large source files. It is unlikely that the Power C 128 compiler will run into insufficient memory problems and not be able to handle the large source files"

    3. Richard Plinston

      Re: Horrible Travesty of BASIC

      > It was a toy language created for writing toy programs on toy computers.

      No. It was a toy language created for writing toy programs on MAINFRAMES (using time sharing).

      Toy computers did not arrive for another decade or more.

    4. Richard Plinston

      Re: Horrible Travesty of BASIC

      > C was available at the same time as BASIC

      Not true. K&K BASIC was 1964 (see article), C was nearly a decade later, initial internal versions were around 1972.

      On micros BASIC was around 1975, it wasn't until 1980 that a subset of C was available (Dr.Dobb's Journal May 1980 "A Small C Compiler for the 8080s"). Full C compilers for micros were several years later (Aztec, Lattice).

      1. James O'Shea

        Re: Horrible Travesty of BASIC

        Don't confuse him with facts.

        1. Billy Bob Gascan

          Re: Horrible Travesty of BASIC

          The fact is that improvements to BASIC that allowed it to do "sophisticated" things like declare local variables, use pointers, be compiled, etc. arrived in a piecemeal fashion in a whole bunch of implementations during the 1990s This contributed to the fact that BASIC is a hodgepodge of hundreds of different languages. The fact is that GOTSUB NN and other BASIC syntax is incomprehensible. I'm not bitter, I'm very grateful that I never had to program in BASIC, except my stint converting BASIC programs into C to improve their performance.

          Also I mis-spoke about getting my big break in the industry. Actually, I ran the company owner's interpreted BASIC program on a data sample he gave me and in 45 minutes I gave up. My C version ran the whole job in 20 seconds, so it didn't run in 1% of the time, it ran in less than 0.0074 of the time. He told me that the program would complete its task in a hour so this was probably more like 0.00555... as much time.

This topic is closed for new posts.

Other stories you might like