it falls under the category of "being (too) clever".
i did consider "lazy", as when you see
x = ~0;
or
x = 0^0; // this looks funny too!
but it is too specific to a 16 bit mask.
On Oct 8, 2010, at 10:48 AM, Michael Tiernan wrote:
----- "Tom Limoncelli" <[email protected]> wrote:
I see this in code now and then:
1<<16-1
Being just a system geek and not a professional programmer, I don't
understand why one would use that notation instead of the more
obvious variations of "0x8000"?
I understand that the compiler, at compile time (not run time) will
figure out that the programmer "meant" 0x8000 from that piece of
code so the end result is the same but it seems that for
documentation purposes it'd be more obvious to do it the other way.
Am I missing something?
Thanks for letting me ask.
--
<< MCT >> Michael C Tiernan
http://www.linkedin.com/in/mtiernan
Non Impediti Ratione Cogatationis
_______________________________________________
Tech mailing list
[email protected]
http://lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
http://lopsa.org/
------------------
Andrew Hume (best -> Telework) +1 623-551-2845
[email protected] (Work) +1 none currently
AT&T Labs - Research; member of USENIX and LOPSA
_______________________________________________
Tech mailing list
[email protected]
http://lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
http://lopsa.org/