Lurker News

Comments (283) 76 threads

Show all comments

Showing thread 12 of 76

test65542 replies#
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.

crooked-v#
Also, if you use JSDoc a lot of modern editors can use that to automatically provide type hinting, documentation references on mouseover, etc.
kazinator3 replies#
Comments in a twelve-year-old's code? For whom? Seven-year-olds? (I'm serious.)
tchaffee#
How about for a 32 year old who is just learning JavaScript and comes across this repo? Age has nothing to do with it.
mergejoin#
Why not learn good programming practices at an early age?
Humdeee#
Perhaps for himself when he's thirteen or fourteen and wants to refactor