4 ms·
(Creator here) Ha, yeah JSLint really provokes strong emotions. Before I added in JSLint, if you misplaced one semicolon or forgot a parentheses, none of the t
by nwhitehead 15y ago
(Creator here) Ha, yeah JSLint really provokes strong emotions.
Before I added in JSLint, if you misplaced one semicolon or forgot a parentheses, none of the tests would run and it would just say "program failed". That was incredibly frustrating to me. I figured that if I was getting frustrated, and I was the creator of the tests, then random users would be REALLY frustrated. So I added in JSLint. Now you get line and column numbers for exactly where the syntax broke down.
I'm actually happy following all of JSLint's suggestions. But my first test user, my wife, had other thoughts. She filled out her first answer, saw the whitespace errors, and said "hells no". So I turned off the whitespace checking. She seemed OK with it after that.
Which checks in particular are annoying? I can change the default parameters of JSLint to be less strict about some things. But I don't want to give up syntax checking entirely.
- ynniv 15y agoGenerally, any check that isn't a syntax exception on commonly used browsers. Specifically, it barfed when I didn't include optional semicolons. var x = 5 shouldn't fail.
- libria 15y agoDo you know a way to disable strict identity over equality checking (=== vs ==)? It's a Crockford-ism, but I think the jury's still out on the value of strict type checking vs coercion and I'd like the choice.
- ricardobeat 15y agoeqeq: true see http://www.jslint.com/lint.html http://www.jslint.com/lint.html
- strager 15y agoJSLint complained when I had two `var` statements; it wanted me to merge the two into one. I repeat `var`, so this annoyed me. (Of course, it wasn't hard to fix, but the examples didn't show any multi-`var` usage so it may be a problem for someone new to the language or programming in general.)
- cjp 15y agoSPOILERS I created a successful bothC function that looks more like the simplified version of seqC, calling fC first. But when I switch to calling gC first, I get the following failures. Am I missing something, or is this a bug in the unit test? PASSED No JSLint errors PASSED bothC(S, S, A, B) === undefined PASSED output === "SSA" PASSED bothC(S, F, A, B) === undefined FAILED output === "SSASFB" PASSED bothC(F, S, A, B) === undefined FAILED output === "SSASFBFSB" PASSED bothC(F, F, A, B) === undefined FAILED output === "SSASFBFSBFFB"
- jlyke 15y agoI'm not sure that we used the same method to get to this part, but I too ran into this output. Interested in seeing how my solution was off, and if I was thinking about it the wrong way. Any luck?
- mokkos 15y agoContinuation Passing SPOILERS: f_success = function() { gC(success, failure); }; f_failure = function() { gC(failure, failure); }; fC(f_success, f_failure); For me, the trick here was to forget about the words "success" and "failure" because they have too much semantics embedded. I had to re-word the problem like this: call f3, if first argument of f1 and f2 are called. All other roads lead to f4. Both f1 and f2 has to be called in the chain no matter what. Also, this is the first time I've seen such a pattern. Is there a practical application of such pattern? I think it's ok to have a single level of closure to continue execution, but if it goes to that many levels like the sample problem, it'll be a nightmare to maintain for people who have not seen your code yet.
- swixmix 15y agoI would love to see how others solved these problems as a reward for completing it on my own.
- lelf 15y agoThe only thing that annoys me is two “Expected ';'” errors after e. g. var f = function () { return 0 }
- ricardobeat 15y agoUse JSHint with /*jshint asi:true, eqnull:true, laxbreak: true */ and you'll make everyone happy :)