Guideline RP5: Condense code for clarity
Take advantage of the constructs of the language within which you are working. The ternary "?" operator--available in C, Java, JavaScript, Perl, and others--is great for avoiding duplicate code. See the example below.
if (cond) stuff = "foo" + obj.meth(a) else stuff = "bar" + obj.meth(a)
stuff = (cond ? "foo" : "bar") + obj.meth(a)
if ($cond) { $stuff = "foo" . $obj->meth($a) } else { $stuff = "bar" . $obj->meth($a) }
$stuff = ($cond ? "foo" : "bar") . $obj->meth($a)