Title says it all, really, I’m not asking for much.
Recently, my girlfriend asked about what languages were good for a beginner to learn. Her sister is interested in computers and is going to be going to community college soon, and wants (or at least, is wanted) to prepare for possible classes in programming by learning a simple language which will teach her the fundamentals.
Myself, being born of a number of languages, Common Lisp and VB6 as well as others, immediately thought, “Scheme.” I soon realized though that, if this girl is going to community college, chances are they don’t really want to teach her to be a brilliant, deep thinking, professorial type of person, but rather a run-of the mill, decent, get the job frakking done coder. Now I want to say, run-of-the-mill coders are not run-of-the-mill intelligent people, they are often orders of magnitude smarter than most. Maybe I’m bias, but to give some perspective, I consider my father, who has a Bachelors degree from Northeastern University in Boston, and about 25 years of experience in the field, to be a run-of-the-mill coder. There is noone on the planet who I think is smarter than my father, not even me. Now that you have that nice perspective thing. Realize that though Scheme is a wonderful language for learning about CS as Theory, and even Math to some extent. It presents an unfortunately distorted world view. In the real world, we write code in an imperative style (though thats slowly changing, and I’m quite happy of that). In the real world, we write code in C, Java, or similar languages. In the real world, we write mostly object oriented code. In the real world, we generally solve problems iteratively using arrays as a principal data-structure– not recursively with lists as a principal data-structure. So I said to my girlfriend, “Well, you have a few options.” I continued to think about what makes a good languages, heres my list:
- Easy to Setup
Chance are, if this is your first programming language ever, you might not understand all the intricacies of setting up a compiler/editor chain, or an IDE, or whatever, so this is obviously critical. You can’t use a language you can’t set up. This is why languages like VB are so popular, in my day, Visual Studio was trivial to install and use, and thats why I used it. I could have just as easily learned C or C++, my brain was plenty big enough for them, but I couldn’t grasp all the arcane mysticism of the GCC compiler at that time, so how was I supposed to do anything? In this area, I think Scheme beats Java, Notably, mzscheme’s DrScheme, which I still use when I write scheme code. It is an excellent, intuitive IDE for Scheme, It just works. It’s as easy (if not easier) than VS was to install, and I really wish I had found it before Dad’s copy of VS. Java, though I think a better “real world” option, is a little tougher to set up, obviously a editor/compiler chain, though a wonderful, no-frills way to write code, is not necessarily as intuitive to a complete beginner as a nice IDE. Since Eclipse (admittedly, the only Java IDE I’ve ever used) is not designed (like DrScheme is) to be used as a learning tool, there are alot of superfluous things that I, as a seasoned Java programmer, might use, but to a beginner, these things are just clutter. Clutter, as far as I’m concerned, means confusion.
- Good Errors
I’ve known many languages in my time, and many– many of them had the worst, most inconceivably bad error messages in the world. It’s getting better, but even now — with languages designed for teaching, like haskell– the error messages are archaic and often unreadable. Now mind you, they are only such to the uninitiated haskellers, and as such, I don’t have a problem with trying to decipher “ambiguous type variables” and type errors and other such things. But to a beginner, all these kind of errors perpetrate is the myth that writing code is hard, and something that should be left to the realm of the ubergeek. So my opinion here is pretty standard, Good Errors => Good Beginner language.
- Results Oriented
So, by now, you probably want to know what I thought was the best language to learn, well- I didn’t pick just one, but for what its worth, here is my list of the top few good beginner languages:
- Scheme or Java
- Other Web Languages (PHP, ASP, etc)
- Haskell/Erlang/ML et al
Those rate from one being the absolute best language I think a beginner should learn to 10 being the absolute worst language for a beginner, I split up C/C++ because the object oriented stuff in C++ makes it even more complicated than just C alone with its pointers. Between gcc’s mild, jovial inanity, and pointers, makes C just a little to tough to make me think it’s a good option for a beginner. I want to mention that I am not judging these languages absolutely, I know most of them (though I have considerably less experience than I would like in most of them) and think that they are all quite wonderful. I’d especially like to learn Python soon. It’s been a while since I picked up an imperative language.
Oh, by that way– I only tossed Assembler on the list to make the list an even ten. Assembler is a terribly confusing subject to the uninitiated, and makes a good +infinity on the list. I suppose the list should also have a 0, which would be the metamagical mythical languages of “JustRight” where no matter what you type, there are never any bugs, it compiles and runs in optimal space and time, all NP problems become P, and magical unicorns prance in fields of cotton candy and happiness outside your cube.
Then again, you could argue JustRight would present a distorted realworld view too.