a style question
Karl Heuer
karl at haddock.ima.isc.com
Thu Oct 18 11:32:21 AEST 1990
In article <1990Oct12.225501.15701 at cbnewsm.att.com> lfd at cbnewsm.att.com (leland.f.derbenwick) writes:
>One of the main heritages of the PDP-11 is that most people use
>the constructs "*p++" and "*--p" more often than "*++p" and "*p--";
I disagree. My perception is that using half-open intervals (closed on the
left) simplifies many algorithms, and the logical way to step through such an
object is with *p++ or a[i++] (forward) or *--p or a[--i] (backward). The
antisymmetric nature of the PDP-11 addressing modes is the result, not the
cause.
Karl W. Z. Heuer (karl at ima.isc.com or uunet!ima!karl), The Walking Lint
More information about the Comp.lang.c
mailing list