[CLN-list] doc: "Obfuscating operators"

Ron Garret ron at flownet.com
Wed Jan 23 01:29:13 CET 2008


On Jan 22, 2008, at 3:07 PM, Bruno Haible wrote:

> Richard B. Kreckel wrote:
>>> For me the shortcut operators
>>> as in a+=b are more readable than the long a=a+b form.
>>
>> I do admit that I find the shortcuts more readable, too.
>
> I think it depends. When you are summing up a power series,
>
>   sum += factor/(2*n+1)
>
> makes perfect sense. But I also have seen things like this:
>
>   x += x >> 2;
>
> which really is less readable than
>
>   x = 1.25 * x;

<puzzlement> Don't those two statements do different things? </ 
puzzlement>

rg



More information about the CLN-list mailing list