Click here to Skip to main content
15,166,358 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.

 
GeneralUhhh... Pin
Brisingr Aerowing20-Apr-21 13:50
professionalBrisingr Aerowing20-Apr-21 13:50 
GeneralRe: Uhhh... Pin
Jon McKee20-Apr-21 14:23
professionalJon McKee20-Apr-21 14:23 
GeneralRe: Uhhh... Pin
MarkTJohnson21-Apr-21 6:00
professionalMarkTJohnson21-Apr-21 6:00 
GeneralRe: Uhhh... Pin
Gary Wheeler5-May-21 11:51
MemberGary Wheeler5-May-21 11:51 
GeneralRe: Uhhh... Pin
Brisingr Aerowing7-May-21 14:37
professionalBrisingr Aerowing7-May-21 14:37 
GeneralRe: Uhhh... Pin
Gary Wheeler7-May-21 14:47
MemberGary Wheeler7-May-21 14:47 
GeneralRe: Uhhh... Pin
Greg Utas7-May-21 15:41
mveGreg Utas7-May-21 15:41 
GeneralRe: Uhhh... Pin
Gary Wheeler7-May-21 16:01
MemberGary Wheeler7-May-21 16:01 
Ah, but there's a reason for the ridiculously long name. The name I listed is the longest for a group of enum values which are individual bits in a 32 bit mask. Each bit identifies a message that should be displayed to the operator. The equipment can identify a single message or several to be displayed at once. The messages don't lend themselves to any kind of consistent, concise naming scheme.

As we know, the following two problems are fundamentally difficult in computing:
  1. Cache invalidation
  2. Creating appropriate identifiers
  3. Off-by-1 errors
The simplest and most logically consistent naming for each bit was therefore the text for that bit, with minor transformations to convert the text into a valid C++ identifier. Space characters and all punctuation became underscores, and Bob's your uncle.

Just to add to your excitement over this challenging and seemingly intransigent problem, there is ongoing grumbling from the equipment group over the text I actually display based upon each bit. They expect the exact text in their specification to be displayed. You see, I have this effete and unwanted fondness for grammatical English, which their text... isn't. We won't even mention (yes we will) the fact that our UI is also translated to French, Italian, German, Spanish, Japanese, Chinese Simplified, Korean, Polish, and Russian. Some folks just kind of expect us to speak their language.
Software Zen: delete this;

GeneralThere are times when I really wonder exactly what I was thinking ... Pin
OriginalGriff30-Mar-21 0:26
mveOriginalGriff30-Mar-21 0:26 
GeneralRe: There are times when I really wonder exactly what I was thinking ... Pin
Marc Clifton6-Apr-21 15:45
mvaMarc Clifton6-Apr-21 15:45 
GeneralRe: There are times when I really wonder exactly what I was thinking ... Pin
Sander Rossel11-Apr-21 1:32
professionalSander Rossel11-Apr-21 1:32 
GeneralRe: There are times when I really wonder exactly what I was thinking ... Pin
Bernhard Hiller6-Apr-21 21:52
MemberBernhard Hiller6-Apr-21 21:52 
GeneralRe: There are times when I really wonder exactly what I was thinking ... Pin
Dan Neely20-Apr-21 6:39
MemberDan Neely20-Apr-21 6:39 
GeneralC++ & Thinking about SSD & wear level Pin
raddevus27-Mar-21 12:58
mvaraddevus27-Mar-21 12:58 
GeneralRe: C++ & Thinking about SSD & wear level (updated) Pin
Peter_in_278027-Mar-21 17:03
professionalPeter_in_278027-Mar-21 17:03 
GeneralRe: C++ & Thinking about SSD & wear level (updated) Pin
raddevus27-Mar-21 18:47
mvaraddevus27-Mar-21 18:47 
GeneralRe: C++ & Thinking about SSD & wear level (updated) Pin
David O'Neil28-Mar-21 4:29
professionalDavid O'Neil28-Mar-21 4:29 
GeneralRe: C++ & Thinking about SSD & wear level (updated) Pin
raddevus28-Mar-21 4:37
mvaraddevus28-Mar-21 4:37 
GeneralRe: C++ & Thinking about SSD & wear level Pin
David O'Neil28-Mar-21 5:14
professionalDavid O'Neil28-Mar-21 5:14 
GeneralRe: C++ & Thinking about SSD & wear level Pin
raddevus28-Mar-21 6:11
mvaraddevus28-Mar-21 6:11 
GeneralRe: C++ & Thinking about SSD & wear level Pin
David O'Neil28-Mar-21 12:56
professionalDavid O'Neil28-Mar-21 12:56 
GeneralRe: C++ & Thinking about SSD & wear level Pin
raddevus28-Mar-21 13:50
mvaraddevus28-Mar-21 13:50 
GeneralRe: C++ & Thinking about SSD & wear level Pin
Dan Neely20-Apr-21 6:41
MemberDan Neely20-Apr-21 6:41 
GeneralAre you tired of keeping up with the latest changes? Pin
Slow Eddie20-Mar-21 3:58
professionalSlow Eddie20-Mar-21 3:58 
GeneralRe: Are you tired of keeping up with the latest changes? Pin
Julian Ragan20-Mar-21 4:22
MemberJulian Ragan20-Mar-21 4:22 

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.