Live data from Hacker News

John Resig: JavaScript as a First Language

ejohn.org

101–110 of 228 posts

Re: John Resig: JavaScript as a First Language

#101

Earlier quoted context omitted.

Strict Equals Operator (===) does exactly what I expect and that is no funny coercion or guessing, two objects I'm evaluating have a 1 for 1 likeness, no more no less. How is that confusing?

NaN !== NaN Apart from that, I agree.

That's not really language dependent--that's how floating point numbers always work. And with good reason--there are actually a ton of different NaN bit patterns in the floating point standard. I think anything where the exponent is all 1 is an NaN (except maybe for infinity--I don't remember the exact details). The point is that two completely different patterns of bits can be NaN.

Re: John Resig: JavaScript as a First Language

#102
post #96

Earlier quoted context omitted.

Agree with your opinion on Java/OOP. There do seem to be better places to start IMHO. If you had to pick one language to teach people who had never programmed before and you wanted to be able to demonstrate the basics of OOP, FP and other styles, then Python would be a good choice. (Disclaimer: I like Python quite a lot.)

I think Python is actually a pretty bad choice for function programming. It does ostensibly support it, but in practice I don't think anybody uses anything resembling purely functional style. For example, I don't think I've seen a single fold in the wild in Python where I see them in Haskell and Scheme all the time. Could you imagine only introducing mutation halfway through the semester of a Python course? That's wh…

I agree with a lot of what you say, and I'm not qualified to comment on some of the the other things you say.

My point was that if you were to teach people new to programming just one language then Python might be a good choice because it supports many paradigms.

I agree there are languages that are much more conducive to learning functional programming than Python.

Re: John Resig: JavaScript as a First Language

#103

For the interested (and with the caveat that I definitely would not suggest it for the Khan Academy's purposes), CoffeeScript does try to address all of the issues that John raises in his post. Type Coercion: There is no `==` in CoffeeScript. You usually write `if x is y` in order to be particularly clear, but if you're in the mode of most other scripting languages, and you write `if x == y`, it will compile to `if (…

And made the mistake of making whitespace significant thereby driving off people in droves.

Re: John Resig: JavaScript as a First Language

#105

For the interested (and with the caveat that I definitely would not suggest it for the Khan Academy's purposes), CoffeeScript does try to address all of the issues that John raises in his post. Type Coercion: There is no `==` in CoffeeScript. You usually write `if x is y` in order to be particularly clear, but if you're in the mode of most other scripting languages, and you write `if x == y`, it will compile to `if (…

And made the mistake of making whitespace significant thereby driving off people in droves.

It's 2011. We love significant whitespace now, get on with the times...

Re: John Resig: JavaScript as a First Language

#107

For the interested (and with the caveat that I definitely would not suggest it for the Khan Academy's purposes), CoffeeScript does try to address all of the issues that John raises in his post. Type Coercion: There is no `==` in CoffeeScript. You usually write `if x is y` in order to be particularly clear, but if you're in the mode of most other scripting languages, and you write `if x == y`, it will compile to `if (…

[deleted]

Re: John Resig: JavaScript as a First Language

#108

For the interested (and with the caveat that I definitely would not suggest it for the Khan Academy's purposes), CoffeeScript does try to address all of the issues that John raises in his post. Type Coercion: There is no `==` in CoffeeScript. You usually write `if x is y` in order to be particularly clear, but if you're in the mode of most other scripting languages, and you write `if x == y`, it will compile to `if (…

[deleted]

Re: John Resig: JavaScript as a First Language

#109

Earlier quoted context omitted.

If widest reach is your criteria, Java and C would also be equally good choices. Unless the web browser is special in some particular way that makes it 'more worthy' than other execution environments?

Everyone already has a browser, which includes a profiler, debugger, REPL etc. Not everyone has a c compiler or JDK, or wants the hassle of having to set them up just to start learning.

That's fine. We can already run lots of better languages in the browser either using interpreters written in JS or cross-compilers targeting JS.
Post reply on HN