Skip to content

My Thoughts on Documentation

As someone who writes code, I’ve learned that documentation is key to making my programs easy to understand and use. When I’m working on a project, I try to think about what tasks the user will need to accomplish, rather than just explaining how my program works behind the scenes.

What I’ve Learned About Documentation

One thing I’ve found is that adding documentation strings to each function doesn’t always tell the reader how to use my program. Instead, I’ve discovered that strategically placed hints can be incredibly effective.

How I Approach Documentation

When I’m writing documentation, I try to put myself in the user’s shoes. I ask myself:

  • What steps will the user need to take to achieve their goals?
  • Where might they get stuck or confused?
  • What information would make their job easier?

Tips I’ve Found Helpful

Here are some techniques that have worked well for me:

  • Write for humans, not computers. I try to explain things clearly and simply.
  • Focus on what the code does, not how it works under the hood. Users often don’t care about the details of implementation.
  • Use consistent formatting and style throughout my docs. This makes them easier to read and navigate.
  • Include examples whenever possible. This helps users see how to apply the concepts in practice.
  • Keep my documentation updated as my code changes. Outdated info is worse than no info at all!

The Tools I Use

I’ve found a few tools that really help me manage my documentation:

  • Sphinx – This is great for generating documentation from docstrings. It’s especially useful for larger projects.
  • JSDoc – This is fantastic for documenting JavaScript projects. It has built-in support for many common frameworks.
  • Doxygen – While it’s primarily for C/C++/C#, I’ve also used it successfully for other languages when the need arises.

My Goal

My goal is to create documentation that benefits both myself and my team. I want it to be clear enough for new users to get started quickly, detailed enough for experienced developers to dive deep if needed, and flexible enough to evolve as our project grows and changes.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *