3 ms·
Of course, variable names need to be really descriptive. And, no, they don't each need a comment. Here's an example, in a recent app I had to slice an image b
by robomartin 14y ago
Of course, variable names need to be really descriptive. And, no, they don't each need a comment. Here's an example, in a recent app I had to slice an image based on a given number of rows and columns. The variables were named:
int image_rows;
int image_columns;
The actual code, with comment, went something like this:
// These variables will determine how the image is sliced.
// They are bounds-limited in code to max values imposed by hardware and
// defined in configuration_settings.h
int image_rows;
int image_columns;
A year from now I won't need to read far into the code to understand what they do.