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

> A common advice for documentation is "why not how", I'm not sure you can do "why" by looking at the "how".

The "why" is important for inline comments, but for function and method comments I think the biggest is neither "why" nor "how", but "what". As in, "what does this method do?" especially with regards to edge cases.

I tried a few methods just now; it gives okay-ish docs. Lots of people don't write great comments in the first place, so it's about on-par. Sometimes it got some of those edge cases wrong though; e.g. a "listFiles()" which filters our directories and links isn't documented as such, but then again, many people wouldn't document it properly either.



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

Search: