Follow Slashdot stories on Twitter


Forgot your password?
Programming IT Technology

BASIC Computer Language Turns 40 1042

5 REM nam37 codes
10 PRINT "In 1963 two Dartmouth College math professors had a radical"
20 PRINT "idea - create a computer language muscular enough to harness"
30 PRINT "the power of the period's computers, yet simple enough that even"
40 PRINT "the school's janitors could use it."
50 END
This discussion has been archived. No new comments can be posted.

BASIC Computer Language Turns 40

Comments Filter:
  • by squarefish ( 561836 ) on Thursday April 29, 2004 @03:46PM (#9011100)
    GOTO 10
  • A Poem! (Score:5, Funny)

    by American AC in Paris ( 230456 ) * on Thursday April 29, 2004 @03:47PM (#9011125) Homepage
    10 PRINT "This is a"
    20 PRINT "Haiku program"
    30 GOTO 10
  • by Xel'Naga ( 673728 ) on Thursday April 29, 2004 @03:47PM (#9011128)
    Obviously they failed, and so they created BASIC instead.
  • by mcx101 ( 724235 ) on Thursday April 29, 2004 @03:47PM (#9011130)
    ... BASIC's much acclaimed successor, Visual Basic ;-)
  • yet simple enough that even the school's janitors could use it

    And that, children, is where the seeds of garbage collection were sowed.

  • by pirodude ( 54707 ) on Thursday April 29, 2004 @03:47PM (#9011138)
    10 PRINT "I hearby declare..."
    20 PRINT "that all comments in this story"
    30 PRINT "be typed in basic"
    40 END
  • School Janitors (Score:5, Insightful)

    by FlatBlack ( 771571 ) on Thursday April 29, 2004 @03:47PM (#9011145)
    Ooo. Me Grandpa was a custodian and a very smart man. Watch your mouth. I work for a school and the janitors here are smart folks too. Most of all, they treat the lowly tech guy with respect in spite of his job and the fact that he lives in his parents basement and has never touched a girl (not a real girl anyway).
  • From the Jargon File (Score:5, Interesting)

    by idiot900 ( 166952 ) * on Thursday April 29, 2004 @03:48PM (#9011153)
    Alright, I'll commence the BASIC-bashing by quoting from the Jargon File:


    [acronym, from Beginner's All-purpose Symbolic Instruction Code] n. A programming language, originally designed for Dartmouth's experimental timesharing system in the early 1960s, which has since become the leading cause of brain-damage in proto-hackers. This is another case (like Pascal) of the cascading lossage that happens when a language deliberately designed as an educational toy gets taken too seriously. A novice can write short BASIC programs (on the order of 10--20 lines) very easily; writing anything longer is (a) very painful, and (b) encourages bad habits that will make it harder to use more powerful languages well. This wouldn't be so bad if historical accidents hadn't made BASIC so common on low-end micros. As it is, it ruins thousands of potential wizards a year.
  • AAAaaaaghhh (Score:3, Interesting)

    by Doesn't_Comment_Code ( 692510 ) on Thursday April 29, 2004 @03:48PM (#9011157)
    Damn I hated numbering each line of code!

    And when you had to add something and have uneven spacing of line numbers... Oh it just drives the type A personality in me nuts!

    The only good part about line numbers was how easy it made it to write GOTO statements.
    • Re:AAAaaaaghhh (Score:3, Informative)

      by drivers ( 45076 )
      Damn I hated numbering each line of code!

      And when you had to add something and have uneven spacing of line numbers... Oh it just drives the type A personality in me nuts!

      Ah, but AUTO numbers the lines for you. You get a new number each time you hit enter. AUTO [n] starts at line [n].

      RENUM renumbers all the lines with a consistent spacing, including the GOTOs, GOSUBs, etc.

      I can't believe I still remember that PC-DOS BASICA stuff.
    • Re:AAAaaaaghhh (Score:3, Interesting)

      by tepples ( 727027 ) *

      10 LET M$ = "Microsoft"

      And when you had to add something and have uneven spacing of line numbers

      Of course, that's why many micro BASIC dialects had a renumbering program available.

  • And then came VB (Score:5, Insightful)

    by John Starks ( 763249 ) on Thursday April 29, 2004 @03:48PM (#9011164)
    Then VB came, and a language was created that was muscular enough to script Word macro viruses, but simple enough to enfuriate good programmers (I mean, really, no short circuit boolean operators? It makes me weep.)
  • by Kaa ( 21510 ) on Thursday April 29, 2004 @03:48PM (#9011166) Homepage
    "Learning BASIC causes permanent brain damage." -- E.Dijkstra
  • Nostolgia (Score:5, Funny)

    by AKAImBatman ( 238306 ) <akaimbatman&gmail,com> on Thursday April 29, 2004 @03:50PM (#9011205) Homepage Journal
    Ok, who remembers the Star Trek game from Dartmouth? You know, the one where you got to enter coordinates to move the ship to, then fire photons and phasers at Klingons? You could even consult the library computer! Failing that, who remembers coding the "trench" game?

    | * |
    | * |
    | * |
    | * |
    |* |
    | |
    | |

  • by the morgawr ( 670303 ) on Thursday April 29, 2004 @03:53PM (#9011249) Homepage Journal
    How is that so? Was B derived from basic? I'm pretty sure it wasn't. Smalltalk maybe? I thought the flow went like this:

    1. B (short for Bell, where it was written)
    2. C
    3. Objective-C (C with some smalltalk stuff added)
    4. Java
  • Ah, the memories... (Score:3, Interesting)

    by Phoenix-kun ( 458418 ) * on Thursday April 29, 2004 @03:54PM (#9011284) Homepage
    I wrote my very first program in Basic on an 8K PDP-8/I computer ("Hello World!") back in 1975. We had to toggle in the bootstrap instructions using the toggle switches, load the OS from a paper tape and then finally the Basic application off the DECtape drive. I was just amazed at the possibilities and would come in on my own time just to write silly little programs.
    • Let's see a show of hands, everyone. Don't be afraid to admit it. How many of you wrote your very first program in Basic?

      Mine was in the early 70's, on a ASR-33 Teletype in my high school math class that was connected via dial-up connection to some mainframe at Penn State.

      Ten characters per second on a roll of paper. with a spiffy paper-tape punch hanging on the side.

  • by zonix ( 592337 ) on Thursday April 29, 2004 @03:56PM (#9011328) Homepage Journal

    "It is practically impossible to teach good programming style to students that have had prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration." -- Professor Edsger Dijkstra

    Oh yeah and "Goto considered harmful" too, of course.

    RIP buddy. :-)

    • by panurge ( 573432 ) on Thursday April 29, 2004 @04:17PM (#9011722)
      Edsger Dijkstra is all too typical of the arrogant academics who gave rise to Shaw's comment "Those who can, do, those who can't, teach. He's like the academic fanboys who argue that PostgreSQL is a real RDBMS, MySQL can't really be used for anything serious.

      Don't believe it, kids. If your brain hasn't been ruined by age 7, you can unlearn any bad habits you pick up. His remark is of a stupidity level equal to "if you learn French at school, you won't be able to learn German."

      As a matter of fact, not only did I once inherit a program that someone had written - well - on a BBC micro that was a pleasure to maintain, I once myself had to write a quick and dirty assembler for an obscure microprocessor in HP Basic, having no other resources available in a crisis. Despite which I have never once had the urge to use labels in C.

    • by CarrionBird ( 589738 ) on Thursday April 29, 2004 @04:38PM (#9012062) Journal
      Nothing stopping you from using structure in BASIC but your own mind.
    • by poot_rootbeer ( 188613 ) on Thursday April 29, 2004 @05:15PM (#9012544)
      "It is practically impossible to teach good programming style to students that have had prior exposure to BASIC; as potential programmers they are mentally mutilated beyond hope of regeneration." -- Professor Edsger Dijkstra

      Okay, now all the professional coders whose first programming experience was in BASIC on a VIC-20, Apple II, or TRS-80, raise your hands... man, there seems to be a lot of us, huh.

      Oh yeah and "Goto considered harmful" too, of course.

      GOTO is essential -- all processors use it at their lowest levels (it goes by the name JMP in assembly language, though.)

      All other types of branching or looping are just syntactic sugar.
  • by BeneathTheVeil ( 305107 ) on Thursday April 29, 2004 @03:56PM (#9011332) Homepage Journal
    This brings me back... the first language I ever learned to code in was C++... but before that, I had learned Qbasic. ;)

    I think it was the limited nature of the language which kept me interested in it for so long. Those DOS memory limits were fun... coding a 2D RPG, and trying to stay within around 450KB, so it would run on most people's DOS machines. It was a challenge, I tell you... and trying to keep the code neat, and tidy... also a fun challenge.

    To this day, I'm still amazed at some of the things which people were able to do with QBasic, and QuickBasic... fast raycasters, 3d polygon game engines, even voxel engines! ...but I think, the biggest fad was making console style RPGs. I'd like to think that I had a small hand in starting that fad, with a little Qbasic RPG demo I released in 1997. Some of you may have played it, it was called "Lianne in... the Dark Crown". Yes, fun times... fun times indeed.

    I think, I'll go looking for all those old Qbasic games. They may not have been much, but they were fun to play.
  • by leoaugust ( 665240 ) <> on Thursday April 29, 2004 @03:57PM (#9011344) Journal
    yet simple enough that even the school's janitors could use it
    Using the language is one thing, knowing what to use it for is another. I know of many many "programmers" who know the programming language's syntax and can write basic programs, but ask them to program something creative or program something creatively and they fail miserably.

  • by HarveyBirdman ( 627248 ) on Thursday April 29, 2004 @03:58PM (#9011365) Journal
    Apple II Basic

    Atari Basic

    6502 Assembler



    Deep Blue C


    Metrowerks C

    GNU C

    Perl (just enough to make my Unix life easier)


    GNU C++

    Visual Basic


    Have I come full circle? By the time I got to C++ and VB, I was mainly programming for work, but RB has made programming fun again, and I have launched a couple personal projects for the first time in years.

    Gold bonus points if you know what Action! was.

  • BASIC got me going (Score:4, Insightful)

    by kdekorte ( 8768 ) on Thursday April 29, 2004 @03:59PM (#9011379)
    Well I'm glad BASIC exists because I probably would not have started programming without it. Can you imagine trying to learn C or something like that when you are 13 (circa 1984) and have no other programmer friends and no internet or BBS to get sample code from. Also C and Pascal compilers cost big money back then. Borland's Turbo Pascal was probably the other big hobby language back the as well. It probably damaged my skills, but I think I have overcome most of the damage.

    And Windows 3.1 never would have been as accepted as it was if not for VB 1.0. I think VB was probably the thing that got a lot of people on Windows because programming Windows in C at that point was very complicated for the home hobbiest.
    • Well I'm glad BASIC exists because I probably would not have started programming without it. Can you imagine trying to learn C or something like that when you are 13 (circa 1984) and have no other programmer friends and no internet or BBS to get sample code from.

      Happy Birthday BASIC but where is the pathway to any flavour of the language now?

      Once upon a time BASIC came as a free part of the computer box. A lot of boxes, you turned them on and there was BASIC. To do anything at all, you had to learn BAS

  • by Lust ( 14189 ) on Thursday April 29, 2004 @04:00PM (#9011401) Homepage
    Hey, stop using janitors as some lowest-common-denominator! Rather "The language was so simple even programmers could use it."

    The JLO
    • A friend of mine went to college and got an Economics degree. He then dropped out and became a buddhist hippie for a few years before landing a job as a janitor at another uni. One of the side benefits of the job was that they paid for 1 class each semester for the employees.

      He started taking classes and 5-6 years later got a Phd. in entomology. We like to joke around 'If this Phd. thing doesn't pay off you can always fall back on your experience in the janitorial field...'

      The lesson: NEVER underestimate
  • by Eberlin ( 570874 ) on Thursday April 29, 2004 @04:00PM (#9011413) Homepage
    Ah yes, BASIC. I remember it distinctly as it's what I used for the longest time. Didn't have to declare your variables, had to contend with line numbers (that renum thing came in very handy), and of course the ever-popular GOTO statements.

    Eventually I evolved onto qbasic with its functions and subs and (gasp) no line numbers! Then there's VB and VBA. The most fun I've had with those are the shell calls.

    On machines that are so locked down that you can't even traverse directories let alone get a shell prompt, you run your form of BASIC, and do basic shells through it or even shell to cmd.exe or -- at one point, I had a really lamed out, simple, featureless, just for fun version of netcat that executed shell commands, piped it to a text file, and had the text file's contents sent through the network. (this with VB's socket stuff). If nothing else, it was a good way to make fake Novell login prompts in the mid 90's. ;-)

    In the end, not a lot of people will be taken seriously for knowing BASIC, but since it was the first language I used, I appreciated the retro code.
  • by M0nkfish ( 620414 ) on Thursday April 29, 2004 @04:01PM (#9011421)
    10 PRINT "Happy Birthday to you"
    11 PRINT "Happy Birthday to you"
    12 PRINT "Happy Birthday dear BASIC"
    13 END

    Dammit... Missed out a line. Now I remember why I should always increment line numbers by 10.
  • Why BASIC was good (Score:5, Insightful)

    by unfortunateson ( 527551 ) on Thursday April 29, 2004 @04:03PM (#9011466) Journal
    Today's VB and similar derivatives bears so little resemblance to Dartmouth BASIC that it's hardly the same language. If it wasn't for FOR/NEXT and DIM, you might not recognize it at all.

    But the old line-oriented BASIC had some advantages in the bad, old days:
    1) Interactive editing is difficult to do on a teletype -- many schools only had a hardcopy terminal to a timeshare service. Being able to drop a line in the middle, or retype a single statement really really helped learn what was going on, without having to re-send the entire program. Even with a primitive CRT, full-screen text editors were of poor quality -- dropping in statements helped to debug and fix features.

    2) Later, it was ubiquitous: You could write the same abusive repeating naughty-word program at a Radio Shack, an Apple Dealer, or a department store selling Commodore PETs.

    3) It beat COBOL or FORTRAN. The only thing with BASICs interactivity might be FORTH -- imagine if we'd been saddled with page-delimited, stack-based code in all our micros. It's a lot harder to learn, but would have helped modularity and library development.
  • by landoltjp ( 676315 ) on Thursday April 29, 2004 @04:07PM (#9011520)
    "On some level I think it's sad that it went away," he said. "People went from being creators of software to consumers."

    I must admit that I share his lament. The programmer-to-user ratio got considerably worse as the ubiquity of computers increased.

    When I got my first computer (comment hoping skip the 'geek pissing match'), the majority of other people with computers were using them to write programs. As the PCs (now workstations) got adopted (then coopted) by 'business' for them to do their thing, the computer became a 'tool'. I never stopped programming, but all my non-geek friends started to get in on the computer-owning game. Most of them couldn't write a line of BASIC with a gun to their head, even though they have the capacity to do so, but gosh, they all thought they were just whizz-bang computer users! *sigh*

    As a colleague of mine (and a really amazing programmer) once said: "Accessibility is the yellow brick road to mediocrity"

  • insensitive clods (Score:4, Insightful)

    by michaelndn ( 86690 ) on Thursday April 29, 2004 @04:07PM (#9011537) Homepage
    lay off the janitors!
  • 60 PROFIT! (Score:4, Funny)

    by dpilot ( 134227 ) on Thursday April 29, 2004 @04:16PM (#9011680) Homepage Journal
    Syntax Error "PROFIT!"
    Command Not Found "PROFIT"
  • by 4of12 ( 97621 ) on Thursday April 29, 2004 @04:16PM (#9011699) Homepage Journal

    ...of typing in BASIC programs on a Teletype with a large roll (yes, just like bathroom towels) of yellow newsprint on a Data General Nova. []

    And, to write and read my program - paper tape!

    In those days, having a machine do math for you, math that would otherwise be tedious crunching by hand, gave me a sense of wonder and power.

  • by crivens ( 112213 ) on Thursday April 29, 2004 @04:19PM (#9011741)
    And lo, thousands of people suddenly decided to call themselves excellent programmers!
  • by Chuck Bucket ( 142633 ) on Thursday April 29, 2004 @04:24PM (#9011839) Homepage Journal
    70 GOTO 50

  • by Theovon ( 109752 ) on Thursday April 29, 2004 @04:25PM (#9011854)
    Computers died for me the day the stopped shipping them with built-in BASIC.

    Seriously, though. The computers of the 80's were great for learning programming on. Not that BASIC is a good teaching language, but it was accessible and simple.

    Modern computers have too many features that you want serious programmers to have access to (complicating languages), and modern languages have all sorts of safety, structure, and OO features that are great for serious programmers but also complicate things for beginners.

    Breaking into programming is much harder than it used to be.
  • by Sigh Phi ( 324315 ) on Thursday April 29, 2004 @04:31PM (#9011957)
    I was introduced to BASIC first on a friend's Apple IIe and subsequently on my own first computer, an original Macintosh.

    First programs included the standard:

    10 print "Enter your name: "
    20 input NAME$
    30 print NAME$ " is a doofus."
    40 goto 30

    About that time, I started getting 3-2-1 Contact Magazine, a science and nature periodical written for kids who had grown out of Sesame Street and The Electric Company. In the back of every issue was the "BASIC Training" feature, which had simple games and programs for a variety of platforms. The IBM versions were usually the only ones I could use; Apple IIe and Commodore 64 PEEK and POKE calls were meaningless in Mac MS-BASIC.

    But later, BASIC facilitated an (extremely sketchy) introduction to the Macintosh toolbox. MS-BASIC on the mac had built-in pseudo toolbox calls so that you could change fonts, draw graphics primitives and buttons. I ended up writing a grade tracking program that was a snare of interwoven GOTOs and GOSUBs.

    I breezed through two years of programming courses in high school and learned C in my own time. Looking back, I'm a little ticked off that my HS didn't offer "real" computer science with Pascal or C or any sort of AP treatment.

    Then I learned Perl. Now I do websites. I've forgotten most of BASIC. I have been told this is a good thing. But sometimes (actually, lately, more and more) I have to deal with VBScript and I see "LEFT" and "MID" and I think "what the hell is this crap?"

    Ah, memories.
  • by exp(pi*sqrt(163)) ( 613870 ) on Thursday April 29, 2004 @04:32PM (#9011981) Journal
    A real programmer can extract useful work from anything from a pile of matchboxes [] to a state of the art cluster without bitching.
  • by BlightThePower ( 663950 ) on Thursday April 29, 2004 @04:43PM (#9012139)
    Yes, BASIC fosters bad programming habits. However, this isn't really the point. Let me explain why.

    1. When I and many other people started out with computers, BASIC was the only game in town. Yes, there was assembler and other languages, but its easy to forget these days that information was hard to come by pre-web and indeed, for children who don't have the disposable income for specialist magazine subscriptions. Libraries typically had a couple of computer books, but these would be non-specific description books (that no longer exist as genre really) explaining that a computer had ROM, RAM and you could hook it up to a printer and a VDU! etc. etc. They had hand-drawn "screenshots" of space invaders and pac-man. BASIC was easy enough that we could get started without being put off. On Slashdot its easy to be intellectually macho, but theres a lot to be said for a low learning curve that encouraged you ever onward.

    2. BASIC today. Well, its probably not for serious programmers. However, what is often forgotten here is that not everyone who programs is a professional programmer. Or wants to be. For very simple programs, GOTO is no sin. At least when the alternative is no program at all and, say, organising data in a text file by hand or "manually" in Excel or something. Bad habits are not a problem here, because one is never going to go on to have to write mission critical software in C or whatever. I know there are modern scripting languages that are perhaps just as easy to use, but you might be surprised how many people you might have thought have difficulty programming a VCR will break out QBASIC or VB when they need 20 line quicky knocking together and the programmers are "busy until further notice". Its easy to belittle this from a position of knowledge and authority, but relatively speaking these people are your friends in a landscape of PHBs that think programs just happen.

    So in conclusion, BASIC is often better than nothing. That might sound like feint praise, but like I say, for the non-specialist that can be quite a valuable thing. Computer programming for the masses. Mock it at your peril.

  • by wcrowe ( 94389 ) on Thursday April 29, 2004 @05:13PM (#9012518)

    99 STOP
  • by bshroyer ( 21524 ) <bret@bret[ ] ['shr' in gap]> on Thursday April 29, 2004 @05:13PM (#9012519)
    I was one of four students in a pilot program in 4th grade (1980) wherein we learned BASIC programming (Apple II) and "New Math" (don't even get me started.)

    After learning the basics, I started my first project - a random text generator. I wanted to see if, left to its own devices, the Apple II would eventually reproduce the works of Shakespeare. Or at least, produce a few dirty words on its own.

    I spent two days coding (never having used a keyboard before, typing was arduous)
    The program went like this:

    10 A=INT(RND(1)*30) +1
    20 REM
    30 IF A=1 THEN $B="A"
    40 IF A=2 THEN $B="B"

    340 IF A=30 THEN $B="."
    350 PRINT $B;
    360 GOTO 10

    If I recall, there was no "copy" or "paste" function in the boot ROM AppleII BASIC. Typing this was hell on my 9-year-old fingers.
    The good news is, the program worked. The bad news is, after I'd finished it, the teacher showed me how to cut 29 lines out of my program using the $CHR() function. I wanted to shoot him.

    All in all, BASIC served me well. It's a great intro programming language for pre-teens.
  • by alphakappa ( 687189 ) on Thursday April 29, 2004 @06:10PM (#9013146) Homepage
    That is its biggest strength.

    I remember how I got into programming in school - we had these BBC computers [] which could run BASIC. The language was simple enough for me to understand and intuitive enough for me to actually like programming. (Before that I had seen an aunt learn COBOL and the very look of the language frightened me)

    Sure, BASIC is not as advanced as C, BASIC uses GOTO statements, BASIC (not QBASIC though) uses archaic line numbers (but still not as archaic as the Fortran 77 tradition of having to write everything after 7 spaces), but BASIC is the best tool to introduce an enthusiastic person to the world of programming. See this example: In BASIC you would show the person:
    10 PRINT "Hello World"
    20 END

    Bingo, the person magically sees his first program work. Try the same thing with C:
    int main(){
    printf("Hello World\n");
    return 0;

    See how much more you have to explain? Ever tried to explain stdio.h and int main to someone? :-) Once you introduce a kid to the concepts of do loops, for loops and if..then statements, it is so much easier to learn a complicated language like C. It's a pity you don't have QBASIC shipping with Windows machines any more. Vbscripting is not at the same intuitive level.

    • by Repton ( 60818 ) on Thursday April 29, 2004 @08:10PM (#9014234) Homepage

      Yeah, my uni teaches Java to first years. Java is a nice language (and the uni programmers put together a library to hide most of the exception handling) ... but your first program looks like this:

      public static void main(String[] args) {
      System.out.println("Hello world!");

      We were basically taught to type "public static void main string args" as an invocation that we would (hopefully) come to understand more in later weeks...

  • by hiroshi912681 ( 589840 ) on Thursday April 29, 2004 @06:38PM (#9013433)
    last week, Office Max had a sale on these Casio graphing calculators (usually about $80) for $5. I picked up one, naturally. I should've picked up more. You never know when you'll run into some problem that BASIC could easily solve. Unfortunately, I haven't figured out how to convert minutes to hours:minutes format with it... for the program I'm working on.

    When I vacationed in Canada a few years ago, I took my TI-83 to convert currency and measurements for me. But, I found an even bigger need during the trip... converting CDN$ per litre of "petrol" to USD per gallon of gas. Things made a lot more sense at the pump.

FORTRAN is the language of Powerful Computers. -- Steven Feiner