> Postfix dereference is better precisely because dwheeler's mistaken
> interpretation is possible only with prefix dereference.
You can always get it wrong:
while (*dst++ = *src++) ;
!=
while (dst^++ = src^++) ;
...and:
++*dst;
!=
++dst^;
...maybe if you are used to it, it does seem marginally better (and I guess both of the above postfix examples could give warnings). But IMO the much bigger win is to have something that 99.999% of the programmers on the planet will instantly understand (and make porting code easier), instead of having them say WTF!
Posted Jan 28, 2010 1:36 UTC (Thu) by droundy (subscriber, #4559)
[Link]
Fortunately, these examples don't apply to go, since go lacks pointer
arithmetic. Also, the ++ operator is changed to a statement in go, also to
avoid this sort of confusion.