-
-
Notifications
You must be signed in to change notification settings - Fork 64
Guide: When to jsdoc Comment
knod edited this page Oct 8, 2018
·
1 revision
If you're wondering why we generate some of the docs instead of writing them all by hand, skip to Purpose of In-Code Docs.
'Future coders' are either us in the future, or other people who read through the code or take on the project.
- It isn't super easy to tell what a class or function is doing and/or how to use it.
- Major code structures - it's the kind of thing you'd export or it's something like a method of a class.
- We're describing some feature or improvement that would be good for future coders to think about.
- It's something that's important for future coders ask/answer/think about/do.
- It explains why we're doing things the way we're doing them - what secret info we had, what crucial info we were lacking, some very uncommon behavior of a language, other reasons that are hard to see.
- We did something that wasn't great and the code is confusing, but we couldn't figure out how to make it better so now it needs extra explanation and a plea for forgiveness. Things like a lot of parameters, weird state objects, etc.
- Sometimes when we're giving a link to useful information.
- We're walking through code behavior happening inside the function, class, method, or object.
- We want to remember to tweak or discuss some behavior in the code with each other. It'd be better to make issues out of those sometimes.
- In the flow of the code, we're citing a specific item number in another document, like in a cfr (regulations) document. Whether that should actually be for jsdoc may be worth discussing, though.
- We came up with a really funny joke and we're sure everyone else will rolf.