Live data from Hacker News

Is it better to learn JavaScript or Python as a first language?

news.ycombinator.com

11–13 of 13 posts

Re: Is it better to learn JavaScript or Python as a first language?

#11
post #2

JavaScript will be more friendly to you, and will open the doors to more applied languages, including Python. If you learn Python first, you might have trouble learning other languages. Ideally, in the end it wont matter - a programmer can program in any language, but for starters I would say start with JavaScript.

Why would learning Python make it difficult to learn other languages? Just curious.

Python's syntax and idiom is more esoteric. While JavaScript does have some nits, it conforms more to C-style idiom (PHP, Java, C#, C++) and so those basic visual parsing skills will be more transferable. The C# syntax will be more immediately familiar to someone who knows only JavaScript than someone who knows only Python.

Re: Is it better to learn JavaScript or Python as a first language?

#12
post #2

JavaScript will be more friendly to you, and will open the doors to more applied languages, including Python. If you learn Python first, you might have trouble learning other languages. Ideally, in the end it wont matter - a programmer can program in any language, but for starters I would say start with JavaScript.

Why would learning Python make it difficult to learn other languages? Just curious.

I actually agree with the comment, but for entirely different reasons.

For me learning Python first (Well, not first, but it was the first language I learned that wasn't like...qbasic or pascal or something nasty and dos-y like that - I started using Python circa 1.5.2 on an early G3 Mac) ruined just about every other language for me because, well, they're just all so much work. Python just stays out of your way so well 99% of the time, and it has the nicest (Not necessarily LARGEST, but best curated/most coherent) standard library of any language I've used.

That said, Scala (and Lift in particular) have been catching my eye lately - not quite as elegant (but with a few new tricks too...), but the performance characteristics are certainly appealing, which is the one area where python is...lacking.

Re: Is it better to learn JavaScript or Python as a first language?

#13
post #11

Earlier quoted context omitted.

Why would learning Python make it difficult to learn other languages? Just curious.

Python's syntax and idiom is more esoteric. While JavaScript does have some nits, it conforms more to C-style idiom (PHP, Java, C#, C++) and so those basic visual parsing skills will be more transferable. The C# syntax will be more immediately familiar to someone who knows only JavaScript than someone who knows only Python.

> Python's syntax and idiom is more esoteric.

I know, but sometimes 'esoteric' is better for beginning programmers. Compare the lesson on ternary operators:

some(blah) if 'a' in blah else blah

(blah.indexOf('a') != -1) ? some(blah) : blah;

Post reply on HN