Click here to Skip to main content
15,891,689 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: Code Optimize Pin
Snorri Kristjansson18-Jan-12 22:23
professionalSnorri Kristjansson18-Jan-12 22:23 
GeneralRe: Code Optimize PinPopular
johannesnestler18-Jan-12 5:19
johannesnestler18-Jan-12 5:19 
GeneralRe: Code Optimize Pin
Jörgen Andersson18-Jan-12 21:28
professionalJörgen Andersson18-Jan-12 21:28 
GeneralRe: Code Optimize Pin
johannesnestler19-Jan-12 1:27
johannesnestler19-Jan-12 1:27 
GeneralRe: Code Optimize Pin
fjdiewornncalwe19-Jan-12 4:03
professionalfjdiewornncalwe19-Jan-12 4:03 
JokeRe: Code Optimize Pin
cpkilekofp27-Jan-12 8:54
cpkilekofp27-Jan-12 8:54 
GeneralRe: Code Optimize Pin
Snorri Kristjansson18-Jan-12 22:28
professionalSnorri Kristjansson18-Jan-12 22:28 
GeneralRe: Code Optimize Pin
Donkey Master17-Jan-12 0:56
Donkey Master17-Jan-12 0:56 
Thumbs Down | :thumbsdown: I disagree with the point the OP is trying to make. The original code is easier to readConfused | :confused: and debug Cry | :(( .

The second code has me counting nested parenthesis,
D'Oh! | :doh: and commas, it takes longer to read and understand when you're not familiar with the code, and it's harder to spot a factual error. Dead | X|

I reckon that when you're
reading the same code over and over Sniff | :^) ,
the shorter route works,Cool | :cool: but in a professional environment,Suspicious | :suss:
readable code
is better than
clever code.Thumbs Up | :thumbsup:

Except maybe when performance is critical, Smile | :) and your compiler is not awesome, Poke tongue | ;-P like in some embedded systems, or some video games. Hmmm | :|
"Computer Science is no more about computers than astronomy is about telescopes." - Edsger Dijkstra

GeneralRe: Code Optimize Pin
Rajesh Anuhya17-Jan-12 1:17
professionalRajesh Anuhya17-Jan-12 1:17 
GeneralRe: Code Optimize PinPopular
Rob Grainger17-Jan-12 3:31
Rob Grainger17-Jan-12 3:31 
GeneralRe: Code Optimize Pin
mrchief_200017-Jan-12 11:49
mrchief_200017-Jan-12 11:49 
GeneralRe: Code Optimize Pin
KP Lee17-Jan-12 21:25
KP Lee17-Jan-12 21:25 
GeneralRe: Code Optimize Pin
jschell17-Jan-12 11:50
jschell17-Jan-12 11:50 
GeneralRe: Code Optimize Pin
johannesnestler18-Jan-12 5:22
johannesnestler18-Jan-12 5:22 
GeneralRe: Code Optimize Pin
BobJanova17-Jan-12 1:25
BobJanova17-Jan-12 1:25 
GeneralRe: Code Optimize Pin
Rajesh Anuhya17-Jan-12 1:52
professionalRajesh Anuhya17-Jan-12 1:52 
GeneralRe: Code Optimize Pin
KP Lee17-Jan-12 21:11
KP Lee17-Jan-12 21:11 
GeneralRe: Code Optimize Pin
RobCroll18-Jan-12 15:57
RobCroll18-Jan-12 15:57 
GeneralRe: Code Optimize Pin
wg_self27-Jan-12 4:44
wg_self27-Jan-12 4:44 
GeneralCongratulations, you have overtaxed the .NET garbage collector! Pin
ekolis14-Jan-12 9:15
ekolis14-Jan-12 9:15 
GeneralWhy is dates so difficult? Pin
Jan Steyn12-Jan-12 23:26
Jan Steyn12-Jan-12 23:26 
GeneralRe: Why is dates so difficult? Pin
AspDotNetDev13-Jan-12 7:23
protectorAspDotNetDev13-Jan-12 7:23 
GeneralRe: Why is dates so difficult? PinPopular
John Hunley16-Jan-12 6:51
John Hunley16-Jan-12 6:51 
GeneralRe: Why is dates so difficult? Pin
Florin Jurcovici16-Jan-12 22:13
Florin Jurcovici16-Jan-12 22:13 
GeneralWhat one Should do if Program warns you about one's uninitialized variable? Pin
Mohibur Rashid11-Jan-12 21:29
professionalMohibur Rashid11-Jan-12 21:29 

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.