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

Aside from inline object literals, and using strict equality (which you should always be using IMO), what does this specifically have to do this Javascript? Everything else applies to general programming.


Agree. Most of the things would apply to (most) all languages such as avoiding verbose comments and not using 1 word variable names. I fully disagree with his stance on not declaring vars at the top of the scope though. It's a good practice with any JIT compiled language as it's easy to declared the same variable twice if you're not paying attention but it's a very hard mistake to catch as it won't throw error. The reason for strict (read:Crockford) conventions is that Javascript is an incredibly loose language thus it is very easy make mistakes.





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

Search: