Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No, he wouldn't have. If you use === everywhere, you're wasting bandwidth for the extra character. Use === only when the type matters and is likely to be different. 99% of the time, it's when you want to distinguish between undefined, false, 0, and null.


that's a false economy since you must also include however many bytes it takes to explain in a comment that you used == on purpose, and not as a typo- to warn future maintainers not to switch it to === when they run it through JSLINT.


You put comments in code? I place all comments in a separate markdown file.


I normally don't. Unless I do something silly like use == that could be taken as a mistake.


Could you share a link that describes this? I'm having trouble finding anything about it.


Just take a look at how Mootools or Node.JS takes care of their documentation. Same principal. There is no need for comments/documentation to muck up code.


Put comments in code, and then run your code through YUI or similar to strip the comments and whitespace when deploying.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: