Hacker News new | ask | show | jobs
by odammit 2950 days ago
My favorite comments are the comments right above a function call that says what the function call does. Always a solid thumbs up moment.

// gives a thumbs up

user.thumbsUp();

2 comments

If for no other reason, I have gotten in the habit of doc'ing my fields, properties and functions with javadoc/xmldoc just because my IDE has such good support for popup documentation when I hover over an identifier.

Saves a lot of time vs jumping to the definition to see what it does

Often comments in code are used to generate documentation, so without those comments your function won't be documented.
I’m talking inline in a function call. Not documentation above the function.