Slashdot Mirror


50 Years of BASIC, the Language That Made Computers Personal

harrymcc (1641347) writes "On May 1, 1964 at 4 a.m. in a computer room at Dartmouth University, the first programs written in BASIC ran on the university's brand-new time-sharing system. With these two innovations, John Kemeny and Thomas Kurtz didn't just make it easier to learn how to program a computer: They offered Dartmouth students a form of interactive, personal computing years before the invention of the PC. Over at TIME.com, I chronicle BASIC's first 50 years with a feature with thoughts from Kurtz, Microsoft's Paul Allen and many others."

224 comments

  1. Looks like a duplicated thread by Anonymous Coward · · Score: 0

    Some one have already created a thread on Basic with same title.

    1. Re:Looks like a duplicated thread by Opportunist · · Score: 4, Funny

      That's not really a good idea, Basic is hardly thread-safe!

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
  2. Was FORTRAN really that hard? by Bill,+Shooter+of+Bul · · Score: 5, Insightful

    I mean Basic isn't difficult either, but I really don't understand the perspective at the time that FORTRAN was so complex that BASIC and COBOL were really needed for their syntax changes alone. All of the explinations I've read about them, invariably have the line somewhere about FORTRAN being so difficult to understand that only scientists could master it. I understand they were all invented for different problem domains and that's kind of a good reason in and of itself, but sheesh, its not like it was brain fudge.

    --
    Well.. maybe. Or Maybe not. But Definitely not sort of.
    1. Re:Was FORTRAN really that hard? by Brett+Buck · · Score: 5, Informative

      It isn't hard. I think the only issue that anyone has had with it was the column restrictions, and the important development there was interactive computing and a decent text editor, not a new language.

          Bear in mind, also, that most people haven't ever attempted to write in original FORTRAN. Most have seen nothing earlier than FORTRAN 77 and that was tremendously easier and far less irritating than FORTRAN IV. I am old enough to have written FORTRAN IV on card decks, the "good old days" sucked for the most part.

          I always found BASIC to be far more irritating to program in anything more than trivial applications.

            I don't think the language is the problem, it was all other things that where difficult and mostly solved in the 60's and 70's.

            FORTRAN is certainly still in use for Real Programming. I haven't seen a way to use BASIC- in the way it was originally conceived - in 25 years.

               

    2. Re:Was FORTRAN really that hard? by flyingfsck · · Score: 4, Interesting

      No, it is more a case that access to any computing resources was very limited. Twenty years later, universities still had old time sharing machines running Fortran and BASIC that first year students trained on and COBOL, while PL1 on Sperry-Univac machines was the new thing for the seniors. A typical university only had two to four computers in total. I also started by learning BASIC with punch cards on a mainframe, since that was the only thing that was available. The small computer population explosion only really happened in the 1980s.

      --
      Excuse me, but please get off my Pennisetum Clandestinum, eh!
    3. Re:Was FORTRAN really that hard? by Jahta · · Score: 4, Funny

      Ob. quote from Real Programmers.

      "Real programmers don't write in FORTRAN. FORTRAN is for pipe stress freaks and crystallography weenies."

      Of course, it also says this about BASIC :-)

      "Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12."

    4. Re:Was FORTRAN really that hard? by tangent · · Score: 5, Informative

      FORTRAN wasn't the language in 1964 that you think of as FORTRAN today.

      Most people's concept of FORTRAN is FORTRAN 77 or its descendants, which was 13 years in the future from BASIC's introduction.

      At the time of BASIC's introduction, FORTRAN IV was the current version.

      FORTRAN wouldn't be ANSI-fied for another two years as FORTRAN 66, so every version had machine-specific features. Also, because FORTRAN's development was largely driven by IBM until FORTRAN 66, all the non-IBM versions were "nonstandard." Imagine if, today, every computer came with a C compiler and there were no ANSI or ISO standard to constrain its behavior. The last common reference would have been K&R '78.

      Another fun feature of early FORTRAN was fixed column layout, common among languages invented in the punched card era. That is, you had to do things like start all statements in column 7 or later, because the first 6 columns had other meaning.

      Early FORTRANs also had very primitive program structuring concepts, hardly raised from the level of assembly language.

      Read through the Wikipedia article. You'll probably be shocked at how primitive FORTRAN was in the early 1960s.

    5. Re:Was FORTRAN really that hard? by jellomizer · · Score: 2, Informative

      Well there were a few key advantages.
      BASIC was an interpreted language, vs FORTRAN or COBOL that required compiling. This gave beginner programmers quicker response in terms of code it run it. vs. Compile find a slew of cryptic errors try to find them and fix and try again.
      Secondly BASIC was a line driven language vs. procedural.
      10 print "hello"
      20 goto 10
      yes it created a lot of bad programming habits. But it really explained how the computer processed the stuff better then the procedure. But I am sure some of you taking CS 101 (Those without previous programming experience) often got hung up on function and procedures, loops and nested loops. The BASIC GOTO and if you get advanced use the GOSUB and RETURN makes these concepts easier.

      Third BASIC handles free formatting much easier. FORTRAN you needed to follow a Particular set of formatting the first few spaces were reserved for labels or line wrap numbers, limit to 80 columns... In general nitpicking stuff that a started just doesn't want to handle.

      As time went on, we really loss the simple computer programming language. BASIC turned to QBASIC then to Visual Basic then to VB.NET which made it a formatted language with all the hold ups the other professional languages has.
      There isn't really a good starting language anymore.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    6. Re:Was FORTRAN really that hard? by MightyYar · · Score: 2

      It's not so much that FORTRAN was horrible, but AFAIK it did not lend itself to a simple interpreter and so the gratification was not instant. Compiling is an extra step and it is not a fun step. In addition (again relying on very faint memory), BASIC had easier string-handling functions built in until FORTRAN77 - and most of us were dealing with strings when we were learning to program.

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
    7. Re:Was FORTRAN really that hard? by Katatsumuri · · Score: 1

      I haven't seen a way to use BASIC- in the way it was originally conceived - in 25 years.

      To be fair, a lot of people were still using VB6 for Windows frontend programming as recently as 10 years ago. Now it looks like it is finally dying off, although I'm pretty sure a lot of legacy projects are still in use.

    8. Re:Was FORTRAN really that hard? by cyber-vandal · · Score: 1

      VB.NET is still very much alive.

    9. Re:Was FORTRAN really that hard? by Bill,+Shooter+of+Bul · · Score: 1

      That's all very useful information, thank you for sharing that. It doesn't change my opinion really as I've worked with early FORTRAN, but its pretty interesting for those that were not aware of that history.

      --
      Well.. maybe. Or Maybe not. But Definitely not sort of.
    10. Re:Was FORTRAN really that hard? by MightyMartian · · Score: 1

      I can't speak to Fortran, having no direct experience with it, but every Cobol program I saw in the youth of my career was interpreted. I administered a multiuser Cobol-based accounting system on a Xenix box in the early 1990s (still probably the best accounting program I've ever seen, BTW), and it was was all i code that ran on a Cobol interpreter. I imagine that for most of Cobol's history the majority of its software has run this way.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    11. Re:Was FORTRAN really that hard? by RabidReindeer · · Score: 5, Informative

      FORTRAN isn't that complex. Originally, it only had 7 statements (or was it 10)? The only halfway complex thing about it was the expression compiler parts.

      But BASIC had several advantages. It was intended for interactive use, at a time when most FORTRANs were batch-only. It originally only supported a very limited set of variable names like "A", "B", "C", and so forth, meaning that you didn't have to implement symbol table logic, and the associated storages on machines when 16K RAM space might be considered at lot - instead the variable name was the hash code to a value table. Refinements such as the rich set of built-in functions and extensive string services were also later additions.

      The original BASIC was so minimalist that even the first effort from Gates &Co. exceeded it. But it introduced a lot of people to "instant gratification" programming, and thus its influence can be felt in many places to this day.

    12. Re:Was FORTRAN really that hard? by OakDragon · · Score: 1

      I'll bet it turns out that real programmers do not program in ANY language, right? ;)

    13. Re:Was FORTRAN really that hard? by AdamColley · · Score: 4, Insightful

      Real programmers toggle in the boot code on the front panel.

    14. Re:Was FORTRAN really that hard? by mwvdlee · · Score: 3, Interesting

      I stopped programming COBOL about 5 years ago, after having professionally used COBOL for about 13 years.
      I've never even encountered a COBOL interpreter; it was all compiled.

      IMHO, interpreted COBOL makes no sense at all; you use COBOL because you want raw performance.
      If performance isn't top priority, you'd be better off using Java, C++ or most other languages.
      Perhaps if you need backwards compatibility for obsoleted hardware running legacy code.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    15. Re:Was FORTRAN really that hard? by Anonymous Coward · · Score: 0

      To be fair, a lot of people were still using VB6 for Windows frontend programming as recently as 10 years ago.

      Or as recently as a couple of hours ago, in my case. Mind you, not that I'm proud of it...

    16. Re:Was FORTRAN really that hard? by hey! · · Score: 4, Informative

      I've actually programmed in Fortran and BASIC way back in the day (late 70s early 80s). From a language point of view early dialects of Fortran (e.g. Fortran IV ca. 1961 and still in widespread use in the 70s) and BASIC were in fact *very* similar. What was different was that Fortran was *compiled* and BASIC was *interpreted*.

      It was common until the mid 1970s for Fortran programmers to physically drop off a deck of punched cards at the operator's window. They'd get their results some hours later, if not the next day, after the operators got around to running the job. Most of the time those results wouldn't the desired computation, but a compilation error. So to be productive in Fortran you had to think about your *entire* problem in advance, carefully preparing your deck to get as much as possible correct before handing the job off.

      BASIC was an interpreted language initially. That meant you to type in little snippets of your program, even individual expressions, to see how or if they did what was expected. If you typed in a program and there was a syntax error, you'd know as soon as you hit "return". This allowed a more exploratory approach to programming and learning to program. Of course, you could get the *same* interactive experience in a much more sophisticated language by using Lisp.

      I started programming in C in the 1980s, and this use-style distinction between compilation and interpretation remained. A full compile and link of our modest application took something like 30 minutes on the minicomputer we were using, which had a clock speed in the single digit MHz range. So we prepared our source changes *very* carefully, and used our down time to read the full 8 volume Unix manual from cover to cover, over and over again. There was something to be said for such an approach to programming, but it was not for the faint hearted.

      By the 90s this had changed. Compilers were orders of magnitude faster; you'd actually hit "compile" and *watch* the compiler do its thing. A decade earlier that would have been like watching paint dry. Editors became syntax-aware too, and debuggers went from requiring mad voodoo skills to being interactive and usable by ordinary mortals. So now compilation vs. interpretation is a packaging and runtime issue; there's not much to choose between them with respect to how *hard* a language is to use. Naturally someone who cut their teeth in the modern era look at BASIC and Fortran as they were in the 60s and wonders what the big deal was. But it *was* a big deal, at least for people who weren't going to learn Lisp.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    17. Re:Was FORTRAN really that hard? by harrkev · · Score: 0

      I agree completely. RTFA. It shows a snipped of Fortran code -- ugly. I cut my teeth on BASIC with a Commodore VIC-20, and, in a way, I still miss it.

      Right now I have to bounce around between multiple languages: Verilog, C, TCL, and PERL. I always have trouble remembering exactly how to do a "for" loop in each of these languages. Do you surround the arguments with curly brackets (TCL) or parenthesis (the rest). Do you use commas or semicolons between the arguments? Which languages use "else if" and which ones use "elsif"? Bouncing around between languages sometimes leaves me scrambling to remember exactly how to do something in a particular language.

      It has been DECADES since I used BASIC, but I bet that I could still make a pretty good go of making a working program without having to look anything up. The language was simply that easy to learn. Of course, it was not object-oriented and too many "goto"s could kill you. But for simple programs, it could not be beat.

      --
      "-1 Troll" is the apparently the same as "-1 I disagree with you."
    18. Re:Was FORTRAN really that hard? by Anonymous Coward · · Score: 1

      Wow, you think every person reading this doesn't already know that? This is Slashdot after all.

      Since Dice Holdings took over /. I've begun wondering about the intelligence level of the typical /.'er these days. Explaining the line number orientation of BASIC is not necessarily a bad idea given the lack of historical computing knowledge among the youth of today. Imagine if they had to endure dial-up MODEMs and AT commands and the squeals of the MODEMs as they negotiated a communication speed and bit parity. Many of us wrote terminal emulators in interpeted BASIC and they worked very well; even BBS software was typically written in BASIC.

    19. Re:Was FORTRAN really that hard? by Anonymous Coward · · Score: 0

      Classic VB ASP still lives, sadly. Just a few months ago I had to add new features to a project started in 2007. Just for reference, the last major update for classic ASP was in 2000.

    20. Re:Was FORTRAN really that hard? by jellomizer · · Score: 1

      Are you sure...
      Collage Age Geeks: 18-24 Were born in the 1990's! When they were old enough to start doing geeky stuff with the computer we are well in the late 90's and early 2000's. There is a new generation of "Kids" out there who never had to experience the world pre-GUI, with 5 1/2 or bigger sized floppy disks, or without high speed internet.
      The actual kids today who are able to start doing more then basic stuff with the computer, doesn't comprehend a world without internet connectivity will cellphones, or Monitors that more then a few inches thick.

      For people who have used BASIC in its primary sense are at least 30 years old now.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    21. Re:Was FORTRAN really that hard? by walterbyrd · · Score: 1

      > I always found BASIC to be far more irritating to program in anything more than trivial applications.

      Which version? It makes a huge difference.

      Sadly, many people think of BASIC as the early Apple, and MS, BASIC. Far better versions of BASIC have been available, for decades now.

    22. Re:Was FORTRAN really that hard? by Chris+Mattern · · Score: 1

      FORTRAN at the time had string handling capabilities that sucked so bad, they caused local black holes. Not a problem for techies solving differential equations, but somewhat more of a problem for business and hobbyists (the latter of whom often fancied imaginative string handling to create the illusion that the computer was actually holding a conversation).

    23. Re: Was FORTRAN really that hard? by cyber-vandal · · Score: 1

      Yeah we've still got a few of them too. They work and rarely need any changes so they'll probably last a few more years. Server 2012 supports it so it's not going away quietly.

    24. Re:Was FORTRAN really that hard? by Darinbob · · Score: 1

      BASIC really took off when it was ported to microcomputers. On a minicomputer like at Dartmouth it was just one of many languages, and wasn't even the only interpreted language. However most languages were still rapidly evolving at the time and there was a lot more experimenting going on. The intent of BASIC though really was to be a "beginner's" language, for the undergraduates rather than grad students. At the same time it was introduced when time sharing was brand new, so the idea of interacting directly with the computer while programming on it was also new (though Lisp 1.5 over at MIT was in use at the time). At the time of BASIC, Fortran was more of a process of submitting punch cards to an operator then retrieving the results some time later.

      Although in perspective it really caused a lot of problems in that students who knew BASIC before entering a university usually had lots of bad habits that needed to be removed. But nobody had really come up with the concepts of what good programming style was, and structured programming as a concept arrived after BASIC.

    25. Re:Was FORTRAN really that hard? by Anonymous Coward · · Score: 0

      Collage Age Geeks: 18-24

      Most people get bored with cutting and gluing when they're between 6 and 8.

    26. Re:Was FORTRAN really that hard? by mattack2 · · Score: 1

      Sadly? Happily.

      I still think I could probably whip out VERY simple scripts in BASIC faster than in either shell script or Python. Once in a while I want to just do a LEFT$() or MID$() kind of thing really easily. (Yeah, I know, there's probably going to be a million responses of how to do that in Python.. I just mean that I already know the syntax for BASIC.)

    27. Re:Was FORTRAN really that hard? by mattack2 · · Score: 1

      That is, you had to do things like start all statements in column 7 or later, because the first 6 columns had other meaning.

      So something else as annoying as Python.

      (I *like* Python, despite hating indent==scope with the fire of a thousand suns.)

    28. Re:Was FORTRAN really that hard? by mattack2 · · Score: 1

      BASIC was an interpreted language initially. That meant you to type in little snippets of your program, even individual expressions, to see how or if they did what was expected. If you typed in a program and there was a syntax error, you'd know as soon as you hit "return".

      Don't you really mean when you hit RUN?

      Or do you mean people would literally type individual lines at the prompt one by one, instead of lines with line #s? (Sort of like how you CAN type Python lines directly at the interpreter prompt, but I don't.)

      Yes, I'm asking this from the perspective of a MS-based BASIC (AppleSoft, PET, etc.)

    29. Re:Was FORTRAN really that hard? by decsnake · · Score: 1

      It wasn't so much that BASIC was all that much simpler than FORTRAN. Rather that to run a FORTRAN program required mastering not just a little FORTRAN, but also JCL (or the UNIVAC equivalent) and the keypunch. Using BASIC was an interactive experience. The job control and editing functions (as primitive as they were) were built into the language. // EXEC VSF2CG //FORT.SYSIN DD *

    30. Re:Was FORTRAN really that hard? by Anonymous Coward · · Score: 0

      Even the FORTRAN II program seems pretty easy to read:

      http://en.wikipedia.org/wiki/Fortran_IV#Simple_FORTRAN_II_program

    31. Re:Was FORTRAN really that hard? by pepsikid · · Score: 1

      First of all, you don't "hit RUN". You type "run" and hit "enter". If your keyboard had a big, red "RUN" key, it probably just locked up the computer. :D

      Now, some versions of BASIC would evaluate each line of code you'd just input for obvious errors as soon as you hit enter to save it. It would work whether you had preceded the code with a line number or not. It would try to tell you what kind of error it thought it saw. If you had multiple syntax errors, it might frustrate the fark out of you by responding with the same error even though you'd retyped or edited the line to fix one of them. Some of them would just flash $ERR?$ or something useless at you instead.

    32. Re:Was FORTRAN really that hard? by Anonymous Coward · · Score: 0

      SPOILER!

    33. Re:Was FORTRAN really that hard? by MoreThanThen · · Score: 1

      "processed the stuff better then the procedure"

      SYNTAX ERROR

    34. Re:Was FORTRAN really that hard? by MoreThanThen · · Score: 1

      "more then"

      SYNTAX ERROR!

    35. Re:Was FORTRAN really that hard? by UnknownSoldier · · Score: 1

      > There isn't really a good starting language anymore.

      Javascript is the modern Basic.

      Hear me out please ... !

      I grew up on an Apple ][ learning Basic and then moved quickly into disassembling Applesoft Basic to see how it worked at the 6502 assembly language level. Fast foward ... after using C/C++ for ~25 years (learnt C++ back in 1990), finding Objective-C to be interesting, ironically, I'm finding Javascript of all things to be the "modern Basic"

      - Javascript is available everywhere since everybody has a web browser
      - Since it is interpreted you can use the Console and get immediate temporary results
      - You don't a fancy IDE, just a basic text editor; hell even Notepad will do the job! (Though use Notepad++ or gVim for syntax highlighting)
      - While it has a few completely idiotic & retarded design, for the most part, it is a OK multi-paradigm language: Procedural, Functional, or OOP. Pick your poison.
      - Javascript debuggers cover the basics. The only thing the debuggers really suck at is being able to move the "Program Counter". That is, set another statement as the "next-statement-to-be-executed". Which leads to
      - printf, er, console.log() debugging -- which helps to encourage programmers to actually _think_ about the problem at a higher level.
      - With it's C-style syntax I find I'm not fighting the language like I do with other languages.
      - http://www.w3schools.com/ has some great tutorials that focus on the the _one_ command you are interested in

      Yes, Javascript is a real shitty designed language in places (the "use strict' hack, lack of proper types, automatic semicolon insertion, etc.) But is "good enough" language. I can't think of another language that is "convenient' or "accessible" as Javascript. Can you?

      For better or worse, Javascript has enough "basic" features and it has enough advanced features that is a OK languag. A student won't outgrow it for a while. By then they will be ready to move onto proper compiled languages. ;-)

  3. Thank you Kemeny and Kurtz. by DiscountBorg(TM) · · Score: 5, Funny

    I grew up with a little TRS-80 on which you had to learn BASIC to so much as load a file. In Grade Three I was learning things like coordinate geometry and algebra, while my peers were struggling with their multiplication tables. I remember when my peers were introduced to algebra for the first time, some of them had difficulty understanding how x could be a number, while I was busy making adventure games at home.
    Thanks to this head start in life, I now have a job in IT. BASIC gave me a great head start in computer literacy!

    --
    "The single biggest problem in communication is the illusion that it has taken place." George Bernard Shaw
    1. Re:Thank you Kemeny and Kurtz. by DiscountBorg(TM) · · Score: 4, Insightful

      I wouldn't contend for an instant that the kids I grew up around were 'retards'. 8-year-olds can't magically know things without experience.

      How many kids have the chance to sit down in front of a computer and learn that the reason a ball goes across the screen comes down to something as simple as x=x+1? Schools won't teach them that until the end of primary.

      BASIC does probably teach some bad programming habits but at the same time it's accessible to an 8-year-old, and you're learning concepts that are applicable for life: file management, how to store and retrieve data, syntax, etc etc. If the goal is to introduce kids to ehmm.. basic computing concepts, it worked admirably.

      Compare to someone with no knowledge of programming concepts at all whatsoever trying to grasp how to call a function for the first time in their life.

      --
      "The single biggest problem in communication is the illusion that it has taken place." George Bernard Shaw
    2. Re:Thank you Kemeny and Kurtz. by bluefoxlucid · · Score: 2, Funny

      It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

    3. Re:Thank you Kemeny and Kurtz. by Anonymous Coward · · Score: 0

      You got modded funny, but there is serious truth in this.

      In my case it was a Dragon 32 (a TRS-80 knockoff). I was ridiculously ahead of the game when we got to algebra in school. To a lesser extent, I also got matrices pretty quick too.

      Programming actually seems an apt way to learn these concepts, because it gives you an actual valid purpose in them, rather than just trying to solve some problem because you've been asked to.

      "I need to figure out where this ball is going to be on the x asis by adding 1 to it's current position"

    4. Re:Thank you Kemeny and Kurtz. by NoNonAlphaCharsHere · · Score: 1

      Thanks. I was waiting for a Considered Harmful joke.

    5. Re:Thank you Kemeny and Kurtz. by coolsnowmen · · Score: 1

      I'll bite. Grading curves. Bad teachers [ or rather, bad test writters] grade on a curve so they are sure to get atleast a certain bell curve of A's, B's, and C's. So, if you are surrounded by idiots as early as middle school, you'll get better grades. Then, because of quota's, you'll get in to a magnet school, which will have better teachers, and more interesting classes, and smaller class sizes. That is a recipe for sucess [ for someone like me anyways].

    6. Re:Thank you Kemeny and Kurtz. by Anonymous Coward · · Score: 0

      > I wouldn't contend for an instant that the kids I grew up around were 'retards'. 8-year-olds can't magically know things without experience.

      What about at Hogwarts?

    7. Re:Thank you Kemeny and Kurtz. by jellomizer · · Score: 1

      That isn't true.
      The CS 101 Class should have components about following up structure. Give assignments where the students may need to build off their code, if they start doing it the BASIC Way make assignments that shows how much harder it is to maintain over time. I went into CS with a Strong knowledge in BASIC, it was actually very helpful. As the other students were struggling with Loops and getting the darn thing to work, I was focusing more on trying to follow the guidelines for style and seeing if there is way I could make it better.
      Sure I got the talking to when in a lecture I brought up using a GOTO to solve a problem. However that was about it.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    8. Re:Thank you Kemeny and Kurtz. by DiscountBorg(TM) · · Score: 2

      Yes, and then from there it's really easy to understand how to calculate things like velocity and gravity, and understand vectors. If I ever have a kid, I'd totally want to get them learning some form of basic coding at an early age. Nowadays it doesn't have to be BASIC, it could just as easily be LUA There's so many useful/abstract concepts you pick up naturally while figuring out these things even outside of basic computing.

      --
      "The single biggest problem in communication is the illusion that it has taken place." George Bernard Shaw
    9. Re:Thank you Kemeny and Kurtz. by Anonymous Coward · · Score: 0

      Oh, bullshit.

    10. Re:Thank you Kemeny and Kurtz. by DiscountBorg(TM) · · Score: 4, Interesting

      I agree, but this is actually an old tongue in cheek essay, in context it makes more sense perhaps:

      "FORTRAN --"the infantile disorder"--, by now nearly 20 years old, is hopelessly inadequate for whatever computer application you have in mind today: it is now too clumsy, too risky, and too expensive to use.
      PL/I --"the fatal disease"-- belongs more to the problem set than to the solution set.
      It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.
      The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence.
      APL is a mistake, carried through to perfection. It is the language of the future for the programming techniques of the past: it creates a new generation of coding bums."

      http://www.cs.virginia.edu/~ev...

      --
      "The single biggest problem in communication is the illusion that it has taken place." George Bernard Shaw
    11. Re:Thank you Kemeny and Kurtz. by jeffb+(2.718) · · Score: 2

      It's different when you cover algebra before you hit programming.

      Algebra teacher: "X + 1 = 2X. Subtract X from both sides. X = 1."

      Me: "OK"

      BASIC program: "X = X + 1"

      Me: "No, it isn't!"

      Me, years later, in a class using Prolog: "X = X + 1"

      Prolog interpreter: "No, it isn't!"

    12. Re:Thank you Kemeny and Kurtz. by ArhcAngel · · Score: 1

      BASIC does probably teach some bad programming habits

      You're telling me. I nearly failed the first semester of my C++ course in college because I couldn't stop using GoTo!

      --
      "A person is smart. People are dumb, panicky dangerous animals and you know it." - K
    13. Re:Thank you Kemeny and Kurtz. by MightyMartian · · Score: 2

      I learned to program on 8 bit computers (Tandy and Commodore), all of which were running BASIC interpreters, and I had no problem moving on structured programming like Pascal, and ultimately OOP languages like Java.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    14. Re:Thank you Kemeny and Kurtz. by narcc · · Score: 2

      This baffles me. If you compare BASIC to any assembly, you'll find that they're not that different, as far as how you structure your programs.

      Does assembly teach "bad programming habits"?

      I'm going to call this particular meme "nonsense" until such time as someone can offer up a decent argument.

       

    15. Re:Thank you Kemeny and Kurtz. by maestroX · · Score: 1

      BASIC does probably teach some bad programming habits but at the same time it's accessible to an 8-year-old, and you're learning concepts that are applicable for life: file management, how to store and retrieve data, syntax, etc etc.

      Also access to source code; before BBS about the only tutorial/learning docs available.

    16. Re:Thank you Kemeny and Kurtz. by Anonymous Coward · · Score: 0

      It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

      You're a idiot!

      I learned programming with BASIC as the first language, progressed to 6502 assembly language within six months, moved on a a variety of other languages (FORTRAN77, C, PROLOG) before university and passed the computer science entrance test allowing me to take the advanced first-year introductory computer programming course (WATFIV) instead of the regular introductory course (Pascal). The bubble sort was on the test; I had read about it in a computer magazine weeks earlier and implemented it in BASIC prior to the test not knowing it would appear there. Hell I miss the 1980s.

    17. Re:Thank you Kemeny and Kurtz. by NoNonAlphaCharsHere · · Score: 0

      It's really stunning how many programmers don't know their heritage - including the idiot who modded GP "troll". GP is a famous direct quote from Edsger Dijkstra.

    18. Re:Thank you Kemeny and Kurtz. by Sarten-X · · Score: 1

      Sure I got the talking to when in a lecture I brought up using a GOTO to solve a problem. However that was about it.

      Crappy professor.

      GOTO is a perfectly reasonable solution for a very small set of problems. Dijkstra's famous essay has a less-famous rebuttal (that I'm far too lazy to find at the moment), with which Dijkstra agreed: Code should be readable first, well-formed second, and functional third.

      Using a GOTO is usually only functional. It doesn't preserve the structure of the code like the two ends of a loop, and being one-ended, it's not easily followed when reading. Other mechanisms are usually better.

      However, in the case of a 1% chance of re-running a section, or several long sets of conditions to trigger a block, I find that a GOTO is the most readable tool, and it preserves the most-used structure of the code as well. It's a tool, and like any other it should be used only where appropriate.

      --
      You do not have a moral or legal right to do absolutely anything you want.
    19. Re:Thank you Kemeny and Kurtz. by UnknownSoldier · · Score: 1

      /sarcm Riiiiiight, because programmers "never" dissect and disassemble Basic to see how it was implemented, learning such topics as Taylor Series,Horner's Evaluation for Polynomials, learning how to use memory-mapped IO, to learn how parsers work, or any other advanced topic in interpreters.

      Guess what, a great programmer is STILL great in-spite of or independent of brain-dead languages, such as Basic or Javascript. At the time Basic freed programmers from the mundane and tediousness of assembly language. It allowed non-programmers to dabble with programming.

      * http://www.txbobsc.com/scsc/sc...
      * http://en.wikipedia.org/wiki/H...
      * http://en.wikipedia.org/wiki/T...
      * http://en.wikipedia.org/wiki/I...

    20. Re:Thank you Kemeny and Kurtz. by z80man · · Score: 3, Insightful

      Every processor I've ever used has a "JUMP" op-code, synonomous to the "GOTO" statement. If its good enough for the processors machine code, its good enough for me :-)

    21. Re:Thank you Kemeny and Kurtz. by Teresita · · Score: 1

      Does assembly teach "bad programming habits"? JMP looks like GOTO, smells like GOTO, it's GOTO.

    22. Re:Thank you Kemeny and Kurtz. by narcc · · Score: 2

      GOTO isn't inherently evil. I'd go as far to say that the GOTO hate is little more than religious propaganda.

      It's used in the Linux kernel. There's even a famous post by Linus defending it. He's not alone. Do a quick google search. The results may surprise you.

    23. Re:Thank you Kemeny and Kurtz. by RR · · Score: 0

      How many kids have the chance to sit down in front of a computer and learn that the reason a ball goes across the screen comes down to something as simple as x=x+1? Schools won't teach them that until the end of primary.

      Ugh. Wow. I hope primary schools never teach x=x+1.

      In the computer industry, we've probably been set back by years or even decades by BASIC and imperative programming. Imperative programming makes intuitive sense because computers process things step by step, and that's what's exposed in imperative languages, but concurrency will be the downfall of imperative programming.

      Personally, I think BASIC helped me in primary school maths, but it drove me away from being a programmer. It's challenging enough to do things in BASIC, but the step-by-step flow is clearly there. Then I looked at C and C++, and the pages of keywords and data types, and the need to buy a compiler to get anything to work, and it was no fun. And then I looked at event-based systems, like the Macintosh, and Where is the first step? How does defining a function just make things happen? Why is this nothing like the C/C++ books? It's so confusing and I quit. I only got back into programming because I took a music class from David Cope, and he taught LISP, and I was like, Woah, there's an entirely different way of programming, and it's more like math.

      So, it's thoroughly discouraging to see Codeacademy, and the first thing they're doing is sequential, imperative programming, with output via console.log() and blocking function calls to alert() and prompt(), and I'm internally screaming. This is so wrong. This is not how we're going to train programmers for concurrent systems.

      --
      Have a nice time.
    24. Re:Thank you Kemeny and Kurtz. by HornWumpus · · Score: 1

      Your looking at it wrong. JMP looks like { the target looks like }

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    25. Re:Thank you Kemeny and Kurtz. by Anonymous Coward · · Score: 0

      LISP has all of the same problems as any other imperative language, with the added drawback of awful syntax.

      (setq RR 'wrong-about-lisp)

    26. Re:Thank you Kemeny and Kurtz. by Anonymous Coward · · Score: 0

      I don't think it's so much that GOTO itself is harmful, but it enables programmers to shoot themselves in the foot more easily by losing track of flow of control. Structured programming is good because it automates some of that flow.

      I used to describe it to classmates this way: structured programming is like laying train tracks, and switching trains among them. GOTO is like getting into an off-road vehicle instead. :)

    27. Re:Thank you Kemeny and Kurtz. by hawk · · Score: 1

      For some of us, "structured programming" was natural.

      I'm of the generation that learned to code by cheating at star trek games.

      However, from the beginning, my BASIC-80 looked more like Fortran 90. Having learned early about the search through memory of primitive microcomputer BASIC lead to through about where what routine should be, so setup was at line 50k+, main loop at line 1xxx, and so forth. Frequently a large program lacked any GOTO, or had just one to put you in the right section of memory. (Years later, though, on my dissertation, I realized that I was maintaining parallel blocks of code to avoid a GOTO, and I put one in. It's like the passive voice: "avoid", not "never use")

      hawk

    28. Re:Thank you Kemeny and Kurtz. by UnknownSoldier · · Score: 1

      Dijkstra was also the idiot who once claimed "Go To Statement Considered Harmful"

      Gee, _how_ is every function call, for, while, do, AND if expression constructed at the assembly level? Via a (un)conditional jump.

      There is a time and a place to use a radial arm saw, just as there is a time and a place to use a hand planner. Only an idiot tries to ban "dangerous" tools because other idiots don't know how to use them _safely_.

      At the time, goto's encouraged "Spaghetti code". The solution was NOT to ban goto, BUT to teach people how to properly write structured code. Also, IF the language didn't provide proper flow control then the language was brain-dead.

      THAT is why the OP got down-voted. For repeating a archaic meme that doesn't explain the context, nor list the reasons for why it is "not even wrong."

      * "Considered Harmful" http://en.wikipedia.org/wiki/C...
      * "Spaghettie Code" http://en.wikipedia.org/wiki/S...
      * "How do we tell truths that might hurt?" http://www.cs.virginia.edu/~ev...

    29. Re:Thank you Kemeny and Kurtz. by Anonymous Coward · · Score: 0

      Tru dat. Fuck the goto haters!

    30. Re:Thank you Kemeny and Kurtz. by Anonymous Coward · · Score: 0

      Dijkstra was also the idiot who once claimed "Go To Statement Considered Harmful"

      Gee, _how_ is every function call, for, while, do, AND if expression constructed at the assembly level? Via a (un)conditional jump.

      Please stop being stupid. First, it does not matter how assembly works, we're talking about high level languages here, and the whole point of writing code in a HLL instead of assembly is to escape from drudgery like hand-constructing all control flow as jumps. Second, Dijkstra was not the absolutist you're trying to make him into. His famous essay was a call-to-arms against an extreme practice (by HLL standards) where virtually all control flow was accomplished with GOTO, or the moral equivalent thereof.

      In other words, he was talking about BASIC as it existed at that time. Every line of code was identified with a unique line number (address), and the language provided no method of altering control flow other than jumping to one of these unique line numbers. Even the IF-THEN constructs were forms of GOTO.

      Which is where his snarky comment about BASIC came from. BASIC, in its early form, arguably was that damaging to the minds of new programmers, assuming that your goal was to teach them how to code effectively in a real high level language.

  4. w00t by slashmydots · · Score: 1

    The first programming language I ever saw was when I was like 10. It was an exact rip of BASIC but used to control AI bugs that would fight each other and negotiate a grid. You could equip scanners and weapons and stuff but then you had to code the actions in a giant decision tree based on conditions and loops. I thought it was awesome! Now I'm a software programmer professionally.

    1. Re:w00t by Anonymous Coward · · Score: 0

      (Posting as AC because I modded this thread)

      Robot War for the Apple II? http://en.wikipedia.org/wiki/R...

    2. Re:w00t by slashmydots · · Score: 1

      I believe it was called "AI Bug" and it was for Windows 98 and XP :-D

  5. Happy Birthday by Captain+Emerald · · Score: 5, Funny

    10 PRINT "Happy Birthday, Basic"
    20 GOTO 10

    1. Re:Happy Birthday by Anonymous Coward · · Score: 0

      Endless loop, bad programming! You have shamed BASIC for the last time!

    2. Re: Happy Birthday by Anonymous Coward · · Score: 0

      Which, coincidentally, was also the first BASIC program :-)

    3. Re:Happy Birthday by mod+prime · · Score: 2

      This is not bad programming, this is the most common Use Case.
      When I was programming BASIC this was equivalent to

      while Break not pressed:
        print 'whatever'
      exit program

    4. Re:Happy Birthday by Toad-san · · Score: 1

      Throw in a counting loop (1 to 50 .. or 0 to 49 if you wish), just to show off your l33t skills.
      Make it 0.0 to 49.0 if you want to test your math coprocessor at the same time :-)

    5. Re:Happy Birthday by Anonymous Coward · · Score: 1

      This is not bad programming, this is the most common Use Case.
      When I was programming BASIC this was equivalent to

      while Break not pressed:

        print 'whatever'
      exit program

      While you are correct, it was very bad programming. In my day it would have gotten you at least a stern talking to...

      (Hint: don't think CRT think continuous roll of paper attached to a teletype!)

      Now, Get off my lawn!

    6. Re:Happy Birthday by Anonymous Coward · · Score: 0

      5 REM 1337 SKILLS VERSION
      10 FOR I=1 TO 50
      20 PRINT TAB(INT(I/10));"HAPPY BIRTHDAY BASIC!"
      30 NEXT I

    7. Re:Happy Birthday by Anonymous Coward · · Score: 0

      It has to be all caps. it makes the code flow better.

    8. Re:Happy Birthday by Anonymous Coward · · Score: 0

      While you are correct, it was very bad programming. In my day it would have gotten you at least a stern talking to...

      (Hint: don't think CRT think continuous roll of paper attached to a teletype!)

      Now, Get off my lawn!

      You deserved a stern reprimand for wasting precious outhouse supplies. LOL Sorry I couldn't resist the temptation. Bart made me do it.

    9. Re:Happy Birthday by OhSoLaMeow · · Score: 1

      Endless loop, bad programming! You have shamed BASIC for the last time!

      10 PRINT "Whoosh!"
      20 GOTO 10

      --
      They can take my LifeAlert pendant when they pry it from my cold dead fingers.
    10. Re:Happy Birthday by Anonymous Coward · · Score: 0

      10 CLS
      20 Let X=1
      30 PRINT "Happy Birthday, Basic"
      40 Let x=x+1
      50 if x>50 then goto 70
      60 goto 20
      70 end

    11. Re:Happy Birthday by pepsikid · · Score: 1

      Purists will LOVE this:

      0 cls:forx=1964to2014:?"Happy Birthday, Basic":nextx
      run

      LBASIC was very easygoing about spacing and is probably the reasonicanstilleasilyreadsentenceswithoutspaces.

      The feature only failed me under one circumstance as in; 100 letcall="5982341000":ifphone<>callprint"They Don't Match!" because since "phone" would never match "cal", it would always cause "They Don't Match!" to unexpectedly come out on the line printer, scaring the shit out of ya in the process.

    12. Re:Happy Birthday by Captain+Emerald · · Score: 1

      And yes. The endless loop was intentional. Therefore is that not bad programming. Just programming to meet the original project requirements.

  6. basic by Anonymous Coward · · Score: 0

    all this time I thought Bill gates created Beginner's All-purpose Symbolic Instruction Code. Thanks for sharing the link. Wonder what the GUI/IDE was like for typing BASIC and the interface. Will need to look for some screenshots. Or maybe I am thinking of QBasic that had a GUI.

    1. Re:basic by AlecC · · Score: 1

      I don't think there was a GUI, because the standard interface then was the ASR-33 teletype. That was certainly what I was using in the early 70s. I first came across CRT terminals in about 1979 - though my employer 75-78 was a bit sluggish, so they would have been around before that. But they were stil character oriented displays - 24x80 usually - and it was not until the early 80s I saw genuine pixel mapped displays on which one could have a real GUI.,

      --
      Consciousness is an illusion caused by an excess of self consciousness.
  7. I grew up writing games in BASIC by Anonymous Coward · · Score: 0

    Those were the days when you didn't need much more than a text editor to make a game.

    1. Re:I grew up writing games in BASIC by RailGunner · · Score: 1

      You never need more than a text editor to write code. Now get off my lawn.

    2. Re:I grew up writing games in BASIC by ArcadeMan · · Score: 1

      I write code with an hexadecimal editor. Now get off my lawn.

    3. Re:I grew up writing games in BASIC by Anonymous Coward · · Score: 0

      Bah! I punch in machine code using the toggle switches on the console of my PDP-8... That's real programming!!!

    4. Re:I grew up writing games in BASIC by Anonymous Coward · · Score: 0

      Got you, you fake! Real olde timers programmed in octal as hex hadn't been invented yet!

    5. Re:I grew up writing games in BASIC by Karlt1 · · Score: 1, Informative

      You never need more than a text editor to write code. Now get off my lawn.

      You had a text editor? Wimp.

      Real programmers didn't have editors. If we wanted to change a line in an Applesoft Basic program we either had to type it over or 'List' the line press ESC and up arrow to the line.

    6. Re:I grew up writing games in BASIC by RailGunner · · Score: 1

      107 157 040 106 165 143 153 040 131 157 165 162 163 145 154 146 056 :)

    7. Re:I grew up writing games in BASIC by ejasons · · Score: 1

      Real programmers didn't have editors. If we wanted to change a line in an Applesoft Basic program we either had to type it over or 'List' the line press ESC and up arrow to the line.

      The latter of which is, of course, an editor...

      Though, unless you first wet your screen width to 33 characters (poke 33,33, IIRC), any edited wrapped lines would include the seven extra characters that the system added in order to pretty-print the source.

      God help me for remembering all of this...

    8. Re:I grew up writing games in BASIC by HornWumpus · · Score: 1

      Nearest thing kids today can do is: copy con: myprog.exe

      Then enter the program with Alt-keypad.

      Klingon programming.

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    9. Re:I grew up writing games in BASIC by HornWumpus · · Score: 1

      Luxury.

      We used to dream of having up arrows.

      Anybody else remember 'The Prisoner' on the Apple, you had to use the up arrow control keys to complete the clone shop IIRC.

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    10. Re:I grew up writing games in BASIC by gmhowell · · Score: 1

      Real programmers didn't have editors. If we wanted to change a line in an Applesoft Basic program we either had to type it over or 'List' the line press ESC and up arrow to the line.

      Don't forget to correct for the stupid margins.

      --
      Jesus was all right but his disciples were thick and ordinary. -John Lennon
    11. Re:I grew up writing games in BASIC by UnknownSoldier · · Score: 1

      The one by Edu-Ware? /DonsFlameSuit: Thought Prisoner 2 was better. ;-)

      Still never completed that game! Had more fun hacking the 6502 parsing code and finding out all the commands, dissecting the AppleSoft Basic code, then playing the game!

      * http://en.wikipedia.org/wiki/T...

    12. Re:I grew up writing games in BASIC by Anonymous Coward · · Score: 0

      Yet another 1 line fart reply from gmhowell the literary genius (not).

  8. I liked BBC Basic. And Q(uick)Basic. by serviscope_minor · · Score: 3, Funny

    The BBC Model B equipped with BBC BASIC was released in 1981. As well as the usual litany of BASIC like features (i.e. goto), it had proper named procedures and functions with local variables, which allowed structured programming. It didn't have proper block structured if though.

    It also had dynamic memory allocation and pointer indirection (not that wretched peek and poke stuff).

    It was still tied to line numbers though, but in practive you (a) didn't need them except for computed goto and jump tables and (b) it had a proper renumbering command if you needed to insert space which corrected all the gotos, gosubs and jump tables (but not obviously computed goto).

    It had a 5 byte floating point system build in too, which while slow was pretty decent.

    Was quite powerful. It also had graphics and sound built in, which made it very nice to play with.

    And then I graduated on to QB when I switched to a PC. Mostly QBasic then a pirated version of QuickBasic. Actually my dad was very against piracy but relented when we phoned a Microsoft sales office and they denied all knowledge of such a product and tried to hawk us an early version of Visual Basic.

    QBasic was a fantastic system, especially given it was free with PCs, and I challenge anyone to claim otherwise with good justification.

    --
    SJW n. One who posts facts.
    1. Re:I liked BBC Basic. And Q(uick)Basic. by Jahta · · Score: 2

      The BBC Model B equipped with BBC BASIC was released in 1981. As well as the usual litany of BASIC like features (i.e. goto), it had proper named procedures and functions with local variables, which allowed structured programming. It didn't have proper block structured if though.

      Yes indeed. I initially learned to program on a BBC, and I learned a number of good habits in the process.

    2. Re:I liked BBC Basic. And Q(uick)Basic. by AdamColley · · Score: 2

      You both forgot to mention the BBC had a built in 6502 multipass assembler.

      So unlike my spectrum I didn't have to reload the assembler every time I made an error and my code stomped all over ram.

      Additionally, you had direct access to OS routines from basic, OSBYTE, OSWORD, OSCLI etc.

      The BBC was and still is far ahead of anything else as a teaching machine. Simple enough to understand, complex enough to be useful and enough I/O to put a pi with gertboard to shame even today.

    3. Re:I liked BBC Basic. And Q(uick)Basic. by serviscope_minor · · Score: 2

      You're absoloutely correct. It did have those and it was awesome. It meant you could freely mix ASM and BASIC code. Handy so one could do inner loops in ASM and the more complex outer logic in basic without sacraficing anything. I seem to remember that the special variables A%, X% and Y% would be used to set the A, X and Y registers on entry and be set back on exit for easy communication.

      --
      SJW n. One who posts facts.
    4. Re:I liked BBC Basic. And Q(uick)Basic. by Jahta · · Score: 2

      You both forgot to mention the BBC had a built in 6502 multipass assembler.

      So unlike my spectrum I didn't have to reload the assembler every time I made an error and my code stomped all over ram.

      Additionally, you had direct access to OS routines from basic, OSBYTE, OSWORD, OSCLI etc.

      The BBC was and still is far ahead of anything else as a teaching machine. Simple enough to understand, complex enough to be useful and enough I/O to put a pi with gertboard to shame even today.

      Good point. The built-in assembler was excellent too. The whole BBC Micro project was designed educate people about the computer as a powerful tool they could use, and not just a games machine. And, as you say, they did a damn good job.

  9. DND in BASIC by null+etc. · · Score: 3, Funny

    Richard Garriott (of Ultima fame) is running an interesting challenge to port his very first RPG computer game, written in BASIC on a teletype connected to a PDP-11, into a web-friendly or Unity version. https://www.shroudoftheavatar....

    1. Re:DND in BASIC by Anonymous Coward · · Score: 0

      Richard Garriott (of Ultima fame) is running an interesting challenge to port his very first RPG computer game, written in BASIC on a teletype connected to a PDP-11, into a web-friendly or Unity version. https://www.shroudoftheavatar....

      I've put up a C port here (possibly with still some bugs in there):
      http://ringbreak.dnd.utwente.nl/~mrjb/dnd/

      To me, the main issue with a JavaScript version is to get user input in a command-line style interface without bogging down the CPU, since JavaScript isn't very good at waiting. Especially when one function calls another, a sleep() function would've been so much cleaner than trying to accomplish the same with setTimeout. setTimeout forces you to split up functions in "Anything up to input" and "Everything after input" - and this breaks the return statement in functions "after input" which now merely return to the callback. It's BASICally back to spaghetti-style GOTO all over again.

  10. BASIC is where I began by Neruocomp · · Score: 0

    I remember my first computer, an Intel 486 Packard Bell way back in the early 90s. Windows 3.11 and DOS. I learned by pushing every button, even sometimes breaking the computer, but making sure I fixed it. Then I found BASIC buried in there and started playing with programming. I had no books to learn from, didn't even know where to begin on something like that but I learned through trial and error. It really came in handy as a calculator to check my homework against. I have fond memories with gorillas throwing nuclear bananas. I'm now a Linux sysadmin specializing in HPC clusters.

    --
    Physics is like sex. Sure, it may give some practical results, but that's not why we do it
    1. Re:BASIC is where I began by Anonymous Coward · · Score: 0

      II have fond memories with gorillas throwing nuclear bananas. I'm now a Linux sysadmin specializing in HPC clusters.

      Speaking of gorillas throwing nuclear bananas... Have you sudo rm -Rf / today?

  11. Re:In 3, 2, 1... by NapalmV · · Score: 2, Informative

    The truth about C:

    https://www.gnu.org/fun/jokes/...

    Now seriously. Pascal was published some 2 years before Kernighan and Ritchie released their masterpiece. Having the opportunity to have a long look at Pascal and yet coming up with something like C shows a very strong character.

  12. No, it wasn't. by Baldrson · · Score: 2

    If IBM had gone to Chuck Moore instead of Bill Gates (or rather, his mom) for their 4.77MHz 8088 PC, your title might have been "50 years of FORTH, the Language That Made Computers Personal".

    But, then again, if IBM had done that, the personal computer era might have been bypassed entirely with the network computer launching the equivalent of the WWW in 1983.

    1. Re:No, it wasn't. by westlake · · Score: 1

      If IBM had gone to Chuck Moore instead of Bill Gates (or rather, his mom) for their 4.77MHz 8088 PC

      Microsoft was selling microcomputer BASIC to Fortune 500 clients as early as 1976. It became the most visible --- and the most successful --- developer of programming languages for the micro in the eight bit era and well positioned to move into system software and applications.

    2. Re:No, it wasn't. by Baldrson · · Score: 2

      No doubt BASIC was the path of least resistance, but if you click through my link to 1983, you'll notice that Smalltalk was positioned to execute on a FORTH stack VM which was then reduced to hardware in the Novix chop. Moreover, the technology you see in the Javascript V8 engine had already been published in relation to Smalltalk in 1983.

      This was technically feasible at that time. The fact that it wasn't the path of least resistance hardly qualifies BASIC for the credit accorded it by the title of this article.

  13. Re:In 3, 2, 1... by Threni · · Score: 1

    Don't forget 0. Only silly languages start loops, arrays etc at 1.

  14. echo "I love Basic"! by Anonymous Coward · · Score: 0

    //basic hooray
    for (i 3)
    {
    echo "Hooray!"
    i++
    }

  15. No line numbers! by Anonymous Coward · · Score: 1

    Before anyone makes a lame joke along the lines of "10 GOTO 10", keep in mind that the BASIC from Dartmouth had no line numbers, and it had structured control flow (for/while loops, etc.). If you ever used "True BASIC" for the Mac, that was a modern port of Dartmouth BASIC (by a company founded by Kemeny, I believe).

    1. Re:No line numbers! by Anonymous Coward · · Score: 0

      the BASIC from Dartmouth had no line numbers, and it had structured control flow (for/while loops, etc.).

      You, sir, are an idiot. Your assertion is directly contradicted by the article -- and my own experience. Not that I used DTSS, but because I read books about it and programmed in BASIC long before there was a Mac.

    2. Re:No line numbers! by Anonymous Coward · · Score: 0

      > Before anyone makes a lame joke along the lines of "10 GOTO 10", keep in mind that the BASIC from Dartmouth had no line numbers
      > and it had structured control flow (for/while loops, etc.).

      You don't know what you're talking about.

      http://bitsavers.trailing-edge.com/pdf/dartmouth/BASIC_Oct64.pdf
      http://bitsavers.trailing-edge.com/pdf/dartmouth/BASIC_4th_Edition_Jan68.pdf

  16. What it was actually good for by unfortunateson · · Score: 1, Insightful

    Text.

    Long before Lisp or Perl, Basic made things much, much easier to deal with text.
    C (and its children) had pointers and allocation to deal with.
    Cobol, Fortran and Pascal, by default, dealt with fixed-length strings (yes, later versions improved it).

    On the Digital operating systems (RSTS, RSX, VAX/VMS -- whose technology ended up influencing WinNT), BASIC was relatively sophisticated, long before Visual Basic: explicit variable declaration, access to database routines, etc. I got a LOT of stuff done where the Pascal and C programmers were spending time just making things work. Speed? Perhaps slower, but most of what I worked on was interactive, where the bulk of the time was waiting for a human being.

    --
    Design for Use, not Construction!
    1. Re:What it was actually good for by sribe · · Score: 1

      Long before Lisp or Perl, Basic made things much, much easier to deal with text.

      Ahem, Lisp predates BASIC by 6 years...

    2. Re:What it was actually good for by Impy+the+Impiuos+Imp · · Score: 1

      You cd'r been a lot ruder.

      --
      (-1: Post disagrees with my already-settled worldview) is not a valid mod option.
    3. Re:What it was actually good for by Darinbob · · Score: 1

      Though there is much to recommend it, Lisp has many cons.

  17. Vic-20 Tank vs UFO by NeoNormal · · Score: 2

    I bought a VIc-20 in 1982 to use in my woodworking business. I learned BASIC on it by trying to key in the Tank vs UFO game that was printed in the manual. I don't know if it was all of my typos or errors in the printed listing (both likely), but through debugging that ASCII character game, I got started in the direction that took me to working in IT.

  18. That's weird by Anonymous Coward · · Score: 0

    I keep hearing that Star Trek and space was the driver behind science and technology... When was the first episode of Star Trek again? So what inspired these scientists?

    1. Re:That's weird by AlecC · · Score: 1

      No - the driver behind the current generation of scientists and technologist, of whom there are far, far more than there were back in those days. Back then, you only needed the 0.001% of truly deep geeks to keep the technology bandwaggon rolling. Now we need perhaps 2-3% of the population to be fairly geeky to do all the science and technology related jobs created by the explosion those first guys triggered,

      --
      Consciousness is an illusion caused by an excess of self consciousness.
    2. Re:That's weird by ChunderDownunder · · Score: 1

      Doctor Who predates BASIC by 6 months. Coincidence?

  19. And.... by Anonymous Coward · · Score: 0

    ...run out of shop...

  20. I say BS by mrthoughtful · · Score: 0

    (1) It wasn't a language that made computers personal, it was the advent of the microchip, and, as a consequence, the microcomputer.
    (2) The first language I learned was BASIC. It was so bad that I then learned assembler.
    (3) My experience of BASIC was so bad that I didn't want anything to do with it, even though using it to compose LUTs would have been very useful
    (4) Then 'C' became cheap, and then free. I haven't written anything in BASIC for over 30 years.

    --
    This comment was written with the intention to opt out of advertising.
    1. Re:I say BS by narcc · · Score: 1

      What was "so bad" about it?

    2. Re:I say BS by 50000BTU_barbecue · · Score: 1

      Depending on the machine, the BASIC could be awful. On a Commodore 64, there were no commands for sounds and graphics. You had to get elbow-deep into peeks and pokes. Might as well go to assembler in that case. The C128 had BASIC 7.0, which had a much improved set of commands for graphics and sound.

      --
      Mostly random stuff.
    3. Re:I say BS by mrthoughtful · · Score: 1

      Why is BASIC bad?
      (1) It encourages poor programming practices by
        a) not including good code block semantics.
        b) not supporting classes
        c) not separating library (or OS) calls from language primitives
        d) having no proper concept of scope
        e) not having a standard

      (2) Being a suboptimal interpreted language - I remember that CLS was around 100 times slower than a Z80 routine.

      Of course, you may be thinking of modern BASIC implementations - well, that's a different thing altogether.
      The BASICs (eg on the Spectrum, C64, etc) I knew were just rubbish.
      I guess you could argue that it's an implementation thing - but actually, it's hard to go wrong with something like Java, or C. I remember some LISP interpreters were pretty slow also..

      --
      This comment was written with the intention to opt out of advertising.
    4. Re:I say BS by narcc · · Score: 1

      (1)
      A) Not including "good" code block semantics. -- What? Nevermind, the "good" qualifier makes this pointless to argue.
      B) Not supporting classes -- This is an VERY good thing. Classes are not only unnecessary for OOP, but are responsible for many bad programming practices.
      C) Not separating library (or OS) calls from language primitives -- Again, What? Not only is that 100% false, how would that encourage bad programming practices if it were true?
      D) Having not proper concept of scope -- Again, false, for many interpretations of "proper".
      E) Not having a standard -- How would this "encourage poor programming practices"? Also, it's completely false! (For more than 30 years now!)

      (2) -- CLS being slow on your Z80 does not in any way make the language bad.

      Good effort though. It's hard to defend an indefensible meme.

    5. Re:I say BS by Anonymous Coward · · Score: 0

      Ish... regarding point 2, I actually considered that a plus. BASIC took me so far, then I got to learn a whole bunch of stuff about how computers actually work - ie BASIC was fun, but assembler was *awesome*! Finally I could understand what was happening behind all those magical incantations I'd been doing.

      Learning assembler on my led to learning about hardware hacking: soon my trusty old microbee was sprouting wires, having AD converters attached to it, connecting to and controlling things that it was never intended for. Hell, I can still remember more about that old machine than I can from most of my classes at uni.

      And speaking of uni... you know when they introduced pointers and references, and all the non-programmers just looked blankly for about a semester wondering what the hell was going on? Trivial if you know anything about assembler and understand what is going on behind all the magical incanation thingies.

      Thank you BASIC!

    6. Re:I say BS by Anonymous Coward · · Score: 0

      Remember that early BASICs were working on seriously limited hardware. 16k RAM, 2MHz processors, lo-res graphics, that sort of thing. To make anything useful you simply had to make compromises. BASIC wasn't perfect, but it was pretty darn good considering.

  21. Re:In 3, 2, 1... by MightyYar · · Score: 1

    Really fantastic languages let the user choose which base to use in combination with an ambiguous default.

    --
    W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
  22. Re:In 3, 2, 1... by AlecC · · Score: 4, Informative

    No, it just shows habit. C was descended from B, which descended from BCPL. They just did more of the same, instead of going to someone else's syntax.

    And, having programmed in Pascal for 15 years. Pascal as defined was not suitable for large projects, whereas C was. Every Pascal compiler had to have some non-standard add-ons to handle modularity. And they were all different. Obviously, the Borland model came to have the status of a de-facto standard, but that was not till some years later. You could not have written Unix in standard Pascal; it was written in standard C. Wirth acknowledged the modularity failings of Pascal in his Modula language family, but by that time he had missed the bus.

    --
    Consciousness is an illusion caused by an excess of self consciousness.
  23. fuck beta by Anonymous Coward · · Score: 1, Insightful

    fuck beta

  24. LISP instead! by Anonymous Coward · · Score: 3, Insightful

    Lisp was invented in 1958. Can you imagine a world were personal computers had Lisp instead of BASIC? We would have had the singularity the year after IBM released the AT!

    1. Re:LISP instead! by istartedi · · Score: 2

      I think it's more likely that only a few people would have cared for it. Of those few, an even smaller few would have written something like a BASIC interpreter in Lisp and sold it separately.

      Either that, or they would have sold poorly until somebody came out with what we got, which was PCs that shipped with BASIC.

      I recall reading a review of one of the less popular systems at the time. The reviewer said something like, "it comes only with assembler, which is useful only for understanding how a computer works". Of course I and a lot of other people ended up programming the C-64 mostly with assembler; but we started with BASIC.

      Oh, and I'm surprised I got this far down and nobody quoted Djikstra yet. I like to count myself as one of the many programmers who proves him wrong; although it's my understanding that the BASIC to which he referred was inferior even to the line-numbered versions of the 80s. I wonder if he ever qualified or backed up even a little bit from his infamous quote.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    2. Re:LISP instead! by Opportunist · · Score: 2

      (I ((am not) so (sure (about that))), (you (may (rest assured) (that (at (some point)) (someone (would have (forgotten (a closing (or opening) bracket)) ... ) ... )? ...

      oh fuck, let's start counting... one open, two open, three open, two open...

      --
      We used to have a Bill of Rights. Now, with the rights gone, all we have left is the bill.
    3. Re:LISP instead! by phantomfive · · Score: 0

      Oh, and I'm surprised I got this far down and nobody quoted Djikstra yet. I like to count myself as one of the many programmers who proves him wrong; although it's my understanding that the BASIC to which he referred was inferior even to the line-numbered versions of the 80s. I wonder if he ever qualified or backed up even a little bit from his infamous quote.

      How many bugs are there in your programs? If the answer is non-zero, then no, you haven't proven him wrong, because that's what he was talking about. Also, he insulted most other popular languages of the day as well, so you don't need to feel singled-out.

      --
      "First they came for the slanderers and i said nothing."
    4. Re:LISP instead! by Anonymous Coward · · Score: 0

      Lisp wasn't popular on PCs, but LOGO had moderate popularity.

    5. Re:LISP instead! by xanthos · · Score: 1

      LISP - Lots of InSipid Parenthesis

      --
      Average Intelligence is a Scary Thing
    6. Re:LISP instead! by Darinbob · · Score: 1

      Lisp had gone through a lot of experimentation, and it really didn't settle down until what we recognize as Lisp until later. Lisp 1 was somewhat crude. Lisp 1.5 was a lot nicer but still clumsy. MACLISP really made things a lot more modern but that wasn't until 1966 I think.

    7. Re:LISP instead! by Darinbob · · Score: 1

      Oh and the big difference I think, is that BASIC was explicitly intended for all the students and faculty at a liberal arts university, whereas Lisp was initially intended for mathematicians and researchers at a science and technology university.

    8. Re:LISP instead! by istartedi · · Score: 1

      How many bugs are there in your programs? If the answer is non-zero, then no, you haven't proven him wrong, because that's what he was talking about

      No it wasn't.

      The quote in question is:

      It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

      Proving him wrong doesn't require me to produce zero-defect code. It simply requires me to learn "good programming", which is subjective but I doubt he meant to imply it mean zero-defect production, which is an extraordinary bar to hurdle.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    9. Re:LISP instead! by istartedi · · Score: 1

      Hmmm... now that I come to think of it, proving him wrong actually requires a significant number of programmers to start with BASIC and then go on to become "good programmers". Or perhaps, another way of looking at it is for a significant number of teachers to notice that un-teaching bad habits previously learned isn't all that hard. I think that is indeed the case. Once again, it's subjective. He leaves himself some wiggle room in that quote; but I stand firm in my conviction: It's wrong.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    10. Re:LISP instead! by phantomfive · · Score: 0

      You didn't understand what Dijkstra means by "Good programming." He meant zero defect. He also created a system for teaching how to do it.

      --
      "First they came for the slanderers and i said nothing."
    11. Re:LISP instead! by istartedi · · Score: 1

      Then he shouldn't have said "good". He should have said "perfect". Yeah, sure. He "created a system for teaching how to do it". Does the Golden Gate Bridge come with that book?

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    12. Re:LISP instead! by phantomfive · · Score: 1

      lol. He spent the last several years of his life working on that. Notable quote from a book he edited, (paraphrase) "the only way to be sure there are no bugs in a program is to never find any, no matter how much time you spend testing."

      --
      "First they came for the slanderers and i said nothing."
    13. Re:LISP instead! by istartedi · · Score: 1

      That is funny, because now it sounds like he went too far in the opposite direction. I'd concede that he could at least prove that a program written in a pure functional language was correct, that the pure functions in the program were correct. Of course any useful program tends to have impure functions. This whole thing reminds me of the other story about the Haskell guy who thought the Holy Grail came from shoving impure constructs into the type system. IMHO, no. They're still doing evil, they're just doing it in the type system instead of the functions.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    14. Re:LISP instead! by phantomfive · · Score: 1

      Yeap. Well, now you know what he meant by his statement about BASIC programmers. He thought people should be taught to program by proof from the very beginning.

      --
      "First they came for the slanderers and i said nothing."
    15. Re:LISP instead! by CmdrTamale · · Score: 1

      And the world supply of parentheses would quickly have been exhausted.
      --
      I myself am made entirely of flaws, stitched together with good intentions.

    16. Re:LISP instead! by Anonymous Coward · · Score: 0

      It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

      I'm convinced that learning C mentally mutilates programmers. Every time I sit down with a book on C and attempt to learn it, it seems fairly straightforward and logical, and I feel like I have a good grasp of it.

      Then I download some source code from an ACTUAL project written in C, and can't believe my bloodshot eyes. I swear, there's some creepy alien power out there training C programmers to write terse, impenetrable, backwards-ass code instead of clear, readable code that describes the purpose and structure of the program. It's really an alien way of thinking, I'm thoroughly convinced.

      Some of it is so terse, you'd think every keystroke caused C programmers searing physical pain.

  25. Re:In 3, 2, 1... by RabidReindeer · · Score: 1

    Every Pascal compiler had to have some non-standard add-ons to handle modularity.

    Actually, if I've got my Pascal-family languages straight, every compiler had to have non-standard add-ons just to handle basic I/O.

  26. Re:In 3, 2, 1... by gaspyy · · Score: 2

    I haven't coded in Pascal since the good old DOS days, when I was about 17, but at the time was writing TSR apps, picture viewers (GIF, PCX, BMP, TIF), some graphic-mode UI, including mouse support, even some VGA graphic demos. I can't think of anything that I couldn't do in Pascal (and some ASM, I give you that). In fact, it's the reason I never got too heavily into C...

  27. Basic Got Me My Career by coolmoose25 · · Score: 4, Interesting

    I started working on computers in the early 80's... The first one I used was a TI 99 4a. It had tape drives and a TV set as a monitor, and a horrific keypad (note: not keyboard). Then my brother got a PC Jr. and I started hacking with that and then went off to college. As an engineering major, I learned FORTRAN on punched cards. I hated it! Swore I'd never have a job where I used computers.

    Then my brother got the family to chip in and buy me a Tandy 1000a. It came with DOS, Deskmate, and Basic. I started programming in Basic using the concepts I had learned in FORTRAN. By the end, I think I had dumped about $5,000 into that computer. Printers, memory upgrades, floppy upgrades, hard drive, monitor, etc. And still was able to do amazing things with Basic and with BAT files.

    My first job was with Arthur Andersen. COBOL. Batch COBOL. 2.5 years of it. Learned it in 6 weeks, and spent the rest of my career there either coding it or writing tech specs for it.

    Went to work at an insurance company coding SqlWindows, a now obscure 4th gen programming language. But hey, it was Windows programming. Spent 10 years there in a variety of roles.

    After that I set up my own web development shop... Wrote classic ASP which is essentially Basic for the web. And then went to work at another insurance company, writing, you guessed it, Microsoft VB.net. Granted, VB.net was a far cry from the original basic, and probably would have been better off learning C#. But that was Microsoft's strategy with .Net - recycle old VB programmers and old C programmers using the CLR. At the end of the day, not much difference between C# and VB.net. Now I don't code anymore, I'm a VP at that insurance company. But I owe a lot of my career for having a tool like Basic available to me in my formative years. Sure, it teaches you some bad coding habits. But just like anything else, you learn from that, and others, and classes (and objects for those who like puns). Those who say that you can't be a good programmer after having learned basic are either elitist snobs or idiots. Sometimes you have to do it wrong first to see how doing it right makes all the difference. So Happy Birthday Basic - I love ya' baby.

    --
    Brawndo: It's what plants crave!
    1. Re:Basic Got Me My Career by Anonymous Coward · · Score: 0

      And I would say that most of the people bashing basic, haven't tried a modern basic. The fact that C derivatives have such a hard time handling text shows how limited a language it is.

    2. Re:Basic Got Me My Career by SerfsUp · · Score: 1

      If your TI had the chicklet keypad (which actually looked kind of like your brother's PC jr's keys), it was a 99/4, the 99/4a came later and had a proper looking keyboard in it. I had a 99/4 myself originally, but I swapped it to a 4a soon after through an upgrade program TI offered, primarily due to the better graphics and sprite handling capabilities of the later model--features which were needed to run Parsec!

  28. Re:In 3, 2, 1... by WillAdams · · Score: 4, Insightful

    ``Pascal as defined was not suitable for large projects...''

    Unless of course, one is Dr. Donald Knuth, then one creates a brand new programming paradigm: http://www.literateprogramming...

    and writes programs such as TeX: http://www.ctan.org/tex-archiv...

    Somewhere, I have a copy of the Oberon language manual printed out --- it's quite cool, and very concise.

    --
    Sphinx of black quartz, judge my vow.
  29. Re:In 3, 2, 1... by AlecC · · Score: 2

    I do not deny that Knuth, and Wirth, created other, very cool, programming languages later. But I stand by my statement that Pascal, as originally defined, was not suitable for large projects, a failing that Wirth himself recognised.

    --
    Consciousness is an illusion caused by an excess of self consciousness.
  30. Idiots by Anonymous Coward · · Score: 3, Insightful

    So, if you are surrounded by idiots as early as middle school, you'll get better grades.

    When I was a kid, I wanted to be a machinist. I love working with my hands.

    In Middle School and High School, there were these "idiots" who took shop barely passed Algebra and took jobs that gave them credit to graduate.

    My parents didn't want me to be a blue collar worker and demanded I go to college. Part of it was that they wanted something more for me - blue collar jobs were being sent down South (Carolinas, GA, FL, etc ..) at the time and the "college boys" had their cushy salaried jobs and were the ones laying people off and sending jobs to the South - "those Southerners took our jobs!" (The good ole days before Globalization).

    Years later, I was patting myself on the back for making 6 figures when I bumped into an "idiot" I went to school with. Well, I met him for lunch at his $5 million tool and die company - and I let my parents know about it.

    Well, today he's lost a bit of business because of off-shoring but is still doing well and he's still respected for being a business owner.

    I'm unemployable with savings dried up, investments gone, and people telling me that I'm no good and stupid - Maybe so.

    Of course today, being a machinist is pretty much "monkey pushes the button" for these high tech CNC machines - the designers write the programs.

    I digress.

    tl;dr: "Stupid people" have their place and don't be surprised if they are more successful than you.

    PS, think about what you are doing in IT/Software development. What do you really offer society and humanity?

    Looking at the "apps" and "technology" coming out of Silicon Valley, I have to say, they offer no value. The just contribute to our mindless consumer society.

    Google, Yahoo!, Apple, etc ... are just consumer products and services that exist for us to ... consume. No value.

    My corner mechanic offers more to society than all of you in Silicon Valley. Same goes for the nurse at my hospital. We in software and IT like to think we offer so much but really, what do we do? Or what does you job do? All of you working at Facebook are a waste. Same goes for you Google "engineers" - you are nothing but marketing people.

    Just a waste.

    1. Re:Idiots by HornWumpus · · Score: 1

      "Machinist' is getting pretty uncommon.

      CNC machine operator is not a machinist. He loads billets into fixtures and pushes buttons.

      CNC programmer may or may not have previously been a machinist.

      Mechanical engineers often think they are machinists++. They are generally wrong.

      Tool, die and mold makers are machinists++. Most pushing 60 or older.

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    2. Re:Idiots by coolsnowmen · · Score: 1

      I read everything you said. It in no way counters what I said. It kind of reminds me like the side story of Ender's Game "bean". 'This other guy also made money' k.

    3. Re:Idiots by Anonymous Coward · · Score: 0

      My corner mechanic offers more to society than all of you in Silicon Valley. Same goes for the nurse at my hospital. We in software and IT like to think we offer so much but really, what do we do? Or what does you job do? All of you working at Facebook are a waste. Same goes for you Google "engineers" - you are nothing but marketing people.

      Just a waste.

      You know what's a waste? A mind so corroded by bitterness that it completely denies the value of huge swaths of humanity.

      No, your corner mechanic doesn't offer more to society than the whole of, say, Google. Much as I hate lots of the shit Google does, and the corrosive influence of its marketing revenue model, the company's core and original product -- search -- is great. Corner mechanics provide value to society too, but in an entirely different way, and unlike good internet searching facilities you can't really claim that the activities of mechanics are likely to help humanity develop new knowledge in any direct way.

      Also, the Valley is hardly just Facebook, Google, and so forth. There's still a ton of stuff here related to silicon! I should know, that's what I do.

  31. Ric Weiland by Beorytis · · Score: 1

    I would have liked to hear from Ric Weiland but it's not possible since he died in 2006. He was responsible for the BASIC that I learned on: The Microsoft BASIC-in-ROM that came with my family's Ohio Scientific Challenger 4P (a 6502-based system from 1978 that had hardware similarities to Commodore systems). It also featured the first "Easter Egg" I remember: The system's boot prompt was "C/W/M?" (i.e. cold boot, warm boot, monitor). If you selected "A", it responded with "WRITTEN BY RICHARD W. WEILAND."

    1. Re:Ric Weiland by Dadoo · · Score: 1

      I recognize that message. I have one of those in my garage and, the last time I checked, it still worked. I finally wrote an emulator for the thing, copied the roms to a modern computer, and play with that, occasionally.

      --
      Sit, Ubuntu, sit. Good dog.
  32. The best part about Basic by mark-t · · Score: 2

    Basic was my first programming language, and I actually spent almost 10 years using it before moving onto more structured languages like C, but it wasn't too long after I learned Basic that I found that my favorite features of the language were the ones that enabled me to extend it with my own customizations, which I would have to write in assembler. If I remember correctly, the relevant basic keywords in the implementation that I used were 'usr' and '&... practically turning it into another language with all of the extensions that I would throw in.

    1. Re:The best part about Basic by Anonymous Coward · · Score: 0

      Basic was my first language, and like you I ended up learning assembly as a means of customising and extending. The usual trick was to put a line like:

      10 REM ML SUBR: 1234567890123456....

      and then overwrite (POKE) the 1234... string with your assembly subroutine later in the code. Run using USR(memlocation).

      There was a related trick that seemed much less popular - self-modifying code. This time, start your program with

      10 GOTO 40
      20 ....whole bunch of whitespace...
      30 RETURN
      40 ...rest of program

      Now, most (all?) early BASIC variants were tokenized. Each command (eg GOTO) was represented with some bytecode in memory. By reverse engineering the bytecodes you could use POKE to overwrite the whitespace on line 20 with actual BASIC code that could then be called using GOSUB. I used this trick to write a rudimentary graphing programming back in the day: the user enters an equation, which my program would tokenise, POKE over line 20, and then graph using GOSUB 20 for point evaluation.

      Good luck doing that in FORTRAN :)

    2. Re:The best part about Basic by mark-t · · Score: 1

      The version of basic that I played with extensively had limitations on what kind of data could be stored on a line of code... since the basic interpreter expected every line to have a null terminator. It was still possible to do something similar to what you did, but any embedded assembly would have to go at the end of the listing, and not at the beginning, since the presence of any 0 bytes in the assembly code would prevent the 'goto' or 'gosub' keywords from finding the right lines if they had to skip over such code. Also, once putting the assembly program into the code in that way, the listing would be messed up if you tried to view the program past that line.

      The self-modifying code trick that you did sounds really cool... just the sort of thing I would have been into myself.

      In the version of basic that I used, the parameter to 'usr' was actually a numeric value that was passed to a custom function, rather than necessarily referring to a memory address, and the function could directly use this value, and it would also return a value back to the basic program. If one did not need a return value, then one would typically use 'call', which would invoke a machine language function at whatever memory address immediately following the call keyword. The '&' keyword was basically just shorthand for a call to a specific memory address (one would typically write an unconditional jmp instruction to that memory address which would branch to the real intended code), and it was fairly commonly practiced in such code to manually parse the tokens which followed the '&' to define extensions to the language. One could also do this technique of custom parsing with 'call' and 'usr' as well, and I routinely did so with the latter... I did not bother ever doing it with the 'call' function because the '&' keyword was adequate for my purposes.

  33. Re:In 3, 2, 1... by phantomfive · · Score: 1

    Knuth had to write a custom pre-processing system to deal with modularity and portability in Pascal when he did TeX and Web. He explicitly stated that Pascal was not his preferred language for that task, but he used it anyway because it was widespread among his target audience.

    --
    "First they came for the slanderers and i said nothing."
  34. If you're Knuth, you fart a complete OS in ASM by raymorris · · Score: 1

    Knuth can write a complete OS in assembly language while sleeping. 99.9999% of programmers aren't Knuth.
     

    1. Re:If you're Knuth, you fart a complete OS in ASM by gewalker · · Score: 1

      Maybe so, but even for him a 7 volume set on computer programming takes a very long time indeed.

  35. Re:In 3, 2, 1... by NapalmV · · Score: 0, Troll

    Wirth acknowledged the modularity failings of Pascal in his Modula language family, but by that time he had missed the bus.

    Interesting that it "missed the bus" on "modularity" issues against two languages that didn't even have the behavior of the modulo (%) operator properly defined and standardized until late in 1999 (C) and 2011 (C++) respectively.

  36. Reversing END by Anonymous Coward · · Score: 0

    Hmm, this news article seems to be collecting people who are familiar with BASIC. Perhaps someone here can help me out.
    Sometime in the mid-1990's, I went online and found a sequence of GW-BASIC commands, which I've since lost over the years. But, as it was an interesting set of commands, I've sought to find it again.
    It involved recovering after NEW. If you typed in a program, and then typed NEW, the program would presumably be inaccessible. However, there was a technique to be able to get most of the program back (with perhaps some minor corruption in the first line or two).
    The closest I found, in more recent years, is some sort of technique involving zero, apostrophe, and ASCII code 15, as described by http://www.petesqbsite.com/sections/zines/basix/basix11/basix11.htm#newsgroups2-gwbasic
    That seemed to be designed to work around some sort of copy protection (a way to "protect" the code from the end user). However, I thought there was another method involving PEEKS and POKES. Actually, the other method might have involved READ and DATA, as described by
    https://groups.google.com/forum/#!topic/comp.lang.basic.misc/-G1jHKsCQsg
    (Notice that line 60 runs the "NEW" command... and then there is a line 70.)
    If anyone could explain how either technique works (a simple recovering from NEW, or this workaround for the copy protection), I'd be interested in that. Just what was occurring by holding alt and pressing 15 on the numpad? (I understand that would insert ASCII code 15, which is called "Shift In". What intended effect did that have in GWBasic?)

  37. Re:In 3, 2, 1... by Anonymous Coward · · Score: 0

    you just gave me a Fortran flashback! you insensitive clod!

  38. Typewritten by Anonymous Coward · · Score: 0

    I'll bet it turns out that real programmers do not program in ANY language, right? ;)

    In the 21st century, You'd think we could say "Computer, here is my algorithm. [speak algorithm here] here is the data [locate data] and run."

    What are we still typing when there are much better communication methods for humans?

  39. use COBOL because you want raw performance by KingMotley · · Score: 0

    OMG your post made me laugh so hard.

    1. Re:use COBOL because you want raw performance by mwvdlee · · Score: 2

      Then you've probably never even touched COBOL in your live.

      All shops I've worked for are actually pretty hardcore about performance, testing against other languages whenever a compiler is updated.
      Nobody wants to program COBOL code, it's just that it's a produces very good binaries for the specific (financial) tasks it was designed for.
      Or do you really think all those COBOL programmers still active are only doing it out of legacy support?

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    2. Re:use COBOL because you want raw performance by Anonymous Coward · · Score: 1

      COBOL is verbose, but is a lot like mainframe assembler when you strip out the crud. Compare a COBOL program to the assembler generated by the compiler. (You did do that before you laughed so hard, right?) Most of the strange 01 level data types (packed, COMP, and so on) map directly to machine data types on mainframes. COBOL is an efficient language with decades upon decades of compiler improvements. Yes, an assembler programmer could optimize routines by hand much better than a compiler, but for huge applications, that's not practical. Most COBOL applications have assembler routines for that kind of super-performance.

      And, anyway, when was the last time you had a buffer overflow in COBOL that threatened all of the Internet?

    3. Re:use COBOL because you want raw performance by mattack2 · · Score: 1

      I think he laughed so hard _because_, at least as it is covered in the media, "all those COBOL programmers" _are_ doing it for legacy support.

    4. Re:use COBOL because you want raw performance by Anonymous Coward · · Score: 0

      Yeah whatever. You want performance, short of pure assembly the answer is C or maybe C++. Forth comes in around there as well.

    5. Re:use COBOL because you want raw performance by mwvdlee · · Score: 1

      C is not the fastest programming language in the world for every single task, in fact it is rarely ever the fastest language for any individual task.
      That's not a bad thing, because C is usually a very good second or third place, making it a good average choice. But it doesn't win from domain specific languages.
      Assembly is fastest, but only assuming people are able to optimize it by hand, which not many people can do.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    6. Re:use COBOL because you want raw performance by Anonymous Coward · · Score: 0

      Yes.

  40. Infinitely fast CPU time! by Twinbee · · Score: 0

    I often wonder what a programming language would look like if CPU and memory were infinitely fast and big. What kind of constructs and algorithms would we never have to worry about any more?

    Sorting? Scrap Quicksort - BogoSort to the rescue! Garbage collection? No worries - the waste disposal area is essentially a black hole! Bugs with threading driving you to despair? Never fear, say goodbye to race conditions forever! What does 'optimization' even mean - just brute force everything!

    Elegant wouldn't even begin to describe the result. Perhaps it would look a little Basic-esque even... [ducks]

    --
    Why OpalCalc is the best Windows calc
    1. Re:Infinitely fast CPU time! by NapalmV · · Score: 1

      I often wonder what a programming language would look like if CPU and memory were infinitely fast and big.

      Java++

      .

  41. VB != BASIC by Primate+Pete · · Score: 1

    Really, though, VB6 is not BASIC, despite claims to the contrary. Program structure (numbered lines), approach (graphical), flow control (GOTO?) and syntax is entirely different.

    1. Re:VB != BASIC by walterbyrd · · Score: 1

      > Really, though, VB6 is not BASIC, despite claims to the contrary. Program structure (numbered lines), approach (graphical), flow control (GOTO?) and syntax is entirely different.

      Might as well say FORTRAN 77 is not really FORTRAN.

      Numbered lines, and GOTOs, as a flow control method have been gone way before VB.

      In the 1980s, I used MS Professional BASIC to write programs that were several thousands of lines. Never used any line numbers, or GOTOs.

    2. Re:VB != BASIC by MooseMiester · · Score: 1

      Agreed.

      My programming career started in 1979 as a BASIC-PLUS programmer on RSTS/E 6.0 for the POISE company (People Oriented Information Systems for Education). In those days the single key ISAM "database engine" was also written in BASIC-PLUS. Then, we got BASIC-PLUS-2 which was compiled, as opposed to being a threaded interpretive language (A TIL for language people). The hardest part about BP2 was ODL (Overlay Descriptor Language) where you had to manage memory for the program yourself. Compile (called task build) took absolutely forever. We used a chalkboard to sign up for compiles.... no kidding.

      VB3 was a rip off of BP2. At that time, Microsoft and DEC were on either side of the 520 freeway in Redmond, and there was much going back and forth. That's why Windows NT has the comments from VAX/VMS still in it LOL.

      VB.NET was the only version of BASIC I ever encountered that you can do modern stuff with... but as BASIC programmers have always been regarded as the idiots of the I.T. world, it was shunned even though it was C# with BASIC keywords. If they had named it HARD instead of BASIC we'd probably all be coding in it to this day. Trouble is, FOR I=1 TO 10 looks easy, whereas for(i=0; i
      Anyway I digress. BASIC is a TIL, and anything that's not a TIL isn't really BASIC. If you want a taste of what BASIC was like, try coding in VBA, it's horrible beyond belief to debug the stuff....

      --
      Murphy was an optimist
  42. Dartmouth College by bill_mcgonigle · · Score: 2

    editors:

    s/University/College/

    (hoping that wasn't an editorial 'correction' since TIME got it right)

    Also, there's a party all day on campus tomorrow.

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
  43. I wrote my first BASIC program 44 years ago by peter303 · · Score: 1

    It was Conways Game of Life recently explained in Scientific American Mathematical Games. I wrote it on a teletype (text terminals awaited cheap 512-bit ROMs for character sets in 1975) connect from my school to a local university computer (PDP-8?). Numbered lines were convenient in early BASIC when you could only edit one line at a time. The output was an asterisk and blanks grid. I think the printing took about 30 seconds which was longer than it took to compute the next generation. I found a listing a few years back. It was not that bad by my modern standards.

  44. Re:In 3, 2, 1... by spitzak · · Score: 1

    Why not use |= ?

      PORTA |= 1<<4;

    I agree the same problem of having to assume gcc will turn it into an sbi instruction, but at least it is a little clearer and more likely this way.

    My personal feeling is that there should be a C-like language where every single global keyword not in a namespace is reserved for internal use. Ie max() and min() and sin() and sdi() so on are all reserved for direct implementation by the compiler. Currently the solution is to pretty much implement __foo() as a built-in and then require a header file that adds an inline foo()->__foo() wrapper.

  45. Documentation by OhEd · · Score: 1

    I used to have a hard copy of General Electric's BASIC and FORTRAN manuals, until a weasel (who claimed to be a preacher!) stole them. I felt a little better when was busted for stealing TVs.

  46. Star Trek! by kheldan · · Score: 1

    There's still something awesome about the idea of sitting at a Teletype Model 33ASR playing Star Trek. Yes, you'd go through a lot of paper, but it was still fun. Of course what was even more fun was a version of BASIC I had on my 2nd computer, which allowed for INPUT statements that had a timeout feature on them. I was then able to write a version of Star Trek that would have the Klingons be able to attack you if you sat at any command prompt too long. Added an entirely new element to the game, you couldn't just sit there and mull over your options! This was back in the mid 1980's, before the IBM model 5150 came out. It was running on a Poly-88 5-slot S100-bus system with a 4MHz Z80 processor. Fun.

    --
    Are YOU using the TOOL, or is the TOOL using YOU? Think about it!
  47. Real programmers by Anonymous Coward · · Score: 0

    Real programmers take six months to write something that could be done in an hour in Basic.
    Fixed that for you.

  48. Re:In 3, 2, 1... by angel'o'sphere · · Score: 1

    Seems you never heard about UCSD Pascal.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  49. Re: In 3, 2, 1... by AlecC · · Score: 1

    Heard about it, tried it out, evaluated the UCSD P-system hardware. But it needed non-standard extensions to work.

    --
    Consciousness is an illusion caused by an excess of self consciousness.
  50. Re:In 3, 2, 1... by Richy_T · · Score: 1

    It's been a while since I messed with it but I believe you could do a union of a byte with a bit array (or some other bitwise structure) and set the bits individually. At least that's the way I remember doing it for the A/D board I built.

  51. Over 50 years. Best programmer && worst pr by raymorris · · Score: 1

    In 1962, he sat down to write one book of 12 chapters. More than 50 years later, he hasn't finished the project, which has scope-creeper to seven books. In the process, he created several new languages for use in his book project, and became famous.

    Yes, I think Knuth may simultaneously be the world's best programmer and the world's worst project manager.

  52. "Technically Feasible" by westlake · · Score: 1

    This was technically feasible at that time.

    How much did Smalltalk cost and what were the hardware requirements?

    During the late 1980s to mid-1990s, Smalltalk environments ---including support, training and add-ons --- were sold by two competing organizations: ParcPlace Systems and Digitalk, both California based. ParcPlace Systems tended to focus on the Unix/Sun Microsystems market, while Digitalk focused on Intel-based PCs running Microsoft Windows or IBM's OS/2. Both firms struggled to take Smalltalk mainstream due to Smalltalk's substantial memory needs, limited run-time performance, and initial lack of supported connectivity to SQL-based relational database servers.... While the high price of ParcPlace Smalltalk limited its market penetration to mid-sized and large commercial organizations, the Digitalk products initially tried to reach a wider audience with a lower price.

    Smalltalk

    1. Re:"Technically Feasible" by Baldrson · · Score: 2

      The reason I promoted Forth as a graphics communications protocol alternative to NAPLPS is the Western Electric Videotex terminals for the Viewtron service were so limited in RAM and ROM (far more limited than the first 4.77MHz IBM PC) that it needed a highly compressed representation of the firmware for decent graphics performance. Forth provided that and it would have further allowed dynamically downloading tokenized Forth stack functions (called 'words'). I talked about this with the guys at PARC late 1982 (prior to PostScript spinning off). Forth was lousy as a high level language but great as a macro-assembler for a hardware Forth chip -- a macro-assembler in which implementing the Smalltalk -- or Simula -- as an OS user interface would have had a very small memory footprint compared to a full-blown Smalltalk environment. Performance wise, the NOVIX chip was 16,000 transistors and was a full 16-bit wide FORTH hardware machine running at 24MIPS whereas the 8088 was 29,000 transistors but had an 8 bit bus running at about 2-3MIPS. Both were 3um technology. This initial implementation wouldn't have had enough memory to allow the full optimizations, such as type inference w/JIT etc that were then known possible and are now realized in the V8 JS interpreter, but it would have been at least as fast as BASIC as well as providing a clear migration path to vastly superior software development. As for price, well, Tesler was at PARC and had published on type inference -- and Jobs got him away. There's no particular reason something like small Simula core couldn't have been quickly implemented atop the Forth machine and Chuck Moore's low level drivers etc. In any event, IBM could have gone to Xerox and offered to buy PARC from them and Xerox would probably have sold it cheap. Xerox undervalued the work at PARC.

    2. Re:"Technically Feasible" by Anonymous Coward · · Score: 0

      You are of course right, but IBM didn't want microcomputing to lift of the ground (and endanger their core business), so they carefully avoided overdoing the IBM PC. PC was meant to slow down evolution of personal computing (which was exploding at the time and things started to develop very fast), something like "embrace, extend and extinguish". In that light should all of the early design and business decisions be regarded. It was preemptive strike, steering the train to a blind alley track. Later developments were an afterthought and again, a hijack and moderation of progress.

  53. Re: In 3, 2, 1... by angel'o'sphere · · Score: 1

    Which non standard extensions did it need (considering it was 'the standard')?

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  54. Re:In 3, 2, 1... by mikael · · Score: 1

    I tried writing my first projects in Turbo Pascal. The idea of having module and function scope within blocks seemed a nice idea, but it led to real refactoring pain when you wanted to move some data structure from a local private use to something global. Every other reference to some variable had to be moved too.
    Most Turbo Pascal functions just mapped onto BIOS calls. But then there were options to use C calling functions rather than Pascal calling functions.

    --
    Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
  55. Re:In 3, 2, 1... by Anonymous Coward · · Score: 0

    What was bad about Pascal? I only ever got to sample it as Turbo Pascal back in school. As it was my senior year, I got very little time with it, and quickly moved to C/C++.

  56. BASIC was cost effective for teaching by Required+Snark · · Score: 1
    Having worked on a BASIC interpreter for the Data General NOVA minicomputer, I can tell you that it was a cost effective solution for teaching programming. A computer with 32K words (64k bytes) and a disk could be purchased for under $30000. This was by far cheaper then any other machine on the market.

    These machines had no memory protections support, and it was difficult, if not impossible, to multitask different programs. It could only be interactive running a single core image.

    BASIC was ideal for this computing model. The BASIC interpreter could round robin between the interactive users. It was effectively a combined dedicated OS and language.

    In the system I worked on the disk was used for swapping users and storing user programs and data. A single CPU could support up to 20 or so terminals. These systems were used for both teaching and simple business automation.

    In contrast, even using an assembler was a multipass operation, and only one person could work at a time. Compiling anything more complex, like Fortran IV took a long time. Personally, I only saw people working in assembler since anything else quickly exhausted system resources like memory. Only a very small Fortran program could run in 32K words.

    --
    Why is Snark Required?
  57. First Time I Saw a PC by sudon't · · Score: 1

    I still remember the first time I ever saw a personal computer. I guess it was around 1979, and my friend bought some kind of computer that you hooked up to a TV, and, if I'm remembering correctly, you programmed in Basic, and had eight switches instead of a keyboard, (again, if I'm remembering correctly. Is that possible?). I wish I knew what this thing was. Anyway, the most interesting thing to me was that you could write a program that would make a sort of swirling psychedelic pattern happen on the TV screen - excuse me, monitor.

    What I do remember clearly, is thinking, "Why in the world would anybody ever want a computer at home?" A few years later, I wanted a MacIntosh, badly.

    --
    -- sudon't

    Air-ride Equipped

  58. Re:In 3, 2, 1... by Threni · · Score: 1

    If you can afford the performance hit on every single subscript, sure!

  59. Re: In 3, 2, 1... by AlecC · · Score: 1

    It was not "the standard". The standard was the "Pascal User Manual and Report". To my recollection, this contained no mechanism for multi-file compilation. It assumed that every program was a single file - fine for a teaching language, where programs would typically be a hundred or two lines long, but no use for a system language. UCSD added extensions that made it into a perfectly good systems language. So did Turbo Pascal - differently, So did the Oregon Software cross compiler I used - differently again. You could not simply port programs between these various systems, whereas you could port programs written in K&R C. With additions, Pascal was a fine systems language; as I say, I used it for 15 years and wrote many tens of thousands of lines of code in it. But it needed extensions.

    --
    Consciousness is an illusion caused by an excess of self consciousness.
  60. Re:In 3, 2, 1... by AlecC · · Score: 1

    It was not bad, it was incomplete. It was a much nicer language than C, which is why I chose it for the projects I was developing, and was the point made several posts up . But, as I recall, it had no features allowing multiple compilations to be linked together - no equivalent of the C header file.Turbo Pascal added this, to make a very usable system. As did several others - incompatibly. This militated against it becoming a widely used systems language, because it was fragmented into different dialects, all incompatible. C, ugly though it was, stayed on the K&R standard, then added the Ansi standard, which was nearly completely upwards compatible, then mutated into C++ which made great efforts to keep compatibility with C. I can switch code between GCC and VisualC with very little effort: I could not switch code between the various Pascal environments in the same way.

    --
    Consciousness is an illusion caused by an excess of self consciousness.
  61. University, not! by Anonymous Coward · · Score: 0

    That would be Dartmouth *College*!

  62. Re: In 3, 2, 1... by angel'o'sphere · · Score: 1

    I basically only worked with UCSD Pascal. At its time it was the most widely used Pascal.
    Turbo Pascal on Apple][ s required CPM, which I did not like at that time. But I regret that now. Oh and I programmed network databases (hierarchical DBs) in Pascal on VMS.
    With 'standard' I more meant 'market leader' ... should have been more clear.
    Question is: did their even 'normal' Wirth standard compilers exist? Or was basically every implementation their own mini language? Any idea?

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  63. Re: In 3, 2, 1... by AlecC · · Score: 1

    Wirth's own compiler obviously implemented his language. But that was a university Comp Sci compiler: it had to be good enough for students to hand in assignments. But otherwise, every compiler needed extensions. Which were fairly easy to add, and the language was generally good. I did many years of embedded development, with two RTOSes optimised to Pascal idioms. And I really wanted to follow the Pascal line of development to Ada, but was not able to. I entirely agree that Pascal is a much more elegant language than C and its descendants. But it was written as a teaching language, and C was written as a systems implementation language. And since systems are a much bigger commercial market than teaching. So people wrote and supported C compilers. So we are where we are.

    I think C/C++ is twenty years past it best before date. Not that it is a bad language, for its time, but its time should not be now. We should have replaced it, and haven't. And a replacement descended from Pascal would be nicer than one descended from C, though many devotees will damn me for saying so.

    --
    Consciousness is an illusion caused by an excess of self consciousness.
  64. Re: In 3, 2, 1... by angel'o'sphere · · Score: 1

    I started a year ago to write a Pascal compiler for the Java Virtual Machine. Based on Open .architecture ware/extend/expand, but after I had 90% of the syntax punshed in I lost interest (still 90% way to go to actually generate Java Source Code to compile)
    But yes, I agree. Pascal was an awesome language. Consider to teach one in our days C/C++/.Net/Java.
    For the simplest thing in Java you already need a 4 month course and back ground knowledge?
    Why is the first line in a Java class 'package x.y.z'? Already a two hours lecturing about packets, visibility, signing etc.
    Why is the first word to declare a class usually 'public' ....
    Untill you can start explaining simple concepts you have wasted hours with "ignore that for right now, we will come to that later" explanaitions.
    Java - and that is true for any other modern language - is a HORRIBLE first programming language TO TEACH.
    Pascal was superb simple: consts, emumerations, sets, types, records, variables, persistence of records ... everything declared and used in a logical chain in your source code. In fact I miss it. The OOP Pascals imho took a to complicated approach otherwise we still very likely would use Pascal, on a .Net or Java VM.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  65. Re:In 3, 2, 1... by Anonymous Coward · · Score: 0

    The processor has a set bit instruction that would look like this in assembly:
      SBI PORTA,4
      which will set bit 4 on port A - *without* reading PORTA.

    You know SBI doesn't read PORTA.... how? Atmel's instruction set documentation says nothing of the sort. It also says that SBI takes 2 cycles to execute on many Atmel 8-bit AVRs which can execute a basic I/O register write in just 1 cycle. This strongly suggests SBI is being implemented as read-modify-write.

    Now let's look at the gcc statement. One would think it *reads* PORTA first then it ORs the content with 0x10000 then *write* the result to PORTA, possibly having some collateral effects depending on the hardware attached to PORTA (as compared to setting bit 4 without reading the port). Right? Wrong. gcc will "optimize" it to a SBI PORTA, 4.

    Reading PORTA can never have side effects.

    All this while they previously had a sbi() function to do exactly this, without any confusion. But they "deprecated" it so now you use the arcane method, praying that gcc will actually "optimize" it to SBI as promised.

    It really is not difficult to check gcc's assembly output, and recognizing this pattern is rather trivial by compiler standards.

  66. Re:In 3, 2, 1... by NapalmV · · Score: 1

    Reading PORTA can never have side effects.

    Sure thing? Even when you split it in both output/input lines, with one or two analog (ADC) inputs thrown in the mix? If this is implemented as an 8-bit wide IN followed by an 8-bit OUT, do you know the effect of the OUT on an input line (think enabling/disabling digital buffer and pull up resistor)?