-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
The second-to-last paragraph in the C Style Guide Naming Conventions refers to missing examples of why loop variables shouldn't always be one letter. An adaptation of the Python examples might be:
No:
for {int x = 0; x < data_len; x++) {
// ...
// 10 lines of code
// ...
float y = m / 60;
// ...
// 50 lines of code
// ...
data[x] += y
}
Yes:
for {int student_index = 0; x < data_len; x++) {
// ...
// 10 lines of code
// ...
float hours_worked = m / 60;
// ...
// 50 lines of code
// ...
data[student_index] += hours_worked;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels