3 ms·
Well, I wanted to know what IDE JSLint was an expansion for, so I did some poking around... it's an online tool. Meh #1. Next up I thought I would take a snip
by Stormbringer 15y ago
Well, I wanted to know what IDE JSLint was an expansion for, so I did some poking around... it's an online tool. Meh #1.
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.
- malandrew 15y agoWhitespace can be a huge gotcha for novice programmers. Hard spaces? Soft spaces? New lines?
- joshuacc 15y agoJSLint is readily available at the command line, and is very easy to plug in to your text editor's build system. There is also the somewhat friendlier JSHint as a reasonable alternative: http://www.jshint.com/ http://www.jshint.com/
- Stormbringer 15y agoBy "readily available at the command line" - have you forgotten that the context of this discussion is for a language to use for a first year programming course? 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.
- phzbOx 15y agoWell whatever the language you want to use, you'll have minor installation/configuration to do. For real beginners, the teachers can do it for them. So, if they use Eclipse for instance, the IDE can be configured to automatically use JSlint. 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.
- joshuacc 15y agoNo. I am operating under the assumption that a competent instructor would provide a pre-configured text editor or IDE for the students to use.
- Joeri 15y agoCommon web IDE's all embed JSLint error reporting in the editor window while you're typing. I've used Aptana, Zend Studio and Jetbrains PHPStorm, and they all integrate jslint (though usually it's disabled by default). I've found phpstorm's check-while-you-type functionality is the most comprehensive, better than jslint.