Click here to Skip to main content
15,180,347 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 5:39
mvahoney the codewitch6-Jun-21 5:39 
GeneralRe: This is a really neat website for converting file formats Pin
Ron Anders6-Jun-21 6:19
MemberRon Anders6-Jun-21 6:19 
GeneralRe: This is a really neat website for converting file formats Pin
Greg Utas6-Jun-21 7:09
mveGreg Utas6-Jun-21 7:09 
GeneralRe: This is a really neat website for converting file formats Pin
Ron Anders6-Jun-21 13:39
MemberRon Anders6-Jun-21 13:39 
GeneralRe: This is a really neat website for converting file formats Pin
Richard Deeming6-Jun-21 22:53
mveRichard Deeming6-Jun-21 22:53 
GeneralRe: This is a really neat website for converting file formats Pin
Mike Hankey19-Jun-21 7:23
professionalMike Hankey19-Jun-21 7:23 
GeneralRe: This is a really neat website for converting file formats Pin
honey the codewitch19-Jun-21 7:24
mvahoney the codewitch19-Jun-21 7:24 
RantA career first for me Pin
Gary Wheeler5-Jun-21 5:56
MemberGary Wheeler5-Jun-21 5: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 6:10
mveGreg Utas5-Jun-21 6:10 
GeneralRe: A career first for me Pin
Gary Wheeler5-Jun-21 6:44
MemberGary Wheeler5-Jun-21 6:44 
GeneralRe: A career first for me Pin
Greg Utas5-Jun-21 6:49
mveGreg Utas5-Jun-21 6:49 
JokeRe: A career first for me Pin
Daniel Pfeffer5-Jun-21 9:39
professionalDaniel Pfeffer5-Jun-21 9:39 
GeneralRe: A career first for me Pin
Gary Wheeler6-Jun-21 7:17
MemberGary Wheeler6-Jun-21 7:17 
GeneralRe: A career first for me Pin
Caslen9-Aug-21 0:44
MemberCaslen9-Aug-21 0:44 
GeneralRe: A career first for me Pin
Gary Wheeler9-Aug-21 3:44
MemberGary Wheeler9-Aug-21 3:44 
GeneralRe: A career first for me Pin
honey the codewitch5-Jun-21 13:20
mvahoney the codewitch5-Jun-21 13:20 
GeneralRe: A career first for me Pin
Gary Wheeler6-Jun-21 7:25
MemberGary Wheeler6-Jun-21 7:25 
GeneralRe: A career first for me Pin
honey the codewitch6-Jun-21 8:19
mvahoney the codewitch6-Jun-21 8:19 
GeneralRe: A career first for me Pin
Bernhard Hiller6-Jun-21 21:35
MemberBernhard Hiller6-Jun-21 21:35 
GeneralRe: A career first for me Pin
MarkTJohnson8-Jun-21 5:16
professionalMarkTJohnson8-Jun-21 5:16 
GeneralRe: A career first for me Pin
Gary Wheeler8-Jun-21 5:20
MemberGary Wheeler8-Jun-21 5:20 
GeneralRe: A career first for me Pin
Mike Hankey19-Jun-21 6:39
professionalMike Hankey19-Jun-21 6:39 
GeneralRe: A career first for me Pin
Slow Eddie10-Jul-21 5:25
professionalSlow Eddie10-Jul-21 5:25 
GeneralRe: A career first for me Pin
Gary Wheeler12-Jul-21 3:46
MemberGary Wheeler12-Jul-21 3:46 
GeneralRe: A career first for me Pin
kapalmuks<329-Aug-21 12:49
Memberkapalmuks<329-Aug-21 12: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.