[PPL-devel] Redundant elses
bagnara at cs.unipr.it
Tue Oct 4 14:57:31 CEST 2005
Matthew Mundell wrote:
> Log message:
> Take out two redundant `else' and a redundant `if'.
What do you mean by redundant else?
Notice that source code is more than its semantics: the fact
that with and without the else the behavior is the same is not
a good reason to prefer the version without (or the version with
If, in addition, you have something of the form
then taking out the else without revising the comment can
do more harm than good.
More generally, the rationale for such changes is as follows:
- either things are left as they are on the grounds that who
wrote the code knew better if the `else' there was making
things more readable or not;
- or the issue is raised globally, discussed at length,
documented in the STANDARDS file and then systematically
applied to whatever code.
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
mailto:bagnara at cs.unipr.it
More information about the PPL-devel