Click here to Skip to main content
16,007,687 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: Straight from the horse's mouth Pin
  Forogar  14-Feb-12 7:49
professional  Forogar  14-Feb-12 7:49 
GeneralRe: Straight from the horse's mouth Pin
KP Lee14-Feb-12 12:51
KP Lee14-Feb-12 12:51 
GeneralRe: Straight from the horse's mouth Pin
Patrick Harris19-Feb-12 19:21
Patrick Harris19-Feb-12 19:21 
GeneralRe: Straight from the horse's mouth Pin
JackDingler14-Feb-12 8:31
JackDingler14-Feb-12 8:31 
GeneralRe: Straight from the horse's mouth Pin
Rob Grainger14-Feb-12 8:55
Rob Grainger14-Feb-12 8:55 
GeneralRe: Straight from the horse's mouth Pin
JackDingler14-Feb-12 9:02
JackDingler14-Feb-12 9:02 
GeneralRe: Straight from the horse's mouth Pin
patbob14-Feb-12 11:43
patbob14-Feb-12 11:43 
GeneralRe: Straight from the horse's mouth Pin
KP Lee14-Feb-12 13:54
KP Lee14-Feb-12 13:54 
It seems to be a characteristic of Microsoft programmers, that they want to prove they are clever by producing less readable code.

At times, the attempts at "clever" also makes the code a bug. It took me a week to convince the manager this was a bug:

if ((CurrentThreadCount - StepThreadCount) <= MaxThreadCount) getMoreThreads();


And that was clear-cut code, not even close to "clever". Three to five seconds after I first read it, I saw the bug correction needed:
if ((CurrentThreadCount + StepThreadCount) <= MaxThreadCount) getMoreThreads();


(It did take me about 40 seconds to verify in my mind my first thought for a correction was correct and about 15 minutes to go through the code and verify the names and method did what was suggested.)

What I did like about it was that the variable and method names were so clearly doing what the names suggested was being done.
GeneralRe: Straight from the horse's mouth Pin
K Quinn15-Feb-12 8:10
K Quinn15-Feb-12 8:10 
GeneralRe: Straight from the horse's mouth Pin
mbb0117-Feb-12 2:31
mbb0117-Feb-12 2:31 
GeneralRe: Straight from the horse's mouth Pin
Rob Grainger17-Feb-12 3:43
Rob Grainger17-Feb-12 3:43 
GeneralRe: Straight from the horse's mouth Pin
mbb0117-Feb-12 22:32
mbb0117-Feb-12 22:32 
GeneralDo you want string or string? Pin
BotCar9-Feb-12 21:10
BotCar9-Feb-12 21:10 
GeneralRe: Do you want string or string? Pin
GibbleCH10-Feb-12 3:41
GibbleCH10-Feb-12 3:41 
JokeRe: Do you want string or string? Pin
Chris Meech10-Feb-12 6:33
Chris Meech10-Feb-12 6:33 
GeneralRe: Do you want string or string? Pin
fjdiewornncalwe10-Feb-12 8:12
professionalfjdiewornncalwe10-Feb-12 8:12 
GeneralRe: Do you want string or string? Pin
Julien Villers13-Feb-12 22:07
professionalJulien Villers13-Feb-12 22:07 
GeneralRe: Do you want string or string? Pin
Dan Neely10-Feb-12 12:47
Dan Neely10-Feb-12 12:47 
GeneralRe: Do you want string or string? Pin
V.12-Feb-12 23:38
professionalV.12-Feb-12 23:38 
GeneralRe: Do you want string or string? Pin
OriginalGriff13-Feb-12 0:37
mveOriginalGriff13-Feb-12 0:37 
GeneralRe: Do you want string or string? Pin
CDP180213-Feb-12 2:22
CDP180213-Feb-12 2:22 
GeneralRe: Do you want string or string? Pin
OriginalGriff13-Feb-12 2:36
mveOriginalGriff13-Feb-12 2:36 
GeneralRe: Do you want string or string? Pin
KP Lee14-Feb-12 14:15
KP Lee14-Feb-12 14:15 
GeneralRe: Do you want string or string? Pin
KP Lee14-Feb-12 14:21
KP Lee14-Feb-12 14:21 
GeneralRe: Do you want string or string? Pin
BobJanova13-Feb-12 3:48
BobJanova13-Feb-12 3:48 

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.