Eric Sosman said:
Have you been smoking those funny cigarettes again, Malcolm? It's
unlike you to make such idioTmatic remarks ... I'd be interested to
know what other C operators you think "shouldn't be used," and on what
grounds, however shaky. I'm sure it'd be amusing.
The other baddy is the conditon ? x : y operator. It doesn't mean anything
to someone who doesn't know C (but is maybe a skilled programmer in another
language, and is forced to maintain your C program by circumstance), and
usually if() ... else would be clearer.
However the use in macros is legitimate, and also sometimes if many
conditions are tested then it can lead to a more intuitive code layout.
++i doesn't have such redeeming features. The form should be banned, because
where it is used for the increment alone then it is completely exchangeable
with the postfix form. Where it is used in a compound expression with the
value taken, it leads to confusion. The postfix form is useful for iterating
through arrays, whilst the prefix form is almost never so useful.
(This does lead us to the interesting issue of whether prefix --i should
also be banned. If you want to reverse through an array, generally you will
be passed the size of it, i.e. and index one past the end.)