Rethinking Programming Language Tutorials
prog21.dadgum.com
prog21.dadgum.com
Probably not for people who create languages and that's one reason why programming language tutorials are what they are. They assume knowledge of some language and just go ahead with that.
Isn't that a good thing? Once you learn programming, you're really interested in learning a specific language and can discover the rest yourself. Should every language tutorial begin with a programming tutorial? I think it's a good thing they're not the same.
PS. One of the best language tutorials I've seen is: http://ooc-lang.org/ - assumes basic knowledge of other languages, in a couple of pages describes most of the stuff a programmer would be interested in. And it reads like a book, not a specification.
It really depends on the audience. Someone who knows absolutely nothing will want a considerably different type of tutorial than someone who is already fluent in several languages. The latter just needs to be presented with a mapping between the given language and a language they are familiar with, and the "table" -> "associative array" analogy is pretty excellent from that standpoint.
I have to say, I like this very much. I could just walk through this tutorial and associate existing concepts with pythons implementations of these concepts and just use it. Other language tutorials tend to annoy me by changing the level quite a lot or being way too low level.
Use simulated annealing to solve a computational geometry problem: "The final program will have less than 100 lines of Haskell and will organize a mass picnic in an arbitrarily-shaped public park map and will print pretty pictures showing where everyone should sit!" http://www.lisperati.com/haskell/
"Write Yourself a Scheme in 48 Hours" (implementing a simple parser and interpreter): http://jonathan.tang.name/files/scheme_in_48/tutorial/overvi...
Most chapters of Real World Haskell also take this form. For example, it walks you through writing a parsing library, and a barcode scanning program: http://book.realworldhaskell.org/
-- I'd say this is the approach Michael Hartl has taken with Railstutorial.org. Learning the language is important, but it seems to me that, having been through this tutorial and his previous "RailsSpace," the most important stuff I've learned is how a programmer thinks. Programming language tutorials shouldn't be about leaning languages. They should be about something interesting, and you learn the language in the process. Re-Factoring. Test Driven Development. Version control.
Needless to say, if you know anyone with zero programming experience who wants to get up to speed quickly on web development, so he or she will know what you're talking about, what's possible, and what's not, I highly recommend Hartl's work.
-- Fred
In fact, though, Lua is a sufficiently simple language that programming novices generally have no problem learning it, and the first third or so of PIL should get the beginner on his way very nicely.
_The Awk Programming Language_ is another slim and lucid language book. I don't use awk for much beyond one-liners (usually at that point I switch to Lua), but it has some real gems.
Maybe something like a game which teaches concepts like Message Passing and concurrency using an Erlang like syntax or Metaprogramming through Clojure