Rationale: Some developers find inline conditionals hard to read, so their company's coding standards forbids them.
SCJP, SCJD, SCWCD, OCPJBCD
Originally posted by Mihai Radulescu:
Are the inline conditionals to tough for a junior programmer ?
SCJP 1.4 91%, SCJP 1.5 88%, SCJD B&S
42
SCJP 1.4 91%, SCJP 1.5 88%, SCJD B&S
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
42
multiple return statements from method are not recommended
If a method has a conditional behavior that does not make clear the normal path of execution use guard clauses.
SCJP, SCJD, SCWCD, OCPJBCD
42
Originally posted by Jeroen T Wenting:
multiple return statements from method are not recommended
sometimes even just to exit them
SCJP, SCJD, SCWCD, OCPJBCD
Originally posted by Mihai Radulescu:
Can you provide an example ?
[ July 06, 2006: Message edited by: Mihai Radulescu ][/QB]
I know that in both cases there are other way to solve it,
SCJP, SCJD, SCWCD, OCPJBCD
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |