Document to Learn

Writing good documentation requires you to really understand what your code is doing. If you don’t understand your code, how can you possibly document what it is doing? Therefore, writing documentation forces you to gain a solid understanding of how your code works. On multiple occasions, I have learned something while documenting my code that has made me realize that I was doing something wrong. I learned something and fixed my code at the same time. That’s a win-win situation if I’ve ever seen one.

Get Learning to Program now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.