Slashdot Mirror


Learning Programming In a Post-BASIC World

ErichTheRed writes "This Computerworld piece actually got me thinking — it basically says that there are few good 'starter languages' to get students interested in programming. I remember hacking away at BASIC incessantly when I was a kid, and it taught me a lot about logic and computers in general. Has the level of abstraction in computer systems reached a point where beginners can't just code something quick without a huge amount of back-story? I find this to be the case now; scripting languages are good, but limited in what you can do... and GUI creation requires students to be familiar with a lot of concepts (event handling, etc.) that aren't intuitive for beginners. What would you show a beginner first — JavaScript? Python? How do you get the instant gratification we oldies got when sitting down in front of the early-80s home computers?"

26 of 510 comments (clear)

  1. And why doesnt BASIC still work? by ninthbit · · Score: 5, Insightful

    And why doesnt BASIC still work? Any reason they can't still use BASIC?

    1. Re:And why doesnt BASIC still work? by dzfoo · · Score: 3, Insightful

      I guess the point of the submitter is that, back in the day, the rudimentary input and output of BASIC programs was rather de rigueur at the time, while nowadays such interfaces seem archaic and obsolete. Therefore, writing a BASIC program may not fulfill the expectations of someone who has grown up using a GUI environment.

      This is, of course, bullshit. Making a computer write "Hello World!" or your name across the screen repeatedly by your own device is as much fun, intoxicating and empowering today as it was 30 years ago.

      Of course, those wishing to sit down and write a multi-player, 3-D rendered, high-performance game for the iPad after spending a week reading a "For Dummies" book; they will be thoroughly disappointed.

      This is no different from how it was in the 1980s. Writing my name across the screen repeatedly was about the most interesting thing I could coax my C=64 to do after a perplexing read of the instruction manual.

      Eventually, I had to learn some very complex concepts in order to advance further than that and really get control of the machine. Things such as interrupt vectors, bitmaps, movable object blocks, RAM/ROM addressing, data structures, flow control, memory maps, Boolean algebra, non-decimal number systems, etc. Sure, these may not be high-level abstractions, but they are nonetheless sophisticated, non-trivial concepts, and just as hard to master to the uninitiated.

      Perhaps because of their decidedly low-level detail, they may be even harder to grasp than modern platforms, which are by their very nature, designed to match closer the way humans think and work.

      Having the curiosity, interest, and aptitude to learn and master complex concepts is what distinguishes the amateur programmer from the casual user. These are traits inherent to the person, not the subject or the tools, and they are as present in today's generation as in past ones. Moreover, they transcend languages, cultures, and even platforms.

                -dZ.

      --
      Carol vs. Ghost
      ...Can you save Christmas?
  2. I like Ruby by jarich · · Score: 4, Informative

    It's lightweight, portable, and has a ton of interesting projects for learning. Start here at http://www.ruby-lang.org/en/ Check out the "Try Ruby in Your Browser link" on the right hand side.

    1. Re:I like Ruby by mcvos · · Score: 5, Informative

      If I recall correctly, Ruby also has Hackity, a programming environment specifically for kids.

    2. Re:I like Ruby by jarich · · Score: 4, Interesting

      I've not used it, but here's the link: http://hackety-hack.com/ Looks like more of a general purpose intro for beginners to Ruby and/or coding.

  3. Processing by zerosomething · · Score: 3, Insightful

    http://processing.org/ it's easy and gives immediate gratification.

    --
    It all starts at 0
  4. There's Alice by rsilvergun · · Score: 3, Informative

    Google it. Especially if you like the Sims, try the 3.0 beta. Other than that I'd second HTML + Javascript. You can very quickly get up an running with something fun and interesting.

    --
    Hi! I make Firefox Plug-ins. Check 'em out @ https://addons.mozilla.org/en-US/firefox/addon/youtube-mp3-podcaster/
  5. Re:what I did by i+kan+reed · · Score: 5, Insightful

    God no. Visual basic is a very syntax sensitive language with huge libraries. It is like the anti-beginner language. Even microsoft's other major .NET offering(C#) is better.

    My reccomendation is python, with a lean towards using graphics libraries like vpython. Being able to go mysphere=sphere() is glorioiusly simple and have it show up in 3d is grand.

    Python has the following features that are great for learning:
    interactive debugger- type your program line by and and see what each line does.
    english-like syntax(except elif). As much as possible, python is designed to be written as it would be read out loud. eg: for item in array: print item
    at the language level, absolutely no machine restrictions. Integers can get as big as your ram, no pointer math,

    It's almost certainly the best choice.

  6. Early 80's? by numb7rs · · Score: 3, Funny

    "How do you get the instant gratification we oldies got when sitting down in front of the early-80s home computers?"

    By using a language that has lasted through that time to this one: Fortran.

    Fortran is still one of the most widely used languages in scientific applications, and is a great starting point for beginners.

  7. Different expectations makes gratification harder by mhamel · · Score: 3, Insightful

    When I was a kid, the computer i programmed for (trs-80), was one of the first computer I ever saw. There were not that many programs for it. So it was easy to get excited about almost nothing.

    Now all the kids have been exposed to all sort of technologies. They'll never get excited by very simple things like I have been. The thing to remember is that it will never be has rewarding has it was at the time for such simple things and no language is going to change that.

  8. TI-BASIC by gman003 · · Score: 3, Informative

    Grab a TI calculator. Learn the slightly weird version of BASIC installed on them. That's where I got my start.

    You can write an actually useful program in just a few lines. It's got a few simple data types (floats, strings, lists and matrices), has a few basic functions (Disp, Input), and all the common language constructs (If-Then-Else, For, While, Goto). There's a few oddities (assignment is reversed, instead of "a = 2" you have "2 -> a"), and there's no proper way to declare a function (you can either make another program and call it, or use goto), but you can do a surprising amount with it.

    I programmed those for a year or so. Tried learning assembly to get around the limits of Basic (mostly the speed), couldn't do it. But I did get into C++, and later all the other "real" languages, and am now pretty much a real programmer.

  9. Re:what I did by fuzzyfuzzyfungus · · Score: 3, Funny

    Are you implying that my habit of using "elif" in natural-language conversation may be marking me out as some sort of deviant geek weirdo?

  10. Logo and ML by markov_chain · · Score: 3, Interesting

    I learned BASIC first. When I was shown LOGO, I wrote a few lines of code to draw a Sierpinski triangle, and thought to myself: there is no fucking way this can be this simple. It worked, though, and sure got me to appreciate the weird academic languages.

    --
    Tsunami -- You can't bring a good wave down!
  11. Scratch got my 6 year old started by ZekeSMZ · · Score: 4, Informative

    MIT's Scratch ( http://scratch.mit.edu/ ) has gotten my kids started with programming. It's fun, and teaches all the fundamentals necessary for learning programming logic.

  12. Simple stuff has been done by fermion · · Score: 5, Interesting
    It is not so much abstraction, but required basic skills. What one needs to do today is different from what a person had to do 20 years ago. Today only a small subset has to be able to manage memory, or write sort routines, or think carefully about parameter passing. Now the skills are designing objects, applying design patterns, writing short segments of procedural code, and, increasingly, writing code the will run parallel. I can code, but that last one is nearly beyond me, but will be critical for anyone who wants to do serious work.

    I too started with basic in middle school but it did not teach me much. In high school we did fortran, which taught me mad skills, then I taught myself C and C++. I still think C is important for people who want to do serious programming as it does not have the cruches of the other languages, is simple enough to be put in a two hundred page book, and will teach everything one needs to know about debugging and basic design.

    In terms of instant gratification, I would suggest writing web apps in python. Most of the GUI stuff is taken care of by the browser, Python takes care of parameter passing to and from the user, and one can teach all the concepts, aside form parralel programming. A kid can write any number of games and if one has access to a web server, it can be run anywhere there is internet access. Such a thing can be great motivational tool.

    --
    "She's a scientist and a lesbian. She's not going to let it slide." Orphan Black
  13. Scratch -- the latest from MIT for kids... by mengel · · Score: 3, Informative

    You should definitely look at Scratch, which is designed for kids, even (especially?) kids who don't type very well yet, yet it teaches them programming skills. This is the same crowd who initially did Logo all those years ago, and they think this is better...

    --
    - "History shows again and again how nature points out the folly of men" -- Blue Oyster Cult, 'Godzilla'
  14. Re:what I did by CastrTroy · · Score: 5, Interesting

    Python is not a good solution. Especailly if you are worried about syntax sensitivity as your parent poster was. Sure white space is a good thing to organize your code, but the actual execution of your program shouldn't be changed by the lack of whitespace. Python is a pretty good language overall, but forcing beginners to understand that whitespace makes a difference in how something executes is asking for trouble.

    --

    Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
  15. Re:what I did by DrXym · · Score: 4, Funny

    I'd recommend Brainfuck. It has no library at all to confuse beginners and only 8 commands.

  16. Start with what you find easiest and move to C by ajs · · Score: 3, Interesting

    Python, Perl, Lisp, Scheme, BASIC, Java, JavaScript, shell... it doesn't matter. Pick up whatever feels most comfortable, or whatever tool is most readily available. Learn the basics of flow control, data structures, and the most fundamental algorithms. Learn how to debug, document, log, build, install and maintain.

    Once you've mastered these basics, move immediately to C (not C++). Programming in C will teach you what it is that you're actually doing in that high level language, and force you to manage everything that you want to do. You don't just instantiate a new class to get a thread or forget about that variable's storage when you're done with it. You have to think about the details and understand them, and even if your entire career is spent writing Python, you still need to understand these things. I'd recommend assembly, but there's a lot more well documented sample code in C to work from, and getting larger projects done in C is still practical, if somewhat painful.

    Once C is something you're comfortable with, trying out C++ is an excellent next step, but that's probably best determined by what you want to / have to work on.

  17. Pascal (history, not recommendation) by icensnow · · Score: 4, Insightful

    What I find amusing is how completely Pascal has disappeared from both historical memory and current usage. Some of you may remember the 80s for Basic on a C64, but I remember a huge bandwagon for Pascal both as a teaching language and as a working language. (I am not advocating Pascal, just reminiscing.)

  18. Assembler by Narishma · · Score: 3, Interesting
    --
    Mada mada dane.
  19. Re:what I did by dkleinsc · · Score: 4, Informative

    As somebody who writes Python professionally, I'm a bit biased, but can say with some assurance that the whitespace thing is not a major problem in the Real World. It's certainly no more of a problem than any other technique for designating a code block.

    Compare these:

    ' Basic
    If a == b Then
          do_something()
    EndIf

    /* C and relatives */
    if (a==b) {
            do_something()
    }

    ; LISP and friends
    (if (== a b)
        (do_something))

    # Python
    if a==b:
            do_something()

    Are you seriously suggesting that the last one is more confusing than the others? If your blocks are large enough that they can't easily fit on a screenful, you have other problems not related to your language of choice.

    There are things to go after Python for, but whitespace is definitely not one of them. My take on its strength as a teaching language is that it can do really simple beginner stuff and really advanced stuff with graphics and sound (with the right libraries installed).

    --
    I am officially gone from /. Long live http://www.soylentnews.com/
  20. Re:what I did by Anguirel · · Score: 3

    If you format nicely, sure, that's true enough, and while I'm a fan of teaching proper indentation, your examples are technically incorrect (the best kind of incorrect!).

    Your code in BASIC:

    ' Basic
    If a == b Then

          do_something()
    EndIf

    Functions identically if you do this:

    ' Basic
    If a == b Then
    do_something()
    EndIf

    Or even this:

    ' Basic
                If a == b Then
    do_something()
          EndIf

    However, in Python, I believe this:

    # Python
    if a==b:
            do_something()

    is not identical to this:

    # Python
            if a==b:
    do_something()

    or more specifically, not identical to this:

    # Python
    if a==b:
    do_something()

    And even if that is functionally identical (due to the brevity of the snippet), a larger structure which requires varying levels of indentation would not be. This would, admittedly, be painful to look at from an experienced programmer's point of view, but having no indentation is how I remember learning to write in BASIC the first time (since line numbers and explicit structure end syntax controlled flow anyway).

    That all said, from what I know of it (and I've only briefly used it several years back, so my knowledge may be out of date or mis-remembered), I'm in favor of Python as a learning language (and a language in general), but I can see the potential concerns for teaching if one doesn't expect the student to be able to maintain perfect (or even good) indentation formatting for some reason. Having explicit non-whitespace characters control program flow might be slightly easier for a new programmer to understand -- and using an editor that automatically indents code based on those characters would help them understand good formatting (along with helping them see the code structure form as they write), and enable them to transition quickly to Python later, where you're essentially just dropping the explicit curly braces in favor of implicit ones using indentation.

    --
    ~Anguirel (lit. Living Star-Iron)
    QA: The art of telling someone that their baby is ugly without getting punched.
  21. How about an easy graphical language? by jandrese · · Score: 3, Interesting

    Back in the day I learned a lot from programming Hypertalk (Hypercard) on my parent's Mac LC. Despite the somewhat heavy syntax sugar, it really let you do a lot with very little, and all of that sugar meant that you could figure out what is going on by simply looking at the code. I'm still annoyed at Apple when they started shipping the player instead of the full development environment, and when they eventually dropped it entirely. The code is still around, but it's wildly overpriced for kids and example code is much harder to find.

    Still, the ability to put a button on the screen, and then pull up the code in the button to find:

    on mouseUp
    ask "Please enter a number"
    put it into theNumber
    answer "You entered " theNumber
    end mouseUp


    That's the sort of thing you can build off of very easily.

    --

    I read the internet for the articles.
  22. Re:what I did by pclminion · · Score: 3, Informative

    or more specifically, not identical to this:

    # Python
    if a==b:
    do_something()

    That is not permitted in Python. It is a syntax error. You must either list a statement on the same line, or begin an indented block. If you want an empty block, you use the 'pass' statement. See, it's almost as if there are features designed into the syntax to help prevent mistakes. How odd.

  23. Re:what I did by gstoddart · · Score: 3, Insightful

    There are literally, only two down sides to python's use of white space. One, some editors do really dumb things.

    Oh god, this.

    Years ago I got into a bit of a row with a co-worker. He liked two space tabs, and insisted on using emacs, which is fine ... except emacs replaced a series of tabs with a single tab (or something) that it interpreted as needing to be indented according to its own rules. But left the file unusable for everyone else because they weren't privy to these fancy rules, they were just text editors.

    Basically, every commit he made looked like the entire fscking file had changed. It took days for him to understand that I don't care if he sees tabs as 2, 4, or 8 chars ... but if he couldn't make the resulting output something which I could still edit in vi or every other editor we used, I was going to lock him out of CVS. Because once the file had been edited in emacs, it was fucked up for anybody not using emacs. When the display preferences of your editor start to affect other things, it's bad -- you can't break it for the lowest common editor just so you can have syntax highlighting in emacs. He didn't seem to understand that I wasn't complaining about his visual preferences, I was complaining about what it was doing to the actual source files.

    I'm not sure I agree with your arguments in favor of whitespace being syntactically meaningful (I personally think it's stupid) ... but, the amount that I code has dwindled over the years, and it is what it is. My exposure to Python a bunch of years ago left me with a very bad impression of it as a language as it seemed to rely on/advocate some really poor coding choices that when carried into a different language made for absolute shit code -- C does not benefit from that kind of layout, in fact, it becomes absolute crap.

    (Actually, I vaguely remember letting someone else go who wouldn't adhere to our coding standards ... he didn't seem to understand that it wasn't his own personal code base, and that far more than just him was affected by his choices. He seemed to think that I was stifling his creativity, as opposed to protecting the integrity of a huge code base which had been around for some years and represented the product as built by people far smarter. No great loss, he was fairly useless anyway.)

    --
    Lost at C:>. Found at C.