Summary
Documentation is a good thing to have, at those times when you need it. It's useful for telling you why and how software does what it does, when the code can only tell you what it does with a little bit of how mixed in.
Maintaining documentation incurs additional cost and carries the risk that the documentation and the code could become unsynchronized. There are various ways to document code, and the preferred trade-off between effort and benefit can be found by experimentation.