void pathFindingAlgorithm() { const int maxIterations = 3;
for(int i=0; i<maxIterations; ++i) { ... } } You don't need to comment code that speaks for itself. Sensible commenting here might be a brief description of how the algorithm works and, if relevant, side effects of the function, like states that change, assuming this could belong to an object.
|