Štěpán Stenchlák
We decompose a code because:
Therefore individual functions
// Universal functions int findArrayMin(int[] values, int size); void repeatCharacter(char character, size_t count); // Task specific functions void printCelmometherLine(int value, int leftPadding); void printCelmomether(int[] values, int size);
You do not usually need comments if you correctly name variables, functions, and arguments.
Function name and its arguments are the only things that the programmer sees (besides the comments).
void textHelper(char c, size_t i); void repeatCharacter(char character, size_t count); void printLine(...); void printCelmometherLine(...);
You can check Google C++ Style Guide
if (i > 0) { doSomething(i, true); } else { doSomethingElse(-i, false); }
https://www.ksi.mff.cuni.cz/teaching/nswi170-web/pages/labs/coding/2-constants
By Štěpán Stenchlák