The Art of Documentation

The Art of Documentation

Jan 04, 2024

Do you have experience with properly documenting and including clear commit messages for your code?

Good documentation is a cornerstone of successful development projects

When I first began committing code and writing README files, nobody raised any complaints. I believed I was doing it correctly until I started an internship and had to collaborate with other developers. That's when my mentor pointed out that my commits were too basic and lacked meaningful context. This feedback prompted me to research effective code documentation and commit message writing.

Have I improved? Yes, I have (self-evaluation). I now recognize that commit messages are crucial, not only for my benefit but also for the understanding of other developers.

Documentation plays a critical role in various aspects of life, not just in software development. For instance, in a hospital, it's essential to have proper documentation of a patient's well-being. This ensures that other healthcare providers can understand the patient's condition and needs.

Similarly, in programming, when you deploy your code, it's crucial to provide clear explanations of what your code does. This helps other developers understand the purpose and functionality of the codebase or application. Simply deploying to GitHub without proper context can lead to confusion and inefficiencies in collaboration.

What are the git messages?

A git commit message is a short text that identifies the context of the work. A commit message should be concise, clear and descriptive 

The Commit type can include the following:

  • feat: A new feature is introduced with the changes

  • fix: a bug fix has occurred

  • chore: changes that do not relate to a fix or feature and don't modify src or test files (for example, updating dependencies)

  • refactor: refactored code that neither fixes a bug nor adds a feature

  • docs: updates to documentation such as the README or other markdown files

  • style: changes that do not affect the meaning of the code, likely related to code formatting such as white space, missing semicolons, and so on.

  • test: including new or correcting previous tests

  • perf: performance improvements

  • ci: continuous integration related

  • build: changes that affect the build system or external dependencies

  • revert: reverts a previous commit

example

git commit -m "feat: add a toggle theme at the navigation"

In conclusion, always include a commit message when deploying to GitHub. It aids in your understanding of what you did, especially if you revisit your code after some time, and it also provides valuable context for other developers who may be working with the code.

For updates on my latest work, feel free to connect with me on Twitter and LinkedIn.

Thank you for reading 💖

Подобається цей допис?

Купити Ijeoma a drink

More from Ijeoma