News for hackers. Stuff that matters.
Re:JS1k demo: “Highway at Night” by juhq on Sunday November 23, 2014 @03:34PM (#8649839)
As a rule of thumb, when ever one thinks that "wow, this code I just wrote is really clever", it should be a sign to sit back, take another approach and rewrite that code.

Clever code almost always means that in hindsight it's terrible and will introduce bugs.

In my opinion "x.indexOf(y) !== 0" is a lot more clearer and will immediately tells other developers what is happening. No point in saving space code, that's why we have minification libraries.

Re:JS1k demo: “Highway at Night” by lstamour on Sunday November 23, 2014 @08:35PM (#8650647)
Nobody needs this correction, I hope, but to be clear, it's !== -1 that we're replacing with ~. Then again, maybe this stands as a valid reason to be explicit in the first place. ;-)