On Thu, May 14, 2009 at 1:48 PM, mikejd42 <[email protected]> wrote:
>> Up to a point - but the danger is that you end up with a design which is 
>> optimally coded that no-one can understand, and is hence difficult to debug 
>> and (assuming you can get it working) maintain.
>
> I beg to differ:
>
> newpixel = ( pixel1 + pixel2 ) >> 1;
>
> This is hard to understand?

If you're aware of the idiom that >>1 is equivilant to dividing by 2, no.

When you're making a divide look like a bit operation yes.

Don't try to second guess the compiler where (a) it doesn't matter,
and (b) is *likely* to confuse.


-- 
PJH

http://shabbleland.myminicity.com/com
http://www.chavgangs.com/register.php?referer=9375

Reply via email to