|
|
|
|
|
by greenyoda
2954 days ago
|
|
- Even if some code doesn't need a comment to explain what it does, you may need a comment to understand why it does it, or why it does it in this particular way (which seems non-obvious but is the result of the obvious approach having previously failed). - Some algorithms are inherently complex and difficult to understand, so they may actually need comments to explain how they work. - If code deals with entities in the real world, like bank accounts or car engines, it may be subject to rules that are not obvious just from reading the code. Comments can explain the relationship between the code and the domain the code is operating in. |
|