|
|
|
|
|
by pyre
4819 days ago
|
|
> Code should be self readable, and if you get
> to the point where it isn’t, then you may have
> to rewrite few bits. This is not always
> possible though, especially for temporary
> hotfixes or hacks. In this case, comments are
> a must.
* Sometimes business decisions may not make
logical sense, but someone says "do it this
way." It makes sense to comment this in the
code.* The code might tell you what it's doing, but
not necessarily why it's doing it. * You may be making use of legacy components that
you are unable to rewrite. It may make sense to
comment on their use within newer code that
interfaces with them, making it possible for
people to bugfix the interface without needing
to delve all the way into the legacy component. |
|