...
In general, you should declare each variable on its own line with an explanatory comment regarding its role. Although it is not required for conformance with this guideline, this practice is also recommended in the Code Conventions for the Java Programming Language, Section 6.1, "Number Per Line" [Conventions 2009].
When more than one variable is declared in a single declaration, ensure that both the type and the initial value of each variable are self-evident.
...
C Secure Coding Standard: "DCL04-C. Do not declare more than one variable per declaration"
C++ Secure Coding Standard: "DCL04-CPP. Do not declare more than one variable per declaration"
Bibliography
Wiki Markup |
---|
\[[Conventions 2009|AA. Bibliography#Conventions 09]\] Section 6.1, "Number Per Line" \[[ESA 2005|AA. Bibliography#ESA 05]\] Rule 9: Put single variable definitions in separate lines. \[[JLS 2005|AA. Bibliography#JLS 05]\] [§ 8§8.3, "Field Declarations"|http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.3], [§ 9 [§9.3, "Field (Constant) Declarations"|http://java.sun.com/docs/books/jls/third_edition/html/classes.html#9.3] [§ 14§14.4, "Local Variable Declaration Statements"|http://java.sun.com/docs/books/jls/third_edition/html/statements.html#14.4] § 6 [§6.1, "Declarations", |http://java.sun.com/docs/books/jls/third_edition/html/names.html#6.1] [§4.3.2, "The class Object" |http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.3.2] |
...
DCL00-J. Use visually distinct identifiers 01. Declarations and Initialization (DCL) DCL02-J. Use meaningful symbolic constants to represent literal values in program logic