Click here to Skip to main content
15,887,135 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: The joys of outsourcing Pin
Bernhard Hiller31-Jan-17 21:34
Bernhard Hiller31-Jan-17 21:34 
GeneralI'm a-feared Pin
Marc Clifton30-Jan-17 5:35
mvaMarc Clifton30-Jan-17 5:35 
GeneralRe: I'm a-feared Pin
Sander Rossel30-Jan-17 6:08
professionalSander Rossel30-Jan-17 6:08 
GeneralRe: I'm a-feared Pin
#realJSOP30-Jan-17 6:35
mve#realJSOP30-Jan-17 6:35 
GeneralRe: I'm a-feared Pin
Tim Carmichael30-Jan-17 8:51
Tim Carmichael30-Jan-17 8:51 
GeneralRe: I'm a-feared Pin
Sander Rossel30-Jan-17 9:03
professionalSander Rossel30-Jan-17 9:03 
GeneralRe: I'm a-feared Pin
Sander Rossel30-Jan-17 9:00
professionalSander Rossel30-Jan-17 9:00 
GeneralRe: I'm a-feared Pin
Pualee31-Jan-17 4:32
Pualee31-Jan-17 4:32 
Sander Rossel wrote:
I've met a developer who was afraid to throw away some code that was never reached, something like if (false) { ... } (maybe some test code once?) because "what if that code DOES do something?" What the hell, that code never did, never does and never will do anything so just friggin delete it already!


I have seen it do something before...

I worked on a project written in C for an embedded platform. The memory management was so horrible, it would declare global arrays of int16 in one file, and process them as extern int32 in other files. Many of these arrays held results of tests and pointers to other methods that had to execute.

You may thing that if (false) { do something } is never reached. But on that system, you actually could not guarantee the code processed line by line! There were some wild hacks around it. Ultimately, I found the memory management problems, and everything began working in a predictable manner.

I won't defend the programmer in your example, but I know why he/she was gun shy Poke tongue | ;-P Ultimately, there was a bigger bug to squash.
GeneralRe: I'm a-feared Pin
Sander Rossel31-Jan-17 8:57
professionalSander Rossel31-Jan-17 8:57 
GeneralRe: I'm a-feared Pin
Pualee31-Jan-17 4:27
Pualee31-Jan-17 4:27 
GeneralRe: I'm a-feared Pin
Sander Rossel31-Jan-17 9:01
professionalSander Rossel31-Jan-17 9:01 
GeneralRe: I'm a-feared Pin
Rob Grainger31-Jan-17 5:36
Rob Grainger31-Jan-17 5:36 
GeneralRe: I'm a-feared Pin
Jeremy Falcon30-Jan-17 6:45
professionalJeremy Falcon30-Jan-17 6:45 
GeneralRe: I'm a-feared Pin
Marc Clifton30-Jan-17 11:21
mvaMarc Clifton30-Jan-17 11:21 
GeneralRe: I'm a-feared Pin
Jeremy Falcon30-Jan-17 11:22
professionalJeremy Falcon30-Jan-17 11:22 
GeneralRe: I'm a-feared Pin
Marc Clifton30-Jan-17 12:08
mvaMarc Clifton30-Jan-17 12:08 
GeneralRe: I'm a-feared Pin
Jeremy Falcon30-Jan-17 12:51
professionalJeremy Falcon30-Jan-17 12:51 
GeneralRe: I'm a-feared Pin
Bernhard Hiller30-Jan-17 23:37
Bernhard Hiller30-Jan-17 23:37 
RantA database view that affects the underlying data?! Pin
PIEBALDconsult26-Jan-17 7:27
mvePIEBALDconsult26-Jan-17 7:27 
GeneralRe: A database view that affects the underlying data?! Pin
Brisingr Aerowing26-Jan-17 8:12
professionalBrisingr Aerowing26-Jan-17 8:12 
GeneralMessage Removed Pin
26-Jan-17 8:51
professionalN_tro_P26-Jan-17 8:51 
GeneralRe: A database view that affects the underlying data?! Pin
Eddy Vluggen26-Jan-17 9:43
professionalEddy Vluggen26-Jan-17 9:43 
GeneralRe: A database view that affects the underlying data?! Pin
PIEBALDconsult26-Jan-17 15:12
mvePIEBALDconsult26-Jan-17 15:12 
GeneralMessage Removed Pin
27-Jan-17 3:22
professionalN_tro_P27-Jan-17 3:22 
GeneralRe: A database view that affects the underlying data?! Pin
Eddy Vluggen27-Jan-17 3:39
professionalEddy Vluggen27-Jan-17 3:39 

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.