I'm going to teach programming to somebody who's going to study it more formally in a year, but wants to be learning part of it in the mean time.
What SIMPLE, CLEAN, STRUCTURED language would you recommend me to use for teaching? Please, refrain from language wars as this is not a fanboy thread but a serious question. Before yuo mention it, I'm not going to start with either Python or Ruby because they're too complex and get too much in the way, and no, I'm not stupid enough to start with Java because a radical OO language (and a crappy one at that) with a shitty enterprise API is not the best either.
I'm thinking Pascal. As much as it sucks, it has strict/anal types (it's better to start anal than to start easy-going and botch it), simple yet not messy syntax, simple stdin/stdout input and output to play with (that's all I'll need), and none of the complexity of OO. Yet it sounds so useless. But I don't know of other languages that meet these requirements.
Name:
Anonymous2006-09-19 21:19
>>1
if you're willing to give up anal types (which i'd personally recommend) TCL seems to be a good choice. the syntax is very simple, and a handful of common commands can be learned in minutes, but the language is powerful enough to do pretty much anything he'll likely want to use it for at this point. it can also be run interactively, allowing for instant gratification.
this lets buddy learn the basics of program flow and I/O without having the language itself distract him. once he's figured that out, then you can worry about the boring ugly stuff like data types and null pointers when you teach him C.
Name:
Anonymous2006-09-19 21:49
>>1
My first formal course in programming used OCaml (with no reference to the object-oriented aspect), and that's a pretty good learning language, which, unlike Scheme, has types (a nice way to understand complex data structures) and a standard library that makes it usable in real life as well.
It allows for a mixture of different programming styles that may get somewhat unsavory though, if you teach too many (the same problem Perl can suffer from in the hand of beginning students). So Clean might be a better idea, although you can't call it a popular language.
Name:
Anonymous2006-09-19 22:23
real men learn AMN based languages such as B, where strings are arituary. (or not really defined as such)
But then i'm not sure you cna call it a programming language as such? It models specifications but allows you to go all the way through towards an implementation.
Obviously, i'm not recommending this as a first language.
I begun on Visual Basic (omfg) back when i was 15. I may not be so experienced as you guys, but this language is 'decent' as a starter, provided a few things:
You guide the guy in reguards to programming style. Bad habbits are really easy to pickup early.
Teach him its not THE godly language (as i guess many people who started on xxxx language seem to appraise it?).
I'd recommend VB for the following reasons:
using m$'s IDE, the student can learn a few points about GUI design as well.
Being able to make a GUI will actually encourage a newbie programmer to think before they code. (Most students will visuallise what they want their app to look like, thus they will think of what is presents, thus what data is required, thus what operations etc.etc. teaches refinement and synthesis.)
The language is easy, sequential and has many premade functions he can use.
Being sequential, they'll find programming in it easier. Obviously there are many sequential type languages, indeed every language supports sequential programming. But you do not want to overwhelm the poor kid with OO and what not.
Having premade functions will allow the kid to branch out and 'explore' what he can do. (Oh look, i've made this cool command line notepad thing... maybe if i integrate this with the inbuilt networking protocols i could build me a chat client etc etc) Of course, once the kid gets teh basics down you can ask him to make his own versions of functions.
I guess VB can be loosely typed, but just enforce 'option explicit' and stuff.
And no, im not calling VB a godly language. I much preffer more elegant languages, but the kid has to start somewhere. And why not start off where many have? Theres many guides tutorials etc...
Plus, being able to make a GUI, the kid might take a liking to it. Also introduces him to event driven programming later on.
In first year in uni, they started us off on Haskell. They focused on teaching us the basic principles of programming, and the basics of teaching us how to solve problems programmatically.
Haskell may be obscure, but it certainly does re-enforce certain values.
C is decent for technical minded people, but for beginners? The technicallity of it all may overwhelm him.
Of course, the final decision is actually the kid's.... But remember to consider how experienced he is, how much time he wants to dedicate, and how enthusiastic he is?
An enthusiastic kid wouldnt mind diving straight into C, where as a mildly interested kid, will only be frustrated by C, calling it ancient, archaic and completely useless. (but of course they'll learn its use later on).
After starting the kid off on some language and teaching him the basics, i'd probably try to teach em Java. (*gasp*)
Despite all the haters of Java, its a decent language to teach Object Orientation in. I'd have to say its rather important to instill the concepts of OO early on. So that they have the advantage of being able to solve problems both ways and selecting the right method where appropriate.
I guess if they started on C, they could move on to C++ , but then theres the whole thing where the kid could be lazy and default back to programming in (sequential) C more than using OO principles.
If the kid likes electronics, why not introduce him to a basic FPGA? or an AVR or ARM board afterwards? Tho i doubt many will take a liking to such low level things.