I've been developing an app in Android Studio and today I happened to rest the mouse pointer on a suggestion box and read the suggestion.
This was the suggestion,
The for statement it suggested didn't need braces is this one (highlighted),
Now, the braces aren't needed as it's followed by a (fully braced) if section. However, I think this is dangerous as adding a statement after the if closing brace would (or could) appear to be part of the for loop. So, IMHO this is a bad piece of advice.
Any thought anyone?
Mike.
Edit, Am I right in thinking that Academia would frown at the above suggestion?
This was the suggestion,
The for statement it suggested didn't need braces is this one (highlighted),
Now, the braces aren't needed as it's followed by a (fully braced) if section. However, I think this is dangerous as adding a statement after the if closing brace would (or could) appear to be part of the for loop. So, IMHO this is a bad piece of advice.
Any thought anyone?
Mike.
Edit, Am I right in thinking that Academia would frown at the above suggestion?
Last edited: