Hacker News new | ask | show | jobs
by bitwize 4223 days ago
I like the idea to choose one language, but... Start with Python. You're going to hear Ruby this and JavaScript that and Swift the other -- but seriously, I'm from the future. You should start with Python. It's essentially BASIC for this century: a great place to start learning the basics without being too weird. There's plenty of time and once you have those cold, you can investigate other languages, including the fun ones that have separate compilation steps and may produce segmentation faults if you're not careful.
2 comments

The key thing about Python is that it's really plain. It's a straightforward procedural language - values, functions, names, calls, and that's about it. It has a simple object system, and some simple functional features. The whitespace business is superficially kooky, and there is a scary amount of metaprogramming and other craziness available, but people tend not to use it.

As such, it's a really useful preparation for learning other languages.

If you have the basic concepts from Python, then when you learn Ruby, you just learn some syntax and the special things that make Ruby distinctive (metaprogramming, monkeypatching, ubiquitous gemmery, Rails). When you learn JavaScript, you just learn some syntax and the special things that make JavaScript distinctive (callbacks, artisanal object systems, the interplay of JS and the DOM). You never have to learn to do without some special thing you've learned to depend on, because Python has no special things.

Well, that and it's incredibly easy. And it has a really strong batteries-included standard library. And it has a really friendly, helpful community. But mostly the plainness.

> the special things that make JavaScript distinctive (callbacks, artisanal object systems, the interplay of JS and the DOM)

If you're coming to Javascript from pretty much any other language, prototypal inheritance is probably going to be the biggest difference in paradigm to wrap your head around.

The thing is, in the JavaScript i've seen, there is no direct use of prototypal inheritance. Instead, there's some mechanism, usually involving a method called "extend" which implements something that looks like classes and instances on top of prototypes. This is what i meant by "artisanal object systems".
Yeah, aren't most universities using Python for beginners now?