Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do you use special comments on bug fixes in your code?

Tags:

People also ask

Should you comment your code?

A good goal is to have 1 comment for every 1-4 lines of code. Be sure to not only document what your code is doing, but, as you begin writing more advanced code, you should document what was intentionally left out, optimized away, tried and discarded, etc - basically, any design decision you make.

How do you comment out a code?

How to comment Code: Primarily, a single "block" comment should be placed at the top of the function (or file) and describe the purpose the code and any algorithms used to accomplish the goal. In-line comments should be used sparingly, only where the code is not "self-documenting".

Why do we need to use comments in programs?

In computer programming, a comment is a programmer-readable explanation or annotation in the source code of a computer program. They are added with the purpose of making the source code easier for humans to understand, and are generally ignored by compilers and interpreters.


Some of my colleagues use special comments on their bug fixes, for example:

// 2008-09-23 John Doe - bug 12345
// <short description>

Does this make sense?
Do you comment bug fixes in a special way?

Please let me know.