(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.
JSLint 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.)
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"
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.
Do 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.
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.