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

Great job! One way to improve this code is to add comments. Use comments to describe what each function does and what the parameters are supposed to be. Then you can tell at a glance what the function does without having to analyze the code later on.

Us old people tend to forget things.



Comments in a twelve-year-old's code? For whom? Seven-year-olds? (I'm serious.)


How about for a 32 year old who is just learning JavaScript and comes across this repo? Age has nothing to do with it.


Perhaps for himself when he's thirteen or fourteen and wants to refactor


Why not learn good programming practices at an early age?


Also, if you use JSDoc a lot of modern editors can use that to automatically provide type hinting, documentation references on mouseover, etc.




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

Search: