Click here to Skip to main content
15,867,880 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: Tell me what's wrong with the following Pin
Gary R. Wheeler4-May-22 12:30
Gary R. Wheeler4-May-22 12:30 
GeneralRe: Tell me what's wrong with the following Pin
Mircea Neacsu4-May-22 9:09
Mircea Neacsu4-May-22 9:09 
GeneralRe: Tell me what's wrong with the following Pin
Greg Utas4-May-22 10:09
professionalGreg Utas4-May-22 10:09 
GeneralRe: Tell me what's wrong with the following Pin
Randor 4-May-22 10:44
professional Randor 4-May-22 10:44 
GeneralRe: Tell me what's wrong with the following Pin
Greg Utas4-May-22 11:38
professionalGreg Utas4-May-22 11:38 
GeneralRe: Tell me what's wrong with the following Pin
Randor 4-May-22 11:49
professional Randor 4-May-22 11:49 
GeneralRe: Tell me what's wrong with the following Pin
Gary R. Wheeler4-May-22 12:33
Gary R. Wheeler4-May-22 12:33 
GeneralRe: Tell me what's wrong with the following Pin
Gary R. Wheeler4-May-22 12:48
Gary R. Wheeler4-May-22 12:48 
Mircea Neacsu wrote:
The unsigned long of 1 bit?
An unsigned value 1 bit in width is slightly more useful than a signed value 1 bit in width, if you think about it.
Mircea Neacsu wrote:
The SendBlock doubly defined?
That's the error I was referring to. IMO the compiler should issue an error, since the identifier SendBlock is ambiguous when referencing fields in the struct. This code is compiled using VS2008 which does not issue a diagnostic.
Mircea Neacsu wrote:
The version union with members in wrong order?
They're in the correct order. The Message value must be at the end of the structure, since it is a placeholder for the beginning of the variable-length data that's included in the message.
Mircea Neacsu wrote:
The complete lack of comments?
This is a code fragment, extracted from a header file that provides more context.
Mircea Neacsu wrote:
hope they pay you well to put up with this pile of manure WTF | :WTF:
They do pay me well, in the coin that really matters: appreciation. I've worked for the same company for over 30 years, and have survived numerous "workforce reduction" actions during the last period of financial instability.

As to its fecal quality, I didn't create this originally but I have maintained it over the last 20 years. This 'weird & wonderful' came up during some refactoring I'm doing while adding a new feature.
Software Zen: delete this;

GeneralRe: Tell me what's wrong with the following Pin
Mircea Neacsu4-May-22 13:40
Mircea Neacsu4-May-22 13:40 
GeneralRe: Tell me what's wrong with the following Pin
Gary R. Wheeler4-May-22 14:28
Gary R. Wheeler4-May-22 14:28 
GeneralRe: Tell me what's wrong with the following Pin
Randor 4-May-22 12:06
professional Randor 4-May-22 12:06 
GeneralRe: Tell me what's wrong with the following Pin
Gary R. Wheeler4-May-22 12:53
Gary R. Wheeler4-May-22 12:53 
GeneralRe: Tell me what's wrong with the following Pin
charlieg15-May-22 1:33
charlieg15-May-22 1:33 
GeneralRe: Tell me what's wrong with the following Pin
Gary R. Wheeler15-May-22 3:16
Gary R. Wheeler15-May-22 3:16 
GeneralRe: Tell me what's wrong with the following Pin
charlieg20-Jul-22 8:03
charlieg20-Jul-22 8:03 
GeneralRe: Tell me what's wrong with the following Pin
englebart1-Sep-22 14:18
professionalenglebart1-Sep-22 14:18 
RantTaking responsibility Pin
Andreas Mertens27-Apr-22 8:32
professionalAndreas Mertens27-Apr-22 8:32 
GeneralRe: Taking responsibility Pin
PIEBALDconsult27-Apr-22 11:45
mvePIEBALDconsult27-Apr-22 11:45 
GeneralRe: Taking responsibility Pin
Andreas Mertens27-Apr-22 12:08
professionalAndreas Mertens27-Apr-22 12:08 
GeneralRe: Taking responsibility Pin
PIEBALDconsult27-Apr-22 13:11
mvePIEBALDconsult27-Apr-22 13:11 
GeneralRe: Taking responsibility Pin
charlieg26-Jul-22 10:37
charlieg26-Jul-22 10:37 
GeneralRe: Taking responsibility Pin
honey the codewitch30-Apr-22 2:15
mvahoney the codewitch30-Apr-22 2:15 
GeneralRe: Taking responsibility Pin
Andreas Mertens30-Apr-22 3:46
professionalAndreas Mertens30-Apr-22 3:46 
GeneralRe: Taking responsibility Pin
Richard Deeming27-Apr-22 21:20
mveRichard Deeming27-Apr-22 21:20 
GeneralRe: Taking responsibility Pin
Andreas Mertens28-Apr-22 4:05
professionalAndreas Mertens28-Apr-22 4:05 

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.