Click here to Skip to main content
15,908,901 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
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 
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 
I shouldn't worry about it, if you're accessing a data layer any saving from avoiding allocating 32-bits on the stack is negligible.

Premature optimisation is the root of all evil.

The only actual "improvement" you've made is that the code occupies less space on screen. All the "improvements" you claim will be performed by a decent optimising compiler on release code anyway.

Design for readability/maintainability, then optimise as you have evidence it is worthwhile.
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? Pin
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 
GeneralRe: What one Should do if Program warns you about one's uninitialized variable? Pin
Nagy Vilmos12-Jan-12 1:00
professionalNagy Vilmos12-Jan-12 1:00 
QuestionRe: What one Should do if Program warns you about one's uninitialized variable? Pin
Julien Villers12-Jan-12 4:32
professionalJulien Villers12-Jan-12 4:32 

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.