more about programming style

P. Vijay vijay at topaz.ARPA
Sat Jul 13 02:34:10 AEST 1985


> [DHowell.ES at Xerox writes about not using idioms...]
>.....
> variable is being incremented when it shouldn't be.  However I don't
> know that the variable is being incremented because I see this cryptic
> "stuff++" which I pretty much ignore because the code is full of things
> like that which gets lost in the shuffle.  I'm lost, the programmer
> doesn't know what's wrong, and we're stuck.
> 
> However if the program said "stuff = stuff + 1" or even
> "increment(stuff)", I could say "Aha! I think I know why it's not

	It all comes down to personal taste. You quote "stuff = stuff
+ 1" as a very readable statement. But is it not another of those
'idioms' that you seem to have a distaste for?

	While I do think usage of obscure idioms does tend to make the
program text difficult to understand, certain common idioms are in
fact quite useful in getting the point across both to the compiler and
to the human reader. If you are into the business of fixing code in
language X, I am afraid sooner or later you going to have to learn the
idomatic usages (at least the common ones) of X, not only so that you
could understand other's code, but also that others may understand
your code.

					--Vijay--



More information about the Comp.lang.c mailing list