Re:Probably the worst URL scheme ever
by masnick on Thursday May 02, 2013 @08:41AM
(#5644070)
Oh so the *2s have some sort of meaning beyond random URL garbage? Please explain! I've always been curious.
[ Parent
| on HN ]
No, I think it is just a joke: if you parse "*2" as "times two" you could optimize it in code by shifting the bits left since bit shifting operations are cheaper than multiplication.
#b0001 = 1
#b0010 = 2
#b0100 = 4
#b1000 = 8
Haha thanks for the explanation.
And to continue on this tangent, if your code is multiplying by the constant 2 (e.g. "x = z * 2") the compiler's probably going to optimize that into a shift anyway, so just keep the "* 2" to keep future human readers of the code happy.