Click here to Skip to main content
15,881,413 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: This is a really neat website for converting file formats Pin
honey the codewitch6-Jun-21 4:39
mvahoney the codewitch6-Jun-21 4:39 
GeneralRe: This is a really neat website for converting file formats Pin
Ron Anders6-Jun-21 5:19
Ron Anders6-Jun-21 5:19 
GeneralRe: This is a really neat website for converting file formats Pin
Greg Utas6-Jun-21 6:09
professionalGreg Utas6-Jun-21 6:09 
GeneralRe: This is a really neat website for converting file formats Pin
Ron Anders6-Jun-21 12:39
Ron Anders6-Jun-21 12:39 
GeneralRe: This is a really neat website for converting file formats Pin
Richard Deeming6-Jun-21 21:53
mveRichard Deeming6-Jun-21 21:53 
GeneralRe: This is a really neat website for converting file formats Pin
Mike Hankey19-Jun-21 6:23
mveMike Hankey19-Jun-21 6:23 
GeneralRe: This is a really neat website for converting file formats Pin
honey the codewitch19-Jun-21 6:24
mvahoney the codewitch19-Jun-21 6:24 
RantA career first for me Pin
Gary Wheeler5-Jun-21 4:56
Gary Wheeler5-Jun-21 4:56 
I have been working as a developer for a little over 40 years. In all that time, I have kept my comments clean. I am an avid user of curse words in my normal conversations, both verbal and online. It just always seemed unprofessional to use vulgar language in my code. Until today.
C
/***********************************************************
 * USELESS SHIT LEFT OVER FROM THE ORIGINAL IMPLEMENTATION *
 ***********************************************************/
I am now saddled with responsible for a piece of product code that is over 30 years old and still in active use. It's in C and started out on custom-built embedded hardware. Now it runs under Windows on an industrial PC. The original creator of this pus-oozing bedsore author of this stuff deliberately wrote it in a fashion that no one else could maintain it. He even cultivated a mythology about it, that it was dangerous for other people to even look at it, because it was so "performance-intensive". A few years ago he decided to retire rather than accept reassignment to another product. A succession of other people have taken it over, but no significant maintenance has been performed.

We now have a hardware obsolescence issue that requires a code change. I've spent well over 100 hours over the last month going through the code, finding all references to the bits that need replaced. Based on my study, only 4 out of the over 20 functions in the module really do anything with the hardware that's going obsolete. The rest are basically stubs and no-ops, but their return values are used to direct logic elsewhere. I have had to trace every single reference to the functions and the global values involved to ensure that it was safe to change things. I had to leave all these other bits in place because removing them would have wreaked havoc in other logic I don't want to touch.

After all this, it took me less than a day to write the new code.
Software Zen: delete this;

GeneralRe: A career first for me Pin
Greg Utas5-Jun-21 5:10
professionalGreg Utas5-Jun-21 5:10 
GeneralRe: A career first for me Pin
Gary Wheeler5-Jun-21 5:44
Gary Wheeler5-Jun-21 5:44 
GeneralRe: A career first for me Pin
Greg Utas5-Jun-21 5:49
professionalGreg Utas5-Jun-21 5:49 
JokeRe: A career first for me Pin
Daniel Pfeffer5-Jun-21 8:39
professionalDaniel Pfeffer5-Jun-21 8:39 
GeneralRe: A career first for me Pin
Gary Wheeler6-Jun-21 6:17
Gary Wheeler6-Jun-21 6:17 
GeneralRe: A career first for me Pin
Caslen8-Aug-21 23:44
Caslen8-Aug-21 23:44 
GeneralRe: A career first for me Pin
Gary Wheeler9-Aug-21 2:44
Gary Wheeler9-Aug-21 2:44 
GeneralRe: A career first for me Pin
honey the codewitch5-Jun-21 12:20
mvahoney the codewitch5-Jun-21 12:20 
GeneralRe: A career first for me Pin
Gary Wheeler6-Jun-21 6:25
Gary Wheeler6-Jun-21 6:25 
GeneralRe: A career first for me Pin
honey the codewitch6-Jun-21 7:19
mvahoney the codewitch6-Jun-21 7:19 
GeneralRe: A career first for me Pin
Bernhard Hiller6-Jun-21 20:35
Bernhard Hiller6-Jun-21 20:35 
GeneralRe: A career first for me Pin
MarkTJohnson8-Jun-21 4:16
professionalMarkTJohnson8-Jun-21 4:16 
GeneralRe: A career first for me Pin
Gary Wheeler8-Jun-21 4:20
Gary Wheeler8-Jun-21 4:20 
GeneralRe: A career first for me Pin
Mike Hankey19-Jun-21 5:39
mveMike Hankey19-Jun-21 5:39 
GeneralRe: A career first for me Pin
Slow Eddie10-Jul-21 4:25
professionalSlow Eddie10-Jul-21 4:25 
GeneralRe: A career first for me Pin
Gary Wheeler12-Jul-21 2:46
Gary Wheeler12-Jul-21 2:46 
GeneralRe: A career first for me Pin
kapalmuks<329-Aug-21 11:49
kapalmuks<329-Aug-21 11:49 

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.