4 ms·
Conditional logic is, in general, harder to analyze for correctness than declarative data and mathematical formulae.
by jhayward 6y ago
Conditional logic is, in general, harder to analyze for correctness than declarative data and mathematical formulae.
- hansvm 6y agoAdding to this, I think conditional logic is typically fine; the distinction is in using conditionals as data that gets passed around in a system vs branching on those conditions. E.g., considering `var rectified = x*(x>0);` or `var foo = predicate ? bar : baz;` both lend themselves to having their invariants easily verified, even if many such constructions are littered through a program. Contrast that with something like `if (predicate) {/*nightmares*/} else {/*slightly changed nightmares*/}` -- too many branches can quickly lead to an explosion of possible execution paths and all the problems that entails.