News for hackers. Stuff that matters.
Re:FizzleFade by biesnecker on Tuesday August 29, 2017 @08:44AM (#15123881)
Did your coworker correct it with "this is more readable" or "this is the correct way to do it"? The first is arguable (though I don't personally agree with the argument), the second just betrays a real lack of knowledge.
Re:FizzleFade by sammoth on Tuesday August 29, 2017 @12:13PM (#15125283)
Don't the two bits of code have completely different behaviour? And the code with the bitshift is undefined on negative integers (in C). So the bottom code could indeed be the "correct way to do it".
Re:FizzleFade by biesnecker on Tuesday August 29, 2017 @05:21PM (#15127698)
Fair, with negative ints they're different. They have the same behavior on positive ints, though.