Hacker Newsnew | past | comments | ask | show | jobs | submit | ntime's commentslogin

"hurts my brain" == "don't understand"

*I use vanilla JS.


If you really used vanilla JS you would have used the typed equality operator :P. === fo' life.


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.


It takes more effort to understand the nuances of code written using significant whitespace than it does with a C style language where statements are clearly broken up for you. There is less room for ambiguity, and less room for user error.


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

Search: