more about programming style

Ray Butterworth rbutterworth at watmath.UUCP
Mon Aug 19 23:33:09 AEST 1985


> > > What chance is there of having assignment denoted by := in the standard?
> > > The reason I would like this is then ALL assignments ( +=, |=, etc) would
> > > be two characters long (consistancy!!). Among other things this would minimize
> > > the = vs == type errors.
> > > Todd Olson        
> > Um, what about <<= & >>=?
> Simple.  Replace <= with .le. and >= with .ge., < with .lt., > with .gt..
> Then Shift can become < or >, and shift assignment can be <= or >=.
>                     Tim Smith     ihnp4!{cithep,wlbr!callan}!tim

Even simpler.  Replace "<=" with "!>", and ">=" with "!<".  This gives
even more consistency since you can now have "!<", "!>", and "!=".

(On my first job, programming in COBOL, we were taught to always use
"is not greater than" instead of "is less than or equal to", since the
particular IBM compiler we were using actually generated two tests
because of the "or":  one for the "less than" and another for the
"equal to".)



More information about the Comp.lang.c mailing list