Hacker News new | ask | show | jobs
by tikhonj 5226 days ago
I think Java is a much worse choice--it's less elegant, more complicated and requires treating more concepts as magic. (You can't even write "Hello, World" without a class and a static method!)

I think Python is a worse choice because it's also more complicated and less elegant than JavaScript (and it has its own share of pitfalls), but that seems to be a minority opinion around here.

Prototypal inheritance is much simpler than classical inheritance--you don't even have to introduce the idea of a class. I think it would be easier to teach prototypal inheritance rather than classical inheritance to people with no programming experience.

The last two paragraphs of your post seem to mostly be an ad hominem.

1 comments

Ok, maybe Java on some cases worse choice over JS. But Java has one preeminence over JS. With Java we can teach more advantage level of software construction. It's construction of medium/large systems. Programming in big. Using classical OOP, interfaces and specification in achieving modularity and decoupling.

JS was built for small scripts on web pages.

I think Python is a worse choice because it's also more complicated and less elegant than JavaScript (and it has its own share of pitfalls), but that seems to be a minority opinion around here.

You wrong, Python is much elegant than JS. Starting from syntax which was derived from C/C++ like languages. With a lot of bugs and confusing behaviors (some of was mentioned by Resig itself).

Code in Python is very clear and looks like pseudo-code. It's very easy to read and very easy to start writing in it.

JS - specialized language for Web. Python - general purpose language.

Prototypal inheritance is much simpler than classical inheritance--you don't even have to introduce the idea of a class. I think it would be easier to teach prototypal inheritance rather than classical inheritance to people with no programming experience.

There should be no inheritance for beginners. It's not even core CS concept. No classes, no OOP in any kind of it (prototypal, classical).

I think with this approach we will get not CS professionals. We will get JS script kiddies.

JavaScript--despite the syntax--largely takes semantics from Scheme and Self.

Python may look more elegant, but there are some hidden issues--weird variable scoping, dubious desugaring and crippled lambdas. (Also, the idea of a function as value is easier to understand with the word "function" rather than "lambda", something I would probably have changed in Scheme if using it to teach beginners.)

Moreover, Python actually shares several of JavaScript's misfeatures like weird loop scoping and the arbitrary statement/expression distinction. On top of this, Python is far more hostile to functional programming than JavaScript. (And this is by design!)

JavaScript is a much smaller language--Python has far more baked into the language itself. This is why I find Python less elegant--thing like "in" have no place in the language; they should be expressible as libraries. An elegant language is small but can be extended by its users; Python's philosophy seems to be the opposite. This is, again, where Scheme really shines.

I do not see why Java is a prerequisite to teaching "programming in big"--nothing stops you from teaching modularity and loose coupling in JavaScript. If anything it's easier because of anonymous functions and libraries built around passing functions around. (Java does have a static type system, which is an advantage, but it's a pretty bad type system.)

Also, you seem to be perpetuating the same common myths about JavaScript--it is as much a general purpose language as any and not particularly specialized for small programs or the web. It's certainly as general purpose as Python except perhaps a little lacking in some libraries. And with the advent of Node, it's quickly getting all the libraries it needs.

I completely agree! As noob who has been looking around how to teach himself, python is the easiest to understand and read at first. It doesn't have that woods of (}]$| . Also doesn't have that static class whatever that I had to mess with when starting with java. It was my first choice due to the stanford videos( which are great BTW!),but I looked for alternatives almost inmediately. Finally the best way I found is python with "learn Python the hard way".

About inheritances... O no another craizy concept I have to learn...