I try to document argument/return types, but there are several problems with this (at least, how I'm currently doing it):
- when I'm developing a whole new feature it's hard to document and keep updating the docs as I go
- when I'm importing lots of functions from other places it's easy to lose track of info elsewhere
- I don't know how to document complex nested structure clearly — i.e. when a complicated object with lots of properties has an object property with a bunch of properties of its own
What's the best process / documentation method to keep track of these kinds of things and reduce my cognitive effort? An ideal solution would strike a balance with being able to prototype/develop quickly (not over-optimizing). Good open-source code examples would be especially welcome!