Slashdot Mirror


BASIC Computer Language Turns 40

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

38 of 1,042 comments (clear)

  1. missing line by squarefish · · Score: 5, Funny

    GOTO 10

    --
    Creationists are a lot like zombies. Slow, but powerful and numerous. And they all want to eat our brains.
    1. Re:missing line by Peridriga · · Score: 5, Funny

      shouldn't that be:

      10 PRINT "First Post"
      20 GOTO 10

    2. Re:missing line by CougarCat · · Score: 5, Funny

      10 print "BASIC? Boy does that ring a..." 20 print CHR$(7) 30 goto 10

  2. A Poem! by American+AC+in+Paris · · Score: 5, Funny
    10 PRINT "This is a"
    20 PRINT "Haiku program"
    30 GOTO 10
    --

    Obliteracy: Words with explosions

    1. Re:A Poem! by squidfood · · Score: 5, Funny

      Problem finally solved!...

      10 GOTO 30
      20 REM ???
      30 PRINT "PROFIT!"

    2. Re:A Poem! by Dejitaru+Neko · · Score: 5, Funny

      Pu-ro-gu-ra-mu. Five syllables. :P

      --
      Nyo nyo, the Neko Boy has spoken.
  3. They had a dream by Xel'Naga · · Score: 5, Funny

    Obviously they failed, and so they created BASIC instead.

    1. Re:They had a dream by Lane.exe · · Score: 5, Funny
      But without BASIC would we have QBASIC and that nifty gorilla-banana-chunking program?

      --
      IAALS.
  4. And now we have ... by mcx101 · · Score: 5, Funny

    ... BASIC's much acclaimed successor, Visual Basic ;-)

    --
    My operat~1 system unders~1 long filena~1 , does yours?
    1. Re:And now we have ... by nacturation · · Score: 5, Funny

      I tried Audible Basic, but it wasn't very good. Tactile Basic wasn't too bad, but please... please, for the sake of the children, stay away from Olfactory Basic.

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
  5. Janitors are programmers too! by stienman · · Score: 5, Funny

    yet simple enough that even the school's janitors could use it

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

    -Adam

  6. School Janitors by FlatBlack · · Score: 5, Insightful

    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).

  7. Re:ahem by bee-yotch · · Score: 5, Informative

    they started it in '63, they didn't finish it till '64. rtfa

  8. And then came VB by John+Starks · · Score: 5, Insightful

    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.)

  9. Obligatory Dijkstra quote by Kaa · · Score: 5, Funny

    "Learning BASIC causes permanent brain damage." -- E.Dijkstra

    --

    Kaa
    Kaa's Law: In any sufficiently large group of people most are idiots.
  10. Re:5 REM Testing.. by Anonymous Coward · · Score: 5, Funny

    10 REM "In that case, they should be comments."
    20 END

  11. Re:ahem by deck · · Score: 5, Funny

    10 PRINT "Concived: 1963"
    20 PRINT "Born: 1964"
    30 END

  12. Edsger Dijkstra? Does not like it by AtariAmarok · · Score: 5, Interesting
    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. -- Edsger Dijkstra/

    What it really means is that the programmers won't program exactly the way Dij wants them to do. It is not "good" or "bad": just different. Programming should not be a straitjacket: the more options and the more different ways to do thing, the better. Those who think that there is no place for anything like a GOTO should look at html.

    --
    Don't blame Durga. I voted for Centauri.
  13. Re:5 REM Testing.. by jared_hanson · · Score: 5, Funny

    System.out.println("10 PRINT \"Hell\"");
    System.out.println("GOTO 10");

    --
    -- Fighting mediocrity one bad post at a time.
  14. Re:WHY! WON'T! IT! DIE! by Theatetus · · Score: 5, Informative
    I've heard it claimed that BASIC was "invented" by Microsoft

    Microsoft certainly doesn't claim that.

    or that they own it

    Nor do they claim that

    or that their first product was a BASIC interpreter

    They do claim that, because it's true.

    What's the connection between MS and BASIC?

    BASIC was always the applications and scripting language at Microsoft. For a long time, DOS and the early Windows shipped with a free basic interpreter (sadly, those days are over).

    Visual Basic remains one of Microsoft's flagship products. It's philosophy is similar to the original BASIC philosophy: you shouldn't have to be a comp sci graduate to write computer programs. Whether VB succeeds in that regard is another question, but it's what they intended.

    BASIC is still Microsoft's language for application automation (think Visual Basic for Applications), Web development (ASP with VBScript), and as a tool control language for gluing together objects written in lower level languages. In a sense, some form of BASIC fills the roles in Windows that Scheme, Perl, and TCL occupy in UNIX.

    --
    All's true that is mistrusted
  15. Re:ahem by nycsubway · · Score: 5, Funny

    That is because array indexes start at 1 instead of zero. So it's really 41 years if you start from year one.

  16. REM Thank You For Bad Habits by Eberlin · · Score: 5, Interesting

    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 command.com -- 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.

  17. a BASIC error by M0nkfish · · Score: 5, Funny

    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.

  18. Re:5 REM Testing.. by Tackhead · · Score: 5, Funny
    > 10 PRINT "I hearby declare..."
    > 20 PRINT "that all comments in this story"
    > 30 PRINT "be typed in basic"
    > 40 END

    1 PRINT "FUCK YOU"<BR>
    2 GOTO 1<BR>
    3 REM ITS BEEN 20 YEARS SINCE I DID THAT TO A VIC-20<BR>
    4 REM AND THEY STILL DONT LET ME IN THAT MALL
  19. Consumers vs. Creators by landoltjp · · Score: 5, Interesting
    "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"

  20. Re:Nostolgia by AKAImBatman · · Score: 5, Informative

    You wish is my command. Here's the source code plus there's a PALM version at the bottom of the list. In case you want to type it in yourself, SmallBASIC accepts traditional BASIC syntax. Someone event did a SmallBASIC port of Super Star Trek for you!

  21. Re:Dijkstra said it best ...not by panurge · · Score: 5, Interesting
    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.

    --
    Panurge has posted for the last time. Thanks for the positive moderations.
  22. BASIC Sex Ed by Throtex · · Score: 5, Funny

    Don't forget to PEEK before you POKE!

  23. The old days were better for beginners. by Theovon · · Score: 5, Insightful

    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.

  24. 1K Adventure by UdoKeir · · Score: 5, Funny

    This one used to tie people up for a few minutes...

    10 PRINT "You are in a cave."
    20 PRINT "Go N, S, E OR W?"
    30 INPUT A$
    40 GOTO 10

  25. In defence of BASIC by BlightThePower · · Score: 5, Insightful
    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.

    --
    Plays violent online games as: Nerfherder76
  26. Re:Look at all these posts. by IWannaBeAnAC · · Score: 5, Funny
    Here's a clue kiddies
    Haiku in English is dumb
    Add last line next time

    ;)

  27. Re:Troll? Moi? by JavaLord · · Score: 5, Interesting

    GOTO's make spaghetti code. It is very hard to trace through, especially if the code is uncommented.

    Ever tried to sift through someone's OOP program that is poorly documented and methods are badly named? It's just as bad. Ever seen a method that calls six others methods in different objects in it's body which are all overloaded 5 or 6 times? Bad/Sloppy programming spans all languages and isn't confined to a goto statement.

    How about poorly named method signatures? For example

    String getNumber(String x, int i, boolean q, vector a)

    I've seen crap like this before from programmers.

    Try maintaining code full of goto's. Good luck.

    No it's not the best thing in the world to do, but if it's well documented it's not as bad as you make it out to be. I started out in basic when I was 7, and I work now as a Java programmer. I would gladly take well commented code with GOTO's over poorly done OOP code.

  28. Re:Today we use Bash by ajs318 · · Score: 5, Informative
    Better to use something like
    int main() { /* i wish this thing would indent properly */
    for (1;1;1) { /* will loop forever */
    printf("ajs318 is a better programmer than Jorkapp\n");
    };
    };
    Repeatedly calling main() from within main() probably would overflow the stack. It's the equivalent of using GOSUB in BASIC when you meant GOTO -- GOSUBs and function calls have to remember where they were called from, which is what a stack is used for. If the compiler you were using was tolerant enough that you could declare void main(), then it would last about twice as long before crashing and burning, due to not having to temporarily remember an integer it's later going to have to throw away.
    --
    Je fume. Tu fumes. Nous fûmes!
  29. BASIC? That's too newfangled for me! by wcrowe · · Score: 5, Funny
    11 FORMAT(1X,"I'M SO OLD THAT MY")
    12 FORMAT(1X,"FIRST PROGRAMMING LANGUAGE")
    13 FORMAT(1X,"WAS NOT BASIC")
    WRITE(1,11)
    WRITE(1,12)
    WRITE(1,13)

    99 STOP
    END
    --
    Proverbs 21:19
  30. Re:Dijkstra said it best ... by poot_rootbeer · · Score: 5, Insightful

    "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.

  31. Before we dismiss BASIC as a simple language by alphakappa · · Score: 5, Insightful

    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:
    #include
    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.

    --
    "When the only tool you own is a hammer, every problem begins to resemble a nail." - Abraham Maslow (1908-1970)
  32. Windows NT, CMD + QBASIC by os2fan · · Score: 5, Interesting
    All versions of OS/2 and Windows NT/2K/XP ships with a copy of qbasic 1.0, while DOS 6, and windoze ME/9x ship with qbasic 1.1.

    All of these can be started as an editor, eg QBASIC / EDCOM

    On the other hand, only vers 1.1 can read the dos help file HELP.HLP.

    Amusingly, Windows understands what a QHELP file is, that if you click on a quickbasic help file, it says 'this is a DOS help file', whereas any other help file (eg 4dos.hlp), it says "unknown format".

    In any case, basic shipped with msdos, because in older times, computers had a rom-basic in their bios.

    GWBASIC is a standalone emulator for graphical workstations (ie workstations that replaced the rom-basic with video memory).

    BASIC in its raw form continues to affect the way that COMMAND.COM and CMD.EXE work. For example, if one does a test, and it is false, the rest of the line is skipped. In the sample below, we see two statements, separated by an &. If one makes the if statement, one gets neither command, while if the statement is true, both work.

    if "1"=="1" echo 1 & echo 2
    One can implement a die style command by this, or by replacing echo with set, pass a parameter to a subroutine.
    if (condition) echo something & goto :end
    In any case, it's dodgy.
    --
    OS/2 - because choice is a terrible thing to waste.