How to document in the code a hack, hotfix, and any potentially problematic contour situation

5

Hacks, emergency fixes, and any potentially problematic contour situations are a necessary evil . Although it may be considered personal opinion, when working as a team, it is assumed a minimum of care to leave alert to colleagues, or the programmer himself in the future.

My question is: what is the minimum standard that would be expected of a programmer to document such code in the code itself, assuming that it works on a small team of 2 to 7 developers. p>

Something that I personally do is in a comment, close to where the problem occurs and not in the function header, for something like

// @todo mensagem explicativa, proporcional a complexidade (nicknamedoprogrmador 2014-02-05 14:23)

In my case, @todo can be changed to @hotfix , but it's always something to use.

Although this question can be answered with your personal opinion, if there are references to recommendations from specific experts or methodologies it will be more welcome for all.

    
asked by anonymous 05.02.2014 / 17:28

1 answer

3

As I see it depends a lot on the IDE used. Visual Studio, for example, marks comments like // TODO: and // HACK: in a toolbox for easy identification and location. Plugins like Resharper also color and emphasize such lines. Other plugins allow you to enter such notifications into check-ins and code reviews, so that they are always visible (after all, an TODO: as a comment it is a comment eternally)

VS tool example:

    
05.02.2014 / 19:40