...
Declarations of loop indices should be included within a for
statement:
Code Block | ||
---|---|---|
| ||
public class Example { void function() { int mx = 100; // some max value for (int i = 0; i < mx; ++i ) { /* ... */ } } } |
Risk Assessment
Declaration of multiple variables per line can reduce code readability and lead to programmer confusion.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2736884bbedafa04-118146bb-4d484df6-96f3b242-396f81706924e7814e0be0fd"><ac:plain-text-body><![CDATA[ | [[Conventions 2009 | AA. Bibliography#Conventions 09]] | Section 6.1, "Number Per Line" | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="bc214f6363876ba3-5e9956c9-456b4d10-80bda600-b275e663816156f1c4091a54"><ac:plain-text-body><![CDATA[ | [[ESA 2005 | AA. Bibliography#ESA 05]] | Rule 9: Put single variable definitions in separate lines. | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="321eb377793e3600-a632202a-45544c96-ae2b9738-342c540995997c2f7c45742d"><ac:plain-text-body><![CDATA[ | [[JLS 2005 | AA. Bibliography#JLS 05]] | [§8.3, "Field Declarations" | http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.3] | ]]></ac:plain-text-body></ac:structured-macro> |
| |||||
| |||||
| |||||
|
...