August 2003
Intermediate to advanced
1104 pages
19h 27m
English
Write conditional expressions so that they read naturally aloud. Sometimes eliminating a not operator (!) will make an expression more understandable. Use parentheses liberally to resolve ambiguity. Using parentheses can force an order of evaluation. This saves the time a reader may spend remembering precedence of operators.
Keep each line simple. The trinary operator (x ? 1 : 2) usually indicates too much code on one line. if..elseif..else is usually more readable. Don't sacrifice clarity for cleverness.
Read now
Unlock full access