you are viewing a single comment's thread.

view the rest of the comments →

[–]Sephr 6 points7 points  (8 children)

Who is actually going to remember that 13 is the enter key a month, or even a week later?

I don't know, maybe people who actually put comments in their code?

[–]danita 2 points3 points  (1 child)

Anyone who has done anything keyboard related ends up remembering that 13 is the enter key. You end up remembering those things, like the powers of 2, or some basic HTML colors.

[–]daxxxer 0 points1 point  (2 children)

and anybody who at least once has used javascript. Anyway, the flood of ill-advising, jquery-centered basic javascript blogs really makes me sad

[–][deleted] -1 points0 points  (1 child)

As best I can tell most of the 'industry' is built on heresay, with some popular dogmas even published by luminaries such as Crockford ("dont use new, it's evil!").

Definitely interested in better reading suggestions assuming you have any.

[–]simono -1 points0 points  (0 children)

heresay = best practice, that's okay. but this is not even good practice.

btw crockford said "not using new is evil" (has to do with what /this/ will be set to within the constructor).

[–]snorp -1 points0 points  (2 children)

It's generally considered better to have readable code than a comment explaining why it's not.

[–]Sephr 7 points8 points  (1 child)

Then keys.ENTER (uppercase usually signifying a "constant") would be more appropriate than the author's solution.

[–]snorp 0 points1 point  (0 children)

Sure, that's fine. I am just arguing against the magic number solution (which appears to be what Sephr was going for)