Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare counter variable in for statements #224

Merged
merged 1 commit into from Mar 27, 2019

Conversation

2 participants
@per1234
Copy link
Contributor

commented Mar 23, 2019

Declaring the counter variable outside the for statement is done very rarely in actual programming, and only when there is a use for that variable outside the scope of the for loop (which is not the case here). I don't see any value in declaring the variable outside the statement in the example code, as it only teaches bad programming. In some cases, the example code snippets didn't even contain a declaration and so would not compile if copied into a sketch.

Fixes #218

Declare counter variable in for statements
Declaring the counter variable outside the for statement is done very rarely in actual programming, and only when there is a use for that variable outside the scope of the for loop (which is not the case here). I don't see any value in declaring the variable outside the statement in the example code, as it only teaches bad programming. In some cases, the example code snippets didn't even contain a declaration and so would not compile if copied into a sketch.

@SeppPenner SeppPenner merged commit 37f2763 into arduino:master Mar 27, 2019

1 check passed

continuous-integration/drone/pr the build was successful
Details

@per1234 per1234 deleted the per1234:declare-counter-variable-in-for branch Mar 27, 2019

@SeppPenner SeppPenner self-assigned this Mar 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.