Next up I thought I would take a snippet from the linked stackoverflow discussion and see what JSLint made of it:
127.0.0.1.toInt();
And... it complained
So I did this:
var = function() {
127.0.0.1.toInt();
}
And it complained (yes, there's a typo)
var foo = function() {
127.0.0.1.toInt();
}
And... it 'compiles' fine, no complaints. So I thought I'd push the syntax tree button to see what was going on and it tells me:
Tree:
""
Which is less than spectacularly useful.
Oh, I went back and hit the JSLint button again and now it givess me lots of errors for the above code.
Including, but not limited to complaining that 127 occurs in column 1 instead of column 9. But then I try to enter a tab at the start of the line to achieve proper indentation... and of course it doesn't work because it is in the browser and so tab just goes and selects the next control.
Sensational.
If I had to enter all my indentation as spaces, by hand, I'd conclude that the Professor teaching this was a colossal idiot.
There is also the somewhat friendlier JSHint as a reasonable alternative: http://www.jshint.com/
A not insignificant portion of the people taking those courses will not be command line savvy.
Also, I think that the fascination some programmers have for tools that are cumbersome and difficult to use is unhealthy.
The tool should not itself be the problem.
The tool should be a force multiplier that lets you solve other problems more easily.
By "Command line", the OP meant that it's easy to plugged it wherever you want it; i.e. it is not strictly an online tool.
About:
"fascination some programmers have for tools that are cumbersome and difficult to use is unhealthy"
Not sure what you're thinking about. It's more an opinion than a fact. I.e. Some programmers like emacs better than vim, some prefer Eclipse.. some prefer notepad++. "Cumbersome and difficult" mostly depends of your taste and your background.Is 'grep' hard to use? What about ctrl+shift+f in Visual Studio? Which one is the most cumbersome and difficult to use? Highly subjective imo.
In fact, I think the first language is not just about giving a strong foundation but also give students the chance to find a good internship. So, with that logic, even though I enjoy hacking with Scheme, I'd feel bad to teach that to students who will try to find an internship and writing on their resumes "Scheme" while other universities students would have "C++/Java". And, please, before your argue that a language can be learned or something else, have in mind how companies recruit and parse resumes.. they often just search for a keyword. Now, one might say that you don't want to work for a company who does that, but then, you have to start somewhere in your first internship.
Thus, I like JavaScript as a first language; not because it's the easiest to learn but because I believe it gives a strong foundation but also gives students the ability to find a good internship.