Hacker News new | past | comments | ask | show | jobs | submit login

Since you know OCaml how about teaching him Haskell followed by C? The former should be pretty accessible to a 13 year old and he’ll have a lot of time to wrestle with some of the more difficult concepts like Monads (although I think exposure to them at an early age will make them easier to grok since he doesn’t have to unlearn a bunch of other stuff). I highly recommend Real World Haskell (http://book.realworldhaskell.org/read/) if you do decide to go that route.

Apologies for a (related) tangent but I'm in a very similar situation (except that my little brother is 31). He has more artistic inclinations but in the past he's demonstrated an aptitude for mathematics and is generally good at problem solving. I've been teaching him some basic set theory and number theory in preparation for some actually programming.

My first thought is to teach him one high level language like Lisp followed by a low level language like C. On the other hand, JavaScript (+ HTML) has some of the best of both of those worlds with the added benefit of affording immediate gratification. Any thoughts?

*Admittedly, my bro is a bit more motivated by financial considerations but I do think he will come to appreciate the beauty of programming if it is presented the right way.




Haskell as a first language... I've seen it work, but the learner was a physicist working on his PhD. "Finally a language that makes sense", he said.

For a 13-year-old who has probably not been exposed to much mathematical rigor at school, I would not recommend Haskell, though. Haskell makes it hard to write a program that, as ugly and unmaintainable as it may be, somehow mostly works (e.g. you have to plan ahead which parts of the program may perform I/O).

Therefore, I'd go with an imperative language and reserve Haskell for the day when he asks "is that all there is?".


Those are good points. However, I don't think Haskell is that much harder than something like SQL once you really understand what's going on. Although it's not much more than an informed hypothesis, I do think that a precocious 13 year old could do well with it... but I would definitely teach an imperative language too.


For your brother, I would teach him C before Lisp.

C is mandatory, every programmer knows C, it teaches you about memory management, syscalls… it teaches you how you computer works. Once he gets it, he can start having some fun with the sexiness of Lisp, and he will make less mistake because he knows what's happening behind the scenes. Plus… it's really hard to learn C when you already know Lisp exists. I mean… first you ride a bike, and then a motorcycle.

For my brother, I don't think Haskell is such a good idea. Sure, it's a great language, but maybe too mathematical for his age (he just learned the Thales theorem…).


Thanks for the reply. You mentioned that OCaml was one of your first languages and I guess I assumed that you learned it at a similar age which is not necessarily the case... but that's why I suggested Haskell. Also, I can appreciate that teaching Haskell to a 13 year old can seem a daunting task (for the teacher) but I really do think that under the right tutelage I smart kid could get it (you can get a lot of mileage by just treating it as sort of a SQL dialect). It's also pretty well integrated with at least one Linux distro as far as systems programming goes (http://urchin.earth.li/pipermail/debian-haskell/2006-May/000...).

Good luck with whatever you decide though, he's fortunate to have a brother that's taking the job seriously :)


Why are Monads considered difficult?


They are difficult because the concept is very unfamiliar and abstract. It's also not very easy to see the motivation at first.


Perhaps I am too tainted.

Monads can be motivated as a generalization of a lot of stuff that follows similar rules (the Monad laws). E.g. Lists, Haskell's Maybe (representing success/failure), sequential computation.


As a Haskell beginner it's not so easy to see the generalization between State, Maybe, IO, and especially Lists.

This is exactly the problem.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: