Javascript
Reasoning:
Along with some really basic HTML/CSS anyway. Why Javascript, you ask? Because web programming is simple. Or, more accurately, because web programming has been optimized to let you do a few simple, introductory things really easily. When I was learning Javascript, I was building some simple interactivity into a (admittedly sparse / primitive) website in no time. It's probably easier to get started with Javascript than just about any other language.
Recommended tutorials:
Codeacademy's Javascript Track alongside its Web Track
Also, a good html tutorial if you don't want to use Codeacademy can be found here
Topic Checklist:
Basic I/O and control flow, making coding feel not-scary
Python
Reasoning:
After getting your feet wet with Javascript, I'd recommend learning in Python. The reason I suggest switching so soon (rather than getting more thoroughly acquainted with Javascript) is that there are simply more (and overall better quality) resources for learning Python. You have O'Reilly's Think Python, Codeacademy's Python Track, and MIT's OCW Course and their course on EDX (which there are apparently multiple instances of), and many, many more. Working in Python will help you get used to thinking in the more structured way that is required to code effectively, and will start to teach you some good habits in a relatively natural way.
In addition to that, significant whitespace is a great thing. Sure, it can create funny situations, but for the most part what it does is enforce clean code. And trust me, you want to teach novices to write clean code. I've seen abominations produced by those who weren't instructed in how-to-write-code-that-others-can-read, and I'd prefer not to have any personal responsibility in that. Granted, it's still possible to write unreadable code in Python, but it takes way more effort.
Recommended tutorials:
I'd recommend all of the tutorials I mentioned above. They're all really good, just go with whichever makes the most sense for your learning style.
Topic Checklist:
More control flow,
Loops,
More involved IO,
Basic Object-Oriented coding,
Thinking in code
Scheme
Reasoning:
Here's the one I might take some heat for. That being said, whenever you read about what some of the developer-"celebrities" (e.g. most of those interviewed in Peter Seibel's Coders At Work), almost always you find that they worked with Scheme (or some other Lisp dialect) early on in their coding-education, and did a lot of work with it and other functional languages from then on. The nice thing about functional programs is that they're much easier to reason about. Some of the tools feel way more powerful (functions as data being the main one about functional programming as a whole, alongside macros in Lisp specifically), but in my mind the chief benefit of relatively pure functional languages is what they *don't* have much of. Working with mutable state is much more of a hassle than in the previous few languages. The emphasis on linked lists instead of arrays. Now, why would I say that working with so much less is helpful? The reason is simple. Good code is easily maintainable code is easy to reason about code. And being restricted to the purely functional tools makes it way easier to figure out exactly what's going on with your program / where it's going wrong.
One important caveat though is that I have a very specific Scheme implementation in mind when I make this recommendation: Racket. Think of it as a batteries-included version of Scheme. Most of the tutorials for Scheme, unlike the languages above, don't talk much about the specific way to run it on your computer. The reason for this is that when you're working in Scheme (or other functional languages) you're not supposed to be thinking too much about the low level details of what the machine is doing. Instead, you think of the basic algorithmic efficiency, and reason about the program in a more abstract way. This emphasis on abstraction allows you to create lots of easily reusable code, that can be thrown at all sorts of different problems.
Recommended tutorials:
There's also about as many really good resources for Scheme as there are for Python. My personal favorites:
The old classic, still probably the best around, but not for the faint of heart: The Structure and Interpretation of Computer Programs
Slightly lighter but still on the tough side: How to Design Programs
Another great resource, for those who found the first two too dense: Realm of Racket
And, on a similar level with Realm of Racket: The Little Schemer
Topic Checklist:
Thinking recursively,
Functions-as-data / higher order functions,
Data structures,
Big-O efficiency,
Higher order everything,
String processing,
Making reusable code,
Some basic algorithms (sorting algorithms being the classic case)
Conclusion:
There are lots of languages worth learning (or at least getting familiar with), but I'd say these are easily the best three for getting started programming. That being said, I'm curious, for any programmers reading this, what were your first three languages? What order did you learn them in and why?
I don't think The Little Schemer is really accessible to beginning programmers. I found it's layout a little baffling after having known Scheme for a couple months. Realm of Racket and SICP are awesome though.
ReplyDeleteI would largely agree, but I've also talked to a lot of people who say that they loved working through The Little Schemer, so I thought it would be worth including alongside the other resources.
DeleteYou should check out Processing. It's an extension of Java that let's you do a lot of nifty graphical stuff right out of the gate. I taught an intro programming class last summer using it and it was really good for introducing students to programming a little at a time. MIT's Scratch is also a decent entry in the "making code less scary" category.
ReplyDeleteMy issue with Scratch is that (AFAIK) you can't do any "real" programming in it - you can't really define your own functions, and the drag and drop interface defeats about half of what you have to get over in the "reducing scariness" phase. One of the big things that scares people is text-based anything, and I think getting past that promptly is important. I didn't at first, and it slowed me waaaaay down.
DeleteI know only a little Scheme, so perhaps I'm just uninformed, but I don't see why you'd want to learn Scheme over Haskell. Haskell has syntactic sugar, lovely strong typing, and a more consolidated community and implementation. Scheme just seems like a less pleasant option.
ReplyDeleteI really meant PLT-Scheme/Racket, probably should have been more specific.
DeleteAnyway, the reason I chose Scheme instead of Haskell was the lack of syntactic sugar and strong typing. I personally prefer to program in Haskell now. But I picked Scheme for a relatively simple reason:
As nice as that syntactic sugar makes your code look, and as absurdly useful as the type system is, when you're starting both of them are just more things to think about. The central idea I'm trying to get at is that the language melts away - it doesn't help you too much, but it also lets you think about the program you're trying to write and nothing else. There's just less there, and that's a very nice thing for some stages of learning.