tags:

views:

437

answers:

9

I guess it's a variant of the "Teaching my kids to program" language issue…

A little context is in order. At 60, my father is going to retire pretty soon (at least, soon enough that I need to start caring about that stuff). He is a very active person and I'm looking for occupations for his future free time, and one of these could be programming. While he is a history teacher, he is more than capable of it, as he was a early adopter of personal computing back when programming a computer was part of its normal usage; on the Apple ][e he programmed in BASIC little programs that, while entertaining for me (when I was 5), could not really be called games, and later on he taught me programming on this same Apple ][e (and I was only 8).

Most obviously my own starting path, Applesoft BASIC, which is also what he already knows, is no longer relevant in this day and age, and I'm not going to start by teaching him what I'm working with: C (not C++. C.). Too low-level. While he's not strictly speaking a beginner, it's better he restarts programming using one of these newfangled high-level scripting/programming languages I keep hearing about (irony intended): Perl, Python, JavaScript, Ruby, etc. Thing is, I know none of them, so I thought I'd ask here: what is the best language for that purpose?

I'm going to teach myself that language, then teach it to him, so the availability of online teaching material, while useful, is not a requirement. It would be best for the language to Make Sense™, i.e. have as few strange idiosyncrasies or historical arctifacts as possible, it should be obvious as much as possible. I would start with command-line programs, then move to GUI apps. Someone who has programmed line BASIC on an Apple ][e does not need a fancy environment. Popularity of the language, besides being "not dead", is not a big factor. Available bindings/libraries to platform functionality would be useful. Good error diagnostics and debugging is a must. While leisure is the main point, this would be put to use for automation, specialised computations, light stuff, at least at first; after, the sky's the limit. And of course, a new language is something that will be interesting for me to learn as well, since I'll be investing time in it, though that's more of a side bonus.

While these are mostly soft criterion, I do have one hard and fast requirement: it needs to run on Mac OS X. This is non-negotiable.

So, What would you recommend? Right now I'm leaning towards Python, 3.0 in particular.

Epilogue: Thank you all for your answers. I'm now going to install and try out the two winning propositions: Python and Java (with BlueJ), as well as a third: Smalltalk (with Squeak); after having investigated them, I will make my choice (and go ahead on the project with that choice), add a bounty to this question (the amount of which will depend on my reputation at that time) and instanty accept the answer which proposed that choice (I can obviously not put the bounty now, as it'll take me more than a week to choose); unless the choice is Smalltalk with Squeak, in which case I'll put an answer for it and accept it (without a bounty) (sorry wise guy, you cannot add an answer for Smalltalk with Squeak and hope to get the bounty, since you'll have put this answer after I decided to invest my time in it). It's the least I can do. It's not a problem that I don't have a single definitive choice from this question, I had intended to try out a few languages before making a choice anyway, and this question was very useful in coming up with a shortlist. In fact, all answers were useful in helping me clarify criterion and making me think about the project, so thank you all again.

+3  A: 

Python is a reasonable choice, but you could also try using BlueJ - a Java teaching environment. One benefit of Java is that it's so ubiquitous that there's a ton of tutorial stuff.

I don't think you said what you're father wants to use it for. That may make a difference. Alternatively, as you are learning it too, you might want to consider what's best for your career.

Of course, this is a topic that will run and run as it has "What's the best language?" elements to it.

dommer
poke-style comment: you might wish to check out the epilogue I added to the question.
Pierre Lebeaupin
+2  A: 

I think there are five criteria:

  • Language is as sandboxed as possible (can't GPF, array access bound checked, etc.). This eliminates things like C and C++, but opens the possibility for Java.

  • Language and tools provide meaningful error messages. Again, that eliminates a lot. Some great languages have completely unreadable error messages, which would mean you end up on the phone trying to figure it out.

  • It is possible to get obvious manifestations fast, preferably visually.

  • Language and tools are preferably free.

  • Language that has an interactive debugger within an IDE.

If you choose to go with one of the teaching languages, that might be a good choice, but they must be kiddie oriented.

I would suggest staying out of most scripting languages as they are not very intuitive to debug and to understand errors in.

I think Java is a great choice, especially as it comes with great free IDEs like Eclipse. It is possible to use it without having to know too much about OOP. It has an interactive debugger, and generally gives sensible error messages.

If your father eventually chooses to head in the GUI direction, there are friendlier lightweight APIs that are easier to learn and use than Swing.

If you were using a PC, I would say .NET/VB might be a good choice as well, but as a Mac fan, I have the same issue with MS technologies.

Uri
+6  A: 

Python is all the rage for beginners these days. And of course, it could be a fun project for both of you to learn together.

It also has the advantage that it's not limited to "just" being a beginners language. There are libraries available to let you do pretty much anything.

Given the information you've provided, that's probably the best option.

jalf
poke-style comment: you might wish to check out the epilogue I added to the question.
Pierre Lebeaupin
+3  A: 

Let me get this straight - you are going to teach your Dad a language you know nothing about? Speaking as an ex-instructor, the first requirement of teaching something well is having a deep knowledge of the the thing you are teaching. Your Dad sounds like an intelligent man - if he wants to learn any computer language, I'm sure he'll manage just fine given a computer (not necessarily a Mac, either) and a book written by someone with that deep knowledge.

anon
As I said "I'm going to teach myself that language, then teach it to him"; by the time we'll get to the "teaching to him", I'll have a good knowledge of it.
Pierre Lebeaupin
Well, that will be a couple of years down the line for a language and library of any complexity.
anon
+1  A: 

My dad also taught me Basic (the Quick kind) when I was a kid, and I taught him PHP a few years back. He's making a living off it now.

Andy Hohorst
A: 

You might consider going for something that has, well, basic similarities to BASIC. I think Python has an advantage in that respect since you can write a Python program that is just a sequence of statements which are executed in order - you don't have to bother with classes and objects, or even functions, at first. I'm sure Python isn't the only language like that but it's the only one I know. (well, actually Perl is like that too, but trying to teach a relatively beginning programmer Perl is asking for trouble ;-)

David Zaslavsky
You mean it's a procerural language ?
ldigas
Which it? Python? Python can be procedural or functional or object-oriented - it's very flexible.
David Zaslavsky
+1  A: 

When it comes to introducing an individual to the world of programming (or any topic of study), the language matters much less the teacher and curriculum. So, while I think python is an excellent language to start learning to program with, I must admit that Why's poignant guide to ruby is a very entertaining and non-intimidating introduction to ruby and programming basics. While not quite in the same vein, python does have several introductory texts as well (see the beginners guide).

vezult
A: 

Unless your father also enjoys chess, programming for the sake of it may get old quickly. If he uses the Mac for work, automation is a rewarding application. AppleScript is a horribly frustrating language, but Ruby and Python have great bindings for AppleEvents.

As a historian he could be interested in information management. All scripting languages come with DB access and have Wiki implementations to start from. VoodooPad for Mac comes with Lua and supports Python.

People with time for home improvement could go for hardware control. Arduino comes to mind (C derived).

Tobias
A: 

How about Excel?

Jim G.
Excel is not a programming language.
Hogan