Click here to Skip to main content
15,891,431 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: I didn't really think that people like this existed . . . Pin
Derek Bartram22-Mar-08 1:05
Derek Bartram22-Mar-08 1:05 
GeneralA little tiny horror Pin
Gary Wheeler8-Jan-08 9:17
Gary Wheeler8-Jan-08 9:17 
GeneralRe: A little tiny horror PinPopular
QuiJohn8-Jan-08 10:29
QuiJohn8-Jan-08 10:29 
GeneralRe: A little tiny horror PinPopular
Chris Maunder8-Jan-08 16:24
cofounderChris Maunder8-Jan-08 16:24 
GeneralRe: A little tiny horror Pin
peterchen9-Jan-08 12:27
peterchen9-Jan-08 12:27 
GeneralRe: A little tiny horror Pin
PaulPrice10-Jan-08 1:32
PaulPrice10-Jan-08 1:32 
GeneralRe: A little tiny horror Pin
RichardM114-Jan-08 10:09
RichardM114-Jan-08 10:09 
GeneralRe: A little tiny horror Pin
Robert Surtees8-Jan-08 17:34
Robert Surtees8-Jan-08 17:34 
David Kentley wrote:
It's possible that, as an optimization, "fixing" this has zero impact on real world performance while (slightly) obfuscating the code.


I'm pretty sure pow() only takes and returns doubles which means the original code is casting two ints in and one back out in addition to its internal pow goodness. I'm guessing the shift is a wee bit faster. Smile | :)
GeneralRe: A little tiny horror Pin
jhwurmbach8-Jan-08 23:59
jhwurmbach8-Jan-08 23:59 
JokeRe: A little tiny horror Pin
Robert Surtees9-Jan-08 7:11
Robert Surtees9-Jan-08 7:11 
GeneralRe: A little tiny horror Pin
Gary Wheeler15-Jan-08 0:32
Gary Wheeler15-Jan-08 0:32 
GeneralRe: A little tiny horror Pin
CPallini9-Jan-08 7:35
mveCPallini9-Jan-08 7:35 
GeneralRe: A little tiny horror Pin
Gary Wheeler9-Jan-08 0:30
Gary Wheeler9-Jan-08 0:30 
GeneralRe: A little tiny horror Pin
CPallini9-Jan-08 3:14
mveCPallini9-Jan-08 3:14 
Generalit might calculate it wrong Pin
peterchen9-Jan-08 12:48
peterchen9-Jan-08 12:48 
GeneralRe: it might calculate it wrong Pin
Notorious_pd16-Jan-08 7:20
Notorious_pd16-Jan-08 7:20 
GeneralRe: A little tiny horror Pin
leppie8-Jan-08 22:20
leppie8-Jan-08 22:20 
GeneralRe: A little tiny horror Pin
Robert Rohde8-Jan-08 22:27
Robert Rohde8-Jan-08 22:27 
GeneralRe: A little tiny horror Pin
leppie9-Jan-08 1:45
leppie9-Jan-08 1:45 
GeneralRe: A little tiny horror Pin
Gary Wheeler9-Jan-08 0:40
Gary Wheeler9-Jan-08 0:40 
JokeRe: A little tiny horror Pin
KarstenK8-Jan-08 22:59
mveKarstenK8-Jan-08 22:59 
GeneralRe: A little tiny horror Pin
Gary Wheeler9-Jan-08 0:32
Gary Wheeler9-Jan-08 0:32 
JokeRe: A little tiny horror Pin
leppie9-Jan-08 1:57
leppie9-Jan-08 1:57 
JokeNope Pin
CPallini9-Jan-08 2:22
mveCPallini9-Jan-08 2:22 
GeneralRe: Nope Pin
leppie9-Jan-08 2:46
leppie9-Jan-08 2:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.