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

It's awesome that people are writing articles on this stuff, but man -- some of the code in those examples is pretty rough.


Any specific examples you'd like to site? I always enjoy learning new things by seeing how people might re-factor or rewrite existing code samples.


The block that starts with the comment `//shop items`:

`var label` gets declared 3 times inside each loop iteration. Even if JS had block scope, which it doesn't, that would be pretty bad.


Thanks for noticing that kevincennis I've just corrected it.




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

Search: