Live data from Hacker News

Ask HN: What programming language should I teach my little brother?

news.ycombinator.com

61–70 of 119 posts

Re: Ask HN: What programming language should I teach my little brother?

#61
post #27

As a teenager, I tried various "real" coding languages - C++, Java, VB (ugh) - but I was never able to get engaged in them. All I wanted to do was build something cool quickly, and none of these languages allowed that without a significant time investment. Then, I tried out PHP. Within a few days, I was building random tools left and right, and having a great time doing it. So, to get him interested, I recommend you…

Second on the idea that it should be quick and easy to make useful stuff, but I have to disagree on PHP. Most of the example code out there is terrible, out of date or both. It's very easy to make a mess in PHP. Python seems to be the teaching language of choice these days, and it lets you do useful stuff without getting in the way. It's certainly not the only language to learn, but I'm inclined to say it should be t…

It's easier to code and deploy using PHP than Python for web-app.

It's easier to code and deply GUI app in VB (and .NET environment).

For a beginner to start coding web-app in Python would be like a non-geek trying out Linux with just command-line.

Re: Ask HN: What programming language should I teach my little brother?

#62
post #6

Call me old school, but I would start off with Basic. If he was younger I would recommend Logo. Once he's hooked I would get him into C or pascal. I can't recommend enough getting him a "Basic Stamp" kit. Seeing how software can control hardware is magical. Then work him up into "Arduino" world in C.

BASIC will scar him. You might as well go with ruby or python, you get the same facility and start off with an extensible paradigm.

Why?

I thought BASIC is very good to teach basic programming concept such as Loops, line-by-line execution, etc. Really, for a beginner, one must have that kind of mindset.

Re: Ask HN: What programming language should I teach my little brother?

#63

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.realworldhask…

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?".

Re: Ask HN: What programming language should I teach my little brother?

#64
I would recommend Ruby because its loose syntax is more forgiving, good for new programmers. Then on top of that, learn Shoes for a graphical interface for creating games. Ruby+Shoes is the modern Basic.

Then again, just have him learn Basic. :-p That's how I learned.

Re: Ask HN: What programming language should I teach my little brother?

#65
I love Python, use it for all sorts of stuff, but I remember there were some things that went over my head learning it because I didn't understand OOP, and until I saw its beauty and the important aspects of writing clean code I hated the forced indentation. Plus I wasn't using vim then, and my lazy butt still doesn't like having to manually indent two-to-four spaces, depending on the project/language.

So maybe PHP would be better--tied with XHTML, CSS, and little by little some JavaScript. However, he's 13, so I don't think doing things in C or even Perl would be too daunting. (I can't recommend pure shell stuff with no graphics to people younger than 10 (sometimes 12) or so; it's just not that interesting for them.)

So then again Perl might be a better choice if you want to do a bunch of shell stuff. Have fun explaining cat.pl to him: #!/usr/bin/perl while () { print; }

Re: Ask HN: What programming language should I teach my little brother?

#66
post #20

python or ruby are good choices. They can be used to do UNIX scripting, and each one has some really cool modules to do graphic stuff. I'm learning ruby just now, so that i can do GUI programming with shoes, and im using _why's guide: http://poignantguide.net/ruby/index.html I don't know which one is better for a 13 year old, just pick the one you know better.

Seconding Ruby, just for _why's guide. I've never read anything that makes me so immediately enthusiastic about coding, and it still has that effect when I reread it. I wish I'd known about that as a kid.

[deleted]

Re: Ask HN: What programming language should I teach my little brother?

#67
post #51
post #31

Earlier quoted context omitted.

Yeah, PHP isn't an excellent language but it does do one thing and do it well. Just 99% of examples or scripts you find are absolutley horrible. Seriously, I've seen blog posts on PHP from IBM which contain bad programming practices.

Let's keep rehashing how a language creates terrible code and how none of it has anything to do with the guy sitting in the chair pushing buttons. Seriously, can we just nuke this argument?

I'm not sure that this "please think of the children" argument -- the one which asserts that the sight of PHP will forever warp the minds of children and risk turning them into script kiddies, or Blub programmers, or crack addicts -- can be nuked. It's really old. People were apparently using it when I was thirteen -- except that the guilty party back then was not PHP, which was more than a decade in the future, but BASIC. And I obviously didn't know about the controversy at the time, because I was too busy using hunt-and-peck typing to rekey my BASIC apps over and over again. (At the time my school's brand-new Commodore 64s didn't have tape drives, let alone floppies.)

And the kids were alright back then, and they are alright now. Applesoft BASIC makes PHP 5 look like Haskell (we're talking about a language with nothing but global scope, here), but the generation that built the Web grew up using it and it didn't hurt anyone. The smart kids just moved on to better things as they became aware of them.

Teach the kid something fun. For a thirteen year old, that's very likely to be Javascript, Actionscript (i.e. Flash), or PHP, though I certainly might give Shoes or Hackety Hack a try, or maybe this Scratch thing: http://scratch.mit.edu. Try several of these and see if any of them stick. But don't get hung up on the details. The guy is thirteen. There will be plenty of time for him to learn how ugly, fragile, insecure, opaque, and unmaintainable his code is. Try to let him have some fun and get hooked before he's forced to learn the truth. He won't sit still for it, otherwise.

Re: Ask HN: What programming language should I teach my little brother?

#68
post #6

Call me old school, but I would start off with Basic. If he was younger I would recommend Logo. Once he's hooked I would get him into C or pascal. I can't recommend enough getting him a "Basic Stamp" kit. Seeing how software can control hardware is magical. Then work him up into "Arduino" world in C.

Arduino has a nice simplified C language and a friendly and simple IDE. I recommend skipping the Basic Stamp.

Other than that, bare-metal programming on microcontrollers has the advantage that the boy can get a mental picture of the entire machine in his head; not so easy with an SDK of hundreds of megabytes for a modern high-level language.

Re: Ask HN: What programming language should I teach my little brother?

#70
post #48

Earlier quoted context omitted.

I think many of you have completely forgotten what sucked you into hacking. Here's how to get a kid hooked on programming: 1. Programming should be fun. 2. Programming should be fun. 3. Programming should be fun. Who really cares if a child isn't using "good programming practices"? When I started writing code, it was downright shameful. But in time, my internal desire to advance my art led me to nuking my globals and…

Reinforcing good practice shouldn't need to negatively impact having fun; some would argue that Python's strict enforcement of syntax and structure means one less thing for the kid to worry about deciding for himself, thereby reducing the complexity of learning. When you're just starting out, having some (meaningful) rules in place can be a good thing.

I would suspect a good IDE might be better than a headful of little things a kid has to remember. ("Hey buddy, see how you missed the ; here, better add that!")
Post reply on HN