Hacker News new | ask | show | jobs
by twic 4223 days ago
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.

1 comments

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