Live data from Hacker News

John Resig: JavaScript as a First Language

ejohn.org

1–10 of 228 posts

Re: John Resig: JavaScript as a First Language

#3

Javascript is an absolutely horrible language to use for such purposes. There are far too many gotchas. See the following for numerous examples: http://stackoverflow.com/questions/1995113/strangest-languag...

Disagree... for example from the link:

  In JavaScript:

  '5' + 3 gives '53'
  Whereas

  '5' - 3 gives 2
That's just logical and obvious, since "+" is both numerical addition, and string concatenation, but "-" is only numerical subtraction, and the '5' starts out as a string.

Every language has 'gotchas'. Doesn't really matter which you pick to learn first at all. The more important thing is that you don't give up. possibly there are languages that just make people want to give up, but I'd say perhaps they're not motivated enough to learn if that's the case.

I started out on BASIC, and after a while I decided it was a piece of shit language and learnt assembly. But it taught me programming which is what I wanted to learn. I'm really glad I learnt BASIC first... essentially I learnt to swim really fast through syrup, and then switched to swimming in water.

The good thing about javascript as a first language is that people can be programming in it immediately, in their browser. They have a built in REPL to help them, as well as a debugger, profiler, etc. They have numerous docs to look at, and if they go to any website they can check the source to see how it works. That's a big win.

Re: John Resig: JavaScript as a First Language

#4
tl;dr - they picked JS due to its "ubiquity, desirability in the larger workforce, lack of prior installation requirements, and ability to create something that's easy to share with friends"

I find that explanation disturbing. Why not start from a language that teaches the basics of the common programming paradigms, such as OOP (Java) or FP (Scheme)?

Re: John Resig: JavaScript as a First Language

#5

Javascript is an absolutely horrible language to use for such purposes. There are far too many gotchas. See the following for numerous examples: http://stackoverflow.com/questions/1995113/strangest-languag...

One might say the same about the English language, yet it is taught in classrooms all across the United States, despite the fact that the U.S. has no codified national language. English is the de facto national language, but nothing more.

So why Javascript as a first language? Probably the best argument is that it has the widest reach of any programming language in use today because Javascript will run in any web browser on any platform. It is the closest thing to a universal programming language you'll find today.

Re: John Resig: JavaScript as a First Language

#6

Javascript is an absolutely horrible language to use for such purposes. There are far too many gotchas. See the following for numerous examples: http://stackoverflow.com/questions/1995113/strangest-languag...

I disagree as well - it is a very capable language with some very friendly features.

Also it is very applicable for many new programmers - an all round good choice.

Re: John Resig: JavaScript as a First Language

#7

Javascript is an absolutely horrible language to use for such purposes. There are far too many gotchas. See the following for numerous examples: http://stackoverflow.com/questions/1995113/strangest-languag...

Disagree... for example from the link: In JavaScript: '5' + 3 gives '53' Whereas '5' - 3 gives 2 That's just logical and obvious, since "+" is both numerical addition, and string concatenation, but "-" is only numerical subtraction, and the '5' starts out as a string. Every language has 'gotchas'. Doesn't really matter which you pick to learn first at all. The more important thing is that you don't give up. possibly…

Calling your example logical and obvious is only logical and obvious if you're completely trapped within the JS mindset. It's the same as how people defend the absurd semantics of Visual Basic and PHP. It's fine if you like it, but to claim that it's objectively okay is just not supported by fact.

It's also worth considering that even if every language has 'gotchas', some of them have far worse gotchas than others. It is worthwhile to choose a starting language that teaches the fewest bad habits and the fewest bizarre rules so that people can easily learn new languages.

Re: John Resig: JavaScript as a First Language

#8

Javascript is an absolutely horrible language to use for such purposes. There are far too many gotchas. See the following for numerous examples: http://stackoverflow.com/questions/1995113/strangest-languag...

Every language has its gotchas. Even assignment operators are kind of a gotcha.

If you're coming from a basic math background, and have no programming experience, then the expression "a = 15; a = a + 1;" would be confusing in any mutable language, because assigning a value to a variable is not equivalent to stating the equality (identity) of both sides.

Re: John Resig: JavaScript as a First Language

#10

Javascript is an absolutely horrible language to use for such purposes. There are far too many gotchas. See the following for numerous examples: http://stackoverflow.com/questions/1995113/strangest-languag...

Disagree... for example from the link: In JavaScript: '5' + 3 gives '53' Whereas '5' - 3 gives 2 That's just logical and obvious, since "+" is both numerical addition, and string concatenation, but "-" is only numerical subtraction, and the '5' starts out as a string. Every language has 'gotchas'. Doesn't really matter which you pick to learn first at all. The more important thing is that you don't give up. possibly…

It's logical and obvious if you already know the language; otherwise, it's perverse. I had to read your comment (the initial edit of it) twice to be sure you weren't being sarcastic.
Post reply on HN