Click here to Skip to main content
15,868,016 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: What this 'null' check doing here... Pin
Mohammed Hameed10-Jul-13 19:47
professionalMohammed Hameed10-Jul-13 19:47 
GeneralRe: What this 'null' check doing here... Pin
MainFrameMan_ALIVE_AND_WELL$$10-Jul-13 10:03
MainFrameMan_ALIVE_AND_WELL$$10-Jul-13 10:03 
GeneralRe: What this 'null' check doing here... Pin
Mohammed Hameed10-Jul-13 19:48
professionalMohammed Hameed10-Jul-13 19:48 
GeneralRe: What this 'null' check doing here... Pin
KP Lee10-Jul-13 21:13
KP Lee10-Jul-13 21:13 
GeneralRe: What this 'null' check doing here... Pin
Mohammed Hameed10-Jul-13 21:15
professionalMohammed Hameed10-Jul-13 21:15 
GeneralRe: What this 'null' check doing here... Pin
DarkChuky CR12-Jul-13 12:56
DarkChuky CR12-Jul-13 12:56 
GeneralRe: What this 'null' check doing here... Pin
Mohammed Hameed14-Jul-13 19:46
professionalMohammed Hameed14-Jul-13 19:46 
GeneralRe: What this 'null' check doing here... Pin
Chad3F13-Jul-13 19:17
Chad3F13-Jul-13 19:17 
Now a smart compiler should probably want about this. Something like when comparing signed and unsigned int's in C and it warns that the statement is always true (or false) due to conversion rules.

Seems like maybe (I know.. "maybe?!?!") a programmer that didn't know what they're doing. That you have to first "create" the list, so you can "fill it in" with the GetEmployees() values or something. Along the same lines as novice programmers that create and assign a local number (or string) variable with a constant value because the function was prototyped with that data type, rather than pass the same constant number inline to the call.

Could be worse.. I've seen this in [employed to write] software:
C++
#define ZERO 0
#define ONE  1
#define TWO  2

D'Oh! | :doh:
GeneralRe: What this 'null' check doing here... Pin
Mohammed Hameed14-Jul-13 19:45
professionalMohammed Hameed14-Jul-13 19:45 
GeneralRe: What this 'null' check doing here... Pin
Chad3F14-Jul-13 19:55
Chad3F14-Jul-13 19:55 
GeneralMore mining from our deep seam of WTF's Pin
Rob Grainger1-Jul-13 3:17
Rob Grainger1-Jul-13 3:17 
GeneralRe: More mining from our deep seam of WTF's Pin
jim lahey1-Jul-13 4:13
jim lahey1-Jul-13 4:13 
GeneralRe: More mining from our deep seam of WTF's Pin
Rob Grainger1-Jul-13 4:54
Rob Grainger1-Jul-13 4:54 
GeneralRe: More mining from our deep seam of WTF's Pin
charlieg1-Jul-13 5:10
charlieg1-Jul-13 5:10 
JokeRe: More mining from our deep seam of WTF's Pin
jim lahey2-Jul-13 22:58
jim lahey2-Jul-13 22:58 
GeneralRe: More mining from our deep seam of WTF's Pin
Nagy Vilmos3-Jul-13 2:58
professionalNagy Vilmos3-Jul-13 2:58 
GeneralRe: More mining from our deep seam of WTF's Pin
Rob Grainger3-Jul-13 22:53
Rob Grainger3-Jul-13 22:53 
GeneralRe: More mining from our deep seam of WTF's Pin
vonb3-Jul-13 23:35
vonb3-Jul-13 23:35 
GeneralRe: More mining from our deep seam of WTF's Pin
Rob Grainger4-Jul-13 2:20
Rob Grainger4-Jul-13 2:20 
GeneralRe: More mining from our deep seam of WTF's Pin
vonb4-Jul-13 3:15
vonb4-Jul-13 3:15 
GeneralRe: More mining from our deep seam of WTF's Pin
Nicholas Marty4-Jul-13 3:38
professionalNicholas Marty4-Jul-13 3:38 
GeneralRe: More mining from our deep seam of WTF's Pin
vonb4-Jul-13 3:48
vonb4-Jul-13 3:48 
GeneralRe: More mining from our deep seam of WTF's Pin
Raybarg8-Jul-13 20:56
professionalRaybarg8-Jul-13 20:56 
GeneralRe: More mining from our deep seam of WTF's Pin
Rob Grainger9-Jul-13 0:00
Rob Grainger9-Jul-13 0:00 
GeneralRe: More mining from our deep seam of WTF's Pin
Raybarg9-Jul-13 19:14
professionalRaybarg9-Jul-13 19:14 

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.