Learning Programming In a Post-BASIC World 510
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?"
And why doesnt BASIC still work? (Score:5, Insightful)
Re: (Score:2, Informative)
And why doesnt BASIC still work?
Because Apple has banned it from the iPhones and iPads that most of the "cool kids" are using nowadays. In fact, Apple pulled a Commodore 64 game from the iOS App Store [google.com] solely because the player could reboot the emulated C64 into the REPL of ROM BASIC.
Re: (Score:3, Informative)
Because Apple has banned it from the iPhones and iPads that most of the "cool kids" are using nowadays.
Bogus. All interpreters are banned, not just BASIC.
And they run javascript sites just fine, some [calormen.com] of [osaware.com] which [yohan.es] implement BASIC [quitebasic.com].
Re: (Score:3)
Re: (Score:3)
I suppose, but it's also a community thing. My brother learned to program at a young age mostly by typing BASIC code from hobby computer magazines, by recording binary from hobby computer radio shows. Do such magazines and radio shows still exist?
Well, of course there's the Web with more stuff than there ever was in the past, but that can also make it harder to find what you really need. For example, are there any introductory programming websites in Dutch? English might be an extra hurdle for non-native sp
Re: (Score:3)
I started with Applesoft BASIC myself.
Honestly, I, it took me a long time to get over the bad habits that BASIC taught me, as it is so far removed from modern languages that its barely worth discussing.
It only had the most basic concept of subroutines, no functions. Line number based references? No concept whatsoever of memory allocatio or lexical scoping....
I would say that C is great, even if the vast majority of the time, doing memory allocation "by hand" sucks and delivers no benefit. However, most work
Sorta (Score:2)
Sorta. I dunno about others, but what got me interested in programming when I was a wee little lad was that I could make something fun and immediately see the results. All games on my parents' old ZX-81 with 1K RAM (yes, 1024 bytes of RAM, total) were really far more primitive than your typical cell phone game these days. It wasn't hard to get ideas like "I can do better" and actually do so. I actually invited a few friends to play my own primitive strategic bombing "simulator", and they actually found it f
Re: (Score:2)
I tried BASIC as a kid. Hated it, so I stopped learning to program. A few years later, I stumbled across C++, loved it, so I started to program. I found ASM much more fun than BASIC.
I felt like I was scripting with BASIC, wanted to tell the CPU what to do, not what the scripting engine should do.
Re:And why doesnt BASIC still work? (Score:4, 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.
Android (Java), Flash (Flex), Objective-C (OSX) (Score:2)
I like Ruby (Score:5, Informative)
Re:I like Ruby (Score:5, Informative)
If I recall correctly, Ruby also has Hackity, a programming environment specifically for kids.
Re:I like Ruby (Score:5, Interesting)
wxPython (Score:2)
wxWidgets and Python are a good combination of easy to learn and visually satisfying results. The later being for positive reinforcement. Oh. And using it to write more practical programs in the future isn't hindered by a boat load of patents.
This story is re-run monthly under different title (Score:2)
http://ask.slashdot.org/story/08/07/22/0452225/How-To-Encourage-a-Young-Teen-To-Learn-Programming
http://ask.slashdot.org/story/10/07/30/2150208/How-Should-a-Non-Techie-Learn-Programming
Someone should keep track of them. Maybe stash them in some "Learn to Program" folder on Slashdot?
JavaScript (Score:3)
I'd say go for the JavaScript. The learner already has the instant gratification of an HTML document. Then add a button whose onclick handler changes the button's value to "Hello World".
How is event handling unintuitive? "When this happens, do this and this and this."
Re: (Score:2, Insightful)
I would say python. As event driven is not something people get right away. But people can think in sequences.
What trips people up is 'button click', 'magic happens', 'your code is called'. That messes with people for some reason as the 'magic happens' means they do not control it. When you are starting out you want some feeling that you control it.
Re: (Score:2)
It worked great as a beginning course. The ability to just run the script in the browser, and to build something "cool" in a matter of minutes, really opened their eyes to a whole new world on th
Re: (Score:3)
Re: (Score:3)
I would concur on Javascript. No need to buy or learn a complex IDE, easy to learn and use like BASIC with the ability to print lines without complex GUI concepts, and just about any laptop or PC with a web browser and a basic text editor is ready to go.
Re: (Score:2)
Yeah, and the platform environment is ridiculously easy to use, and tools people are familiar with. Text editor -> save with extension .html -> open in browser (reload to see changes). Just about anything else is nightmarish by comparison.
How is Python different than Basic? (Score:2)
Good starter languages? (Score:3, Insightful)
Re: (Score:2, Insightful)
Scheme?! You've got be kidding!
Processing (Score:4, Insightful)
There's Alice (Score:4, Informative)
BASIC is and has always been terrible (Score:2)
The only thing it will do for you is give you serious brain damage. Python is widely recommended as a good starter language that is also good as a serious language. Following from that you can easily branch to Perl, Ruby, Haskell, even C (which I recommend learning after Python if you can).
VB or C# (Score:2)
Re: (Score:2)
starter languages (Score:2)
I think the language doesn't so matter so much as the time that is put into it. In the summary basic was given as an example, and I'm sure the basic he's talking about isn't considered good code these days. No object orientation, plenty of gotos and so on. The thing is he spent time on it, and from that language went to others.
With this in mind I would say that today there are plenty of good starter languages. My suggestion would be python, which introduces a number of good habits. It also has the advanta
Go with Ada (Score:2)
Alice (Score:3)
I recently heard (though not used) about Alice [alice.org], which sounds interesting for at least introducing programming concepts.
just use basic (Score:2)
Early 80's? (Score:3, Funny)
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.
Different expectations makes gratification harder (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.
No modern languages are hard (Score:2)
Python has always been trivial to get started in. I taught my 9 year old to program in python in a few hours.
Java is easy to use, and the syntax is clean.
C# is basically a clone of java, so the same applies there.
You don't need to learn object orientation to use any of these languages. Sure, you probably SHOULD, but you can learn java programming solely in the main() if you just want to learn the basics. Even moreso wi
teach them right! (Score:2)
Have them learn LISP.
Probably not the root of the problem... (Score:3)
However, you run into the rather messy problem that off-the-shelf examples of software have(both in terms of software complexity and in terms of ancillary stuff like graphics and sound assets) Vastly increased in number, sophistication, and availability. This makes it harder to engage any would-be-learner who isn't explicitly interested in programming by sucking them in with the cool results.
Back when daddy borrowed the company Compaq Luggable so that he could work on spreadsheets on weekends, your choices for computer entertainment were pretty much "Lotus 1-2-3" or "Make your own damn fun with basic". Option two was pretty attractive even if you really just wanted some games and only became interested in what made them tick later.
Nowadays, when we have all removed the onions from our belts, hypothetical kiddo is enormously better tools and documentation at his/her fingertips; but is also comparing the rudimentary results of a beginner against products of 2-3 years of effort by a professional design team, backed by artists and sound guys, available for 20-50 bucks off the shelf. Even the sort of flash games that will load about as quickly as the Python 3.2 reference manual will are comparatively polished and intimidating.
Arguably, it might actually be better to start beginners out with more physical projects: Sure, robotics has also increased enormously in sophistication and power; but high end robots are still expensive and uncommon, and there is a more visceral "wow" factor to "Hey, I hammered out the feedback logic that allows my little *duio bot to follow lines" than there is to "Oh, I've just produced 10% of Zork; but less witty and 25 years late. Let's go play Medal of Life Half-Gear Assault 2011."
TI-BASIC (Score:4, Informative)
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.
AppleScript (Score:2)
Logo and ML (Score:4, 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.
Comment removed (Score:3)
Scratch got my 6 year old started (Score:4, Informative)
Simple stuff has been done (Score:5, Interesting)
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.
Good Open Source Games (Score:2)
Scratch -- the latest from MIT for kids... (Score:4, Informative)
What about PowerBASIC? (Score:2)
This again? (Score:2)
Sure, everybody will trot out supposed successors like Python
How I do (Score:2)
How do you get the instant gratification we oldies got when sitting down in front of the early-80s home computers?
Well I have a working Apple ][ around so that's not a problem to fix.
Python + Pygame (Score:3)
I've been teaching some kids how to program simple games using Python and the Pygame module (wrapper for SDL) with some success.
One problem I've noticed is that the kids aren't all that interested in programming the simple exercises, such as the "guess the number" game or programs that generate simple ascii art -- all stuff that was exciting to program in BASIC back in the day. I had a promising 12 year old student who was making good progress and had successfully made (with help) a side-view tank shoot-em-up game with two players. Guess what he wanted to do for his second project?... a StarCraft clone.
He was able to produce a random ground texture and to control a single "dot" to move where he wanted it via mouse clicks, and then he bogged down. He gave it a good try but the project was a bit too complex to provide easy progress.
I need to come up with some simpler project ideas that are still fun to create.
Today is better than 30 years ago (Score:2)
When somebody asks me who had the most influence on me on my career choices and inspired m
Beginner != Interface builders (Score:3)
For anyone suggesting VB, or Visual C#, or any of the other "Click to build the framework then fill in the back end", this is the worst possible thing an actual beginning programmer should be looking into.
I would assume from the OP that we're talking about people with no programming background. Taking someone like that, giving them a button to click to generate a UI, then having them fill in the blanks is #fail. They don't already know how to program. It would be like asking someone to complete a puzzle, in a dark room, where they don't know what shape the blanks are in the puzzle, or what colors they should be, or even where the front or the back is.
Interface builders are nice for people that already know how to program, because while creating UI's is tedious, it's also about the 10th thing to be done when building a program. People who have been programming for years can work backwards (Yes, UI to logic is backwards in all cases except for programmers-who-specifically-design-UIs, but that's not what we're talking about here) from the UI to the underlying program logic and the flows between UI elements, but someone new shouldn't be developing in this direction. They should be understanding how the logic behind the program works, in many different variations, before they go putting a pretty button in front of that logic to show the result in pretty graphical ways via some rendering library call..
BASIC, Lisp, Perl, Python, Java (not javaw or AWT), all are useful for the basic understanding of what a program is, what control and input and output logic is. As people have mentioned, Python and Java both have graphical toolkit extensions that can eventually extend your development to pretty pictures and not input/logic/output. If you really want some sort of "visual" developer to put in front of this person, go look into some of the "Blocks" development tools, like Google AppInventor, for example. These use interfaces analogous to puzzle pieces to represent the code in the application, and you can drag and drop inputs and outputs to hook into control statements to do things - sorta like the virtual programming equivalent of everyone's favorite Radio Shack 160-in-1 Electronics kit.
For the love of god, though - don't "teach" someone to program by putting them in front of a framework generator and having them "go at it".
Etoys and Python (Score:2)
My daughter (8 years old) will be learning Etoys [wikipedia.org] this summer, and when she's grown tired of that, Python.
The Navy did an exhaustive study of programming languages a little while back, and recommended Python as the best teaching language for high-school level computer programming.
I hope she doesn't stop there, but seeing as I haven't written any VIC-20 assembly, Apple ][ BASIC, or Turbo Pascal in nearly two decades, I don't think the languages are really what's important.
Start with what you find easiest and move to C (Score:4, 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.
There's nothing interesting and easy left to do (Score:2)
All the fun and cool stuff that is easy enough for a beginner is off-the-shelf these days. Why bother learning to program? The interesting stuff that is not off the shelf is no longer easy enough for a beginner who knows "X" to write programX.
python (Score:2)
Another good "all in one" option might be C#
New Instant gratification (Score:2)
It isn't as much the languages today but our level of instant gratification.
Back in the old days.
10 PRINT "HELLO"
20 GOTO 10
was considered kinda cool for your first program.
Or if you wanted to make a game...
10 PRINT "Your are in a room labeled Center where to go (N,S)"
20 INPUT $D
30 IF $D = "N" THEN GOSUB 1000
40 IF $D = "S" THEN GOTO 2000
50 PRINT "I do not understand your request"
60 GOTO 10
1000 PRINT "A Monster eats you... Your dead do you want to play again? (Y,N)"
1020 INPUT $D
1030 IF $D = "Y" THEN GOTO 10
10
Ruby (Score:3)
Kind of surprised it's not getting more love here.
(hey, not everyone's into the Python philosophy)
Pascal (history, not recommendation) (Score:4, Insightful)
Because Turbo Pascal made programming cheap enough (Score:3)
Turbo Pascal on the IBM PC worked extremely well and was cheap enough for everyone to afford. It was a killer-app all on its own. I don't even remember a C compiler being offered in the early days of the PC. And I don't know why there wasnt one. But all the Microsoft development kit was expensive except for the assembler.
Post-BASIC world? (Score:2)
As in what, 1987 and onward?
LSL - SecondLife, Python (Score:2)
If you want instant "wow" gratification, the closest I've come to that lately is with LSL, the second life scripting engine. Which affects the objects you make in the Second Life Virtual world. The interface is easy to use and the syntax is really approachable.
Second to that I'd say Python, mainly for its easy to pick up syntax, ubiquitous nature and the capability to do actual 'real-world' stuff with it as you develop skills.
Assembler (Score:4, Interesting)
How about starting with assembler?
http://altdevblogaday.org/2011/03/24/machine-code-is-for-kids/ [altdevblogaday.org]
Microsoft Small Basic? (Score:3)
http://smallbasic.com/ [smallbasic.com]
Small Basic (Score:3)
Microsoft Small Basic [smallbasic.com]
It's the best learning tool I've found so far -- it's simple and has an excellent help system. The auto complete has descriptions along side the text (encouraging exploration and discovery), the sidebar help automatically displays help for the current command, and the PDF tutorial is well-designed and simple enough for a bright child to understand.
Some of the changes are a bit odd, but they make sense. Next has been replaced by EndFor, for example, but this does keep things consistent with EndIf, EndWhile, etc.
The program itself is small (6mb download) and incredibly simple -- no weird options or anything to get in the way. It actually makes tools like Scratch look complicated!
Microsoft actually did this one right. I give it my full endorsement.
Compiler + exceptions = win (Score:3)
I'd recommend a compiled language with exception handling. I feel that makes it a little harder to get stuck/frustrated without any clues. The compiler keeps syntax in check. Exception handling gives a better clue as to why something is failing at run time. Of the major languages, I'd take either Java or c#. Eclipse or VS express, both solid and free IDEs. There are also tons of structured "learn this language" tutorials. Most also start with console apps which are a good place to start. I'd lean towards VS because I prefer visual studio. But from the academic value point of view, I don't see any notable difference between c# and java for the beginner. Obviously you'd go for Java if you're on a mac though.
Contrast that against something like javascript. It can be damn near frustrating trying to understand the DOM, the CSS inheritance, etc. That and simple syntax errors can prevent methods from loading, etc. Sometimes too much simplicity leaves a beginner without any sort of help. That doesn't even touch on browser compatibility.
Web or physical... (Score:3)
I'd start with one of two options: Web programming or physical devices. Either one lets you make pretty simple programs that actually DO SOMETHING.
For web, I'd obviously start with HTML/Javascript, then go into PHP. Or maybe skip Javascript at first, as it's a huge pain to debug. Point is, you can build something with a nice pretty GUI pretty quickly and easily, and PHP and Javascript will prepare you well (in terms of basic concepts and syntax) for more advanced languages like C or Java.
The other way to go -- the way I really went -- is to start with programming physical devices. I started with Lego Mindstorms -- you start with their programming language (drag-and-drop stuff), but that quickly becomes too basic, so you start looking into things like NQC -- basically a C variant that has a rather limited instruction set, specifically designed for the Lego microcomputer. It's a bit hard to learn on your own (I still remember asking for help with my first program -- "You need semicolons!" "...I do? Where?"), but if you actually read the tutorials or have someone to help you with it, it isn't too bad, and you can immediately see what it's doing. Something like an Arduino could also work, though it may be too complicated. I'm only familiar with the TI MSP430 Launchpad stuff, which is similar in design, but would be way too difficult for a beginner....but I gather that the Arduino has some easier programming tools.
How about QB64 (Score:3)
A teenager I'm acquainted with has been geeking-out with http://www.qb64.net/ [qb64.net] for several years. It seems to fill the niche that C-64 BASIC did for me and MS-BASIC and QBasic did for slightly younger geeks.
back-story (Score:3)
The "back-story" was always there, unless you go back to the 1940s or something. The BASIC programmer of 1981 didn't think about things like how does PRINT really work, the garbage collection that kept string variable storage from growing to infinity, etc. The abstraction and (temporary?) ignorance of the back-story is what lets you "just code something quick."
I think the reason things "feel" different now, is just that the back-story is longer and the abstractions are higher. When the 1981 BASIC programmer decided to dig deeper, it wasn't very long before he was working in assembly language, whereas when the 2011 Python programmer digs deeper, he's reading the source code to the library (most of which is itself written in Python) or maybe down in C and learning the OS' API calls. It's a deeper dig before you're thinking about transistors, but I'm not sure that's really important. You've got to start somewhere and really no matter where that is, you're going to start learning new things if you're interested.
How about an easy graphical language? (Score:4, Interesting)
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.
Go learn Perl 6. (Score:3)
If you want instant gratification and know how to code then you can call into C libraries with one-liners [wordpress.com].
If you don't know any programming at all then there's a whole series for you too [strangelyconsistent.org].
And if you write PHP then imagine what it'd be like without the bad hangovers from v3-4, with all the planned improvements from the 6.0 they abandoned, and with functions that use a consistent needle-haystack order everywhere.
Re: (Score:2)
Re:what I did (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.
Re:what I did (Score:4, Funny)
Re: (Score:2)
Here's a great place to start. [learnpytho...ardway.org]
And another good one. [greenteapress.com]
Re:what I did (Score:5, Interesting)
Re: (Score:3)
Huh? Why? I don't use Python, but I just don't see any basis for your assertion. Whitespace is how we arrange natural languages when written, so why not programming languages? It's perfectly intuitive, especially to visual thinkers.
Re: (Score:3)
Whitespace is how we arrange natural languages when written
If I resize my browser window so that your post linebreaks at "when written" instead of "especially to", the meaning of your post doesn't change.
Re: (Score:2)
Re: (Score:3)
Ithinkthatmaybeonlypartiallytrue.
Certainly by the time you're dealing with paragraphs and multiple sentences, whitespace actually does become significant.
I've never been a fan of whitespace being syntactically significant in a language, and my only exposure to Python was almost a decade ago ... that was enough to make me cringe. But, that could have been the guy writing it the code that I saw. But, it was complete crap and pretty much soured me on th
Re: (Score:3)
That is not entirely true. We have many 'whitespace' rules in written language. Like leaving a space between words, after periods or commas, etc. So in effect it is a combination of punctuation and whitespace. Many programming languages use punctuation as well, but not usually in the way written language does or at least not the same types (ending 'lines' in C++ with ; for instance).
Re:what I did (Score:4, Insightful)
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.)
Re:what I did (Score:5, 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).
Re:what I did (Score:4)
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.
Re:what I did (Score:4, 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.
Re: (Score:3)
if a == b: do_something()
Doesn't work.
Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on
...
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> if 1 + 1 == 2: print "yes"
yes
>>>
Re: (Score:3)
And the execution of your C program shouldn't be changed by the lack of curly braces... See, I can make dumbshit statements also.
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.
Even a computer-illiterate person can usually understand the concept of bullet points which have sub-bullets and possible sub-sub-bullets, and they "get" that the sublevels are encompassed by and related to the higher le
Re: (Score:2)
Definitely agree with Python.
In addition to all the points you made, there's one other that I find to be a great help for newbies: the sheer volume of libraries available. When 99% of the low-level stuff can be done with existing libraries, it allows the newbie to focus on the big picture and slowly work down into the details.
Re:what I did (Score:5, Funny)
Re: (Score:2)
Just fyi, any Python experience will serve them well when they reach high school and university calculous courses. The Python & Cython based Sage CAS is displacing Mathematica for calculous courses. There is also an LLVM based Cython & Python compiler that's helping liberate Python from various interpreted language bottlenecks.
I'd actually seriously consider some reduced subset of Haskell myself.
Re: (Score:3)
I would add Java. The Java haters will hate but Sun created a great set of tutorials to teach people how to use Java and they are still available on the web. Eclipse.org and Netbeans are great free IDEs that you can download. I would also suggest Squeak. If you are on the mac Objective C is available but may be a bit much for people just getting started. You also have Ruby, Perl, and Free Pascal which is really a good choice as well.
Of course you could go with the real replacement for Basic.
PHP!
Easy to use
Re: (Score:2)
Start with what ever you have.
RosettaCode [rosettacode.org] has a ton of different tasks for 385 (and growing) [rosettacode.org] languages. Find one (python, perl, php, bash, c, c++) that you can get for free and then
The biggest problem isn't syntax (IMHO) it's that people (at least mechanical engineers) don't grasp the concept of what a for loop, while loop, if statement, etc DO. If you break it down and explain it to them they "get it" a bit, but most are lost on their own. So pick something that you 'get'. Find a language that you think m
Re: (Score:2)
Re: (Score:3)
It's not about wonder its about learning the basics.
If you want fun and wonder teach the kids Pygame.
Re: (Score:3)
and that's where you're wrong. the initial question IS about wonder. I started messing with BASIC to make simple games on my C128 when I was 8. TFA is talking about kids.
what would you teach an 8 year old to do with bash?
Re: (Score:2)
Don't laugh! [calormen.com]
Re: (Score:2)
It's cool to make fun of PHP here. *shrugs* It's making me a fair bit of money to ignore them. ;^)
Re: (Score:2)
At UNSW (Sydney) we had Haskell in our weeder course, since it would weed out students with prior programming experience but without willingness to learn and adapt as well as it would weed out students without. This is because it is just so different from procedural programming that only a sound understanding of the underlying logic could save you. Always amazing how many students who program during high-school don't have much talent to be top tier, though usually the spend first year feeling arrogant until
Re: (Score:2)
There are a number of universities using Haskell for their intro to computer science courses. Haskell is a lovely language but maybe second only to C++ in complexity. You need not use all that complexity however.
Re: (Score:3)
ARM is supposed to have a pretty clean instruction set, so maybe even use ARM instead of an old 8 bit micro. x86 is ugly-- as a beginner, would stay away from it.
Um, ARMs may have a "clean" instruction set; but it is NOT designed for humans to code in!
I cut my teeth on 6502 assembler and Integer BASIC on the Apple 1 and Apple ][, and I am here to tell you that the 6502 is, hands-down, the easiest CPU to code Assembler in (6800 being a close, and somewhat related, second).
My suggestion would be to find a good Apple ][ emulator (I think that machine has been emulated on virtually (haha) every single platform). And with the speeds of modern CPUs, it is WAY easy to