Why We Don’t Document Code

By Deane Barker

Sometimes we don’t document for valid reasons, not just because we’re lazy.

In this post, the author explores the reasons behind the common reluctance to document code, emphasizing that many developers prioritize readability and well-structured code over formal documentation. The argument is made that well-written code should be self-explanatory, and documentation often becomes outdated or neglected. Instead, the focus should be on improving code quality and ensuring that it effectively communicates its purpose to other developers.

Generated by Azure AI on June 24, 2024

Documentation is always the last thing anyone wants to do. In general, we all hate it, and software we wrote – even software that’s not one-off, but is specifically intended for the future use of other people – generally never gets documented.

Right now, I’m sitting on a software library that I wrote which painfully needs documentation. But I haven’t written it. I’ve been encouraged to write it, and it sorely needs to be written, but I…just…don’t.

I got to wondering why this is. After a week of soul-searching, here it is, for better or worse:

Is there a solution to this? I don’t think so. If there was, I suspect we’d have found it by now.

Now, if you’ll excuse me, I need to get back to avoiding documenting some code.

This is item #56 in a sequence of 361 items.

You can use your left/right arrow keys to navigate