Specifying code that does same or equivalent things to a list of variables, tokens, items or so is an important source of annoyance. It can easily make code unreadable and difficult to maintain. E.g consider the following
if ((b == a) && (c == a) && (d == a) && (e == a) && (f == a)) { /* all are equal, do something special */ } else { /* handle the base case */ }
Understanding what that expression does is difficult in one glance and updating it is error prone. Adding another variable, say g
, to be tested may be simple but withdrawing a
is a major operation.
Continue reading “Statement unrolling with P99_FOR
“