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)?
John Resig: JavaScript as a First Language
11–20 of 228 posts
Re: John Resig: JavaScript as a First Language
#12Javascript 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 bro…
Re: John Resig: JavaScript as a First Language
#13Re: John Resig: JavaScript as a First Language
#14Javascript 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…
String [binary_operator] Number = String
String [binary_operator] Number = Number
That's just begging for further explanation.
Explaining JavaScript is probably more challenging than say Java. Java has many keywords and usages, but when it comes to explaining the concept of those keywords/semantics to students, it may be a little bit less confusing.
Re: John Resig: JavaScript as a First Language
#15Earlier quoted context omitted.
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.
Logically, the only other thing that could happen is for an "error" or "exception" be thrown when you do
'5' - 3
There's really only 2 choices. Either convert the '5' to a number and subtract, or throw a hissy fit because it's a string.That's not perverse. It's very logical.
Re: John Resig: JavaScript as a First Language
#16tl;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)?
Scheme is elegant and small, and a traditional choice for teaching programming where functions are first-class objects. If you consider Scheme appropriate for FP, my guess is that you’d also consider SmallTalk appropriate for teaching OOP.
Re: John Resig: JavaScript as a First Language
#17tl;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)?
for new programmers, the entry barrier for those languages is significantly greater than javascript. people don't quit learning programming because they're not learning OOP- they quit because it's inaccessible.
I just don't have time to twiddle with document object (DOM API) just to see results.
Re: John Resig: JavaScript as a First Language
#18Earlier quoted context omitted.
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. I…
Either '5' - 3 results in an error of some kind, or it evaluates to 2. There is no other logical outcome. Javascript chooses to do the latter.
I also disagree that starting language matters. It's like saying you need to have a steinway grand to learn the piano properly.
Learning is about learning what not to do just as much, if not more, than what to do.
Also if you learn to swim through syrup, imagine how fast you'll be when you try swimming through water...
Re: John Resig: JavaScript as a First Language
#19Earlier quoted context omitted.
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 bro…
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?
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
#20Javascript 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…