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.
John Resig: JavaScript as a First Language
101–110 of 228 posts
Re: John Resig: JavaScript as a First Language
#102Earlier 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…
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
#103For 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 (…
Re: John Resig: JavaScript as a First Language
#104almost literally.
Re: John Resig: JavaScript as a First Language
#105For 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
#106Re: John Resig: JavaScript as a First Language
#107For 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 (…
Re: John Resig: JavaScript as a First Language
#108For 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 (…
Re: John Resig: JavaScript as a First Language
#109Earlier 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.
Re: John Resig: JavaScript as a First Language
#110Then the new AP tests came in and the switched to C++ -> Java, which seemed very silly to me (C++ as a first language???)