in reply to Re: Beautiful code I wrote ;-)
in thread Beautiful code I wrote ;-)
To be honest: It's still in there.
I don't see why this code should be "obfuscation". Yes. It might be difficult to tell the precedence of << and >> (which is equal) or the associativity. But that's the same with any operator.
Just because it's seldom used doesn't make this a valid argument.
And I think bitshifting is more appropriate to the task at hand than multiplication. After all: I have to set one bit.
The only way I can think of making it clearer is either (1<<$_)>>1 or 1<<($_-1) The later I think is a bit unclear as one has to know that shifting left by a negative amount is in fact shifting right.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Beautiful code I wrote ;-)
by ack (Deacon) on Jul 15, 2008 at 07:04 UTC |