Click here to Skip to main content

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, embarrasing 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: Logical thinking could get very complicated PinmemberYDaoust15-Apr-13 21:27 
GeneralRe: Logical thinking could get very complicated PinmemberTomz_KV16-Apr-13 2:34 
GeneralUnambiguously Ambiguous PinprotectorAspDotNetDev10-Apr-13 16:53 
GeneralRe: Unambiguously Ambiguous PinprofessionalBrisingr Aerowing10-Apr-13 18:13 
GeneralRe: Unambiguously Ambiguous PinmvpMika Wendelius10-Apr-13 19:37 
GeneralRe: Unambiguously Ambiguous PinmemberJim Meadors10-Apr-13 20:11 
GeneralRe: Unambiguously Ambiguous Pinmember d@nish 10-Apr-13 23:07 
GeneralLet's "switch" to Something Else PinmemberTom Delany2-Apr-13 10:31 
C++ code.
 
This is either brilliant, or just bloody awful. I'm coming down on the side of "bloody awful":
 
recv in the curr structure below is declared as:
 
    
    BYTE recv[64];
 
    DWORD   verb;
    ...
    verb = (upper[curr->recv[0]] << 24) + (upper[curr->recv[1]] << 16) + (upper[curr->recv[2]] << 8) + 0x20;
 
    switch (verb)
    {
    case 'CMD ':
       ...
       break;
 
    case 'MON ':
       ...
       break;
 
    case 'END ':
       ...
       break;
 
    case 'EXT ':
       ...
       break;
 
    default:
        ...
        break;
    }
WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated.
 
There are 10 kinds of people in the world: People who know binary and people who don't.

GeneralRe: Let's "switch" to Something Else PinprofessionalBrisingr Aerowing2-Apr-13 13:13 
GeneralRe: Let's "switch" to Something Else PinmemberFreak302-Apr-13 22:44 
GeneralRe: Let's "switch" to Something Else PinmemberBernhard Hiller2-Apr-13 23:29 
GeneralRe: Let's "switch" to Something Else PinmemberPIEBALDconsult3-Apr-13 6:13 
GeneralRe: Let's "switch" to Something Else PinmemberH.Brydon13-Apr-13 15:22 
GeneralRe: Let's "switch" to Something Else PinmemberPIEBALDconsult13-Apr-13 20:39 
GeneralRe: Let's "switch" to Something Else PinmemberH.Brydon14-Apr-13 10:07 
GeneralRe: Let's "switch" to Something Else PinmvpOriginalGriff3-Apr-13 7:25 
GeneralRe: Let's "switch" to Something Else PinmemberTom Delany3-Apr-13 9:02 
GeneralRe: Let's "switch" to Something Else PinmvpOriginalGriff3-Apr-13 9:14 
GeneralRe: Let's "switch" to Something Else PinmemberBobJanova4-Apr-13 0:27 
GeneralRe: Let's "switch" to Something Else Pinmemberjibalt5-Apr-13 20:20 
GeneralRe: Let's "switch" to Something Else PinmemberBobJanova8-Apr-13 1:48 
GeneralRe: Let's "switch" to Something Else Pinmemberjibalt9-Apr-13 0:42 
GeneralRe: Let's "switch" to Something Else PinmemberBobJanova10-Apr-13 0:23 
GeneralRe: Let's "switch" to Something Else Pinmemberjibalt10-Apr-13 7:33 
GeneralRe: Let's "switch" to Something Else PinmemberRob Grainger9-Apr-13 3:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 25 Nov 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid