Click here to Skip to main content
11,414,670 members (67,575 online)

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 Pin
OriginalGriff13-Apr-13 0:16
mvpOriginalGriff13-Apr-13 0:16 
GeneralRe: Logical thinking could get very complicated [modified] Pin
ENOTTY13-Apr-13 21:40
memberENOTTY13-Apr-13 21:40 
GeneralRe: Logical thinking could get very complicated Pin
Tomz_KV15-Apr-13 2:40
memberTomz_KV15-Apr-13 2:40 
JokeRe: Logical thinking could get very complicated Pin
Bernhard Hiller14-Apr-13 23:01
memberBernhard Hiller14-Apr-13 23:01 
GeneralRe: Logical thinking could get very complicated Pin
Tomz_KV15-Apr-13 2:42
memberTomz_KV15-Apr-13 2:42 
GeneralRe: Logical thinking could get very complicated Pin
ENOTTY15-Apr-13 5:25
memberENOTTY15-Apr-13 5:25 
GeneralRe: Logical thinking could get very complicated Pin
YDaoust15-Apr-13 21:27
memberYDaoust15-Apr-13 21:27 
GeneralRe: Logical thinking could get very complicated Pin
Tomz_KV16-Apr-13 2:34
memberTomz_KV16-Apr-13 2:34 
GeneralUnambiguously Ambiguous Pin
AspDotNetDev10-Apr-13 16:53
protectorAspDotNetDev10-Apr-13 16:53 
GeneralRe: Unambiguously Ambiguous Pin
Brisingr Aerowing10-Apr-13 18:13
professionalBrisingr Aerowing10-Apr-13 18:13 
GeneralRe: Unambiguously Ambiguous Pin
Mika Wendelius10-Apr-13 19:37
mvpMika Wendelius10-Apr-13 19:37 
GeneralRe: Unambiguously Ambiguous Pin
Jim Meadors10-Apr-13 20:11
memberJim Meadors10-Apr-13 20:11 
GeneralRe: Unambiguously Ambiguous Pin
d@nish 10-Apr-13 23:07
member d@nish 10-Apr-13 23:07 
GeneralLet's "switch" to Something Else Pin
Tom Delany2-Apr-13 10:31
memberTom 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 Pin
Brisingr Aerowing2-Apr-13 13:13
professionalBrisingr Aerowing2-Apr-13 13:13 
GeneralRe: Let's "switch" to Something Else Pin
Freak302-Apr-13 22:44
memberFreak302-Apr-13 22:44 
GeneralRe: Let's "switch" to Something Else Pin
Bernhard Hiller2-Apr-13 23:29
memberBernhard Hiller2-Apr-13 23:29 
GeneralRe: Let's "switch" to Something Else Pin
PIEBALDconsult3-Apr-13 6:13
memberPIEBALDconsult3-Apr-13 6:13 
GeneralRe: Let's "switch" to Something Else Pin
H.Brydon13-Apr-13 15:22
memberH.Brydon13-Apr-13 15:22 
GeneralRe: Let's "switch" to Something Else Pin
PIEBALDconsult13-Apr-13 20:39
memberPIEBALDconsult13-Apr-13 20:39 
GeneralRe: Let's "switch" to Something Else Pin
H.Brydon14-Apr-13 10:07
memberH.Brydon14-Apr-13 10:07 
GeneralRe: Let's "switch" to Something Else Pin
OriginalGriff3-Apr-13 7:25
mvpOriginalGriff3-Apr-13 7:25 
GeneralRe: Let's "switch" to Something Else Pin
Tom Delany3-Apr-13 9:02
memberTom Delany3-Apr-13 9:02 
GeneralRe: Let's "switch" to Something Else Pin
OriginalGriff3-Apr-13 9:14
mvpOriginalGriff3-Apr-13 9:14 
GeneralRe: Let's "switch" to Something Else Pin
BobJanova4-Apr-13 0:27
memberBobJanova4-Apr-13 0:27 
GeneralRe: Let's "switch" to Something Else Pin
jibalt5-Apr-13 20:20
memberjibalt5-Apr-13 20:20 
GeneralRe: Let's "switch" to Something Else Pin
BobJanova8-Apr-13 1:48
memberBobJanova8-Apr-13 1:48 
GeneralRe: Let's "switch" to Something Else Pin
jibalt9-Apr-13 0:42
memberjibalt9-Apr-13 0:42 
GeneralRe: Let's "switch" to Something Else Pin
BobJanova10-Apr-13 0:23
memberBobJanova10-Apr-13 0:23 
GeneralRe: Let's "switch" to Something Else Pin
jibalt10-Apr-13 7:33
memberjibalt10-Apr-13 7:33 
GeneralRe: Let's "switch" to Something Else Pin
Rob Grainger9-Apr-13 3:59
memberRob Grainger9-Apr-13 3:59 
GeneralRe: Let's "switch" to Something Else Pin
jschell9-Apr-13 10:05
memberjschell9-Apr-13 10:05 
GeneralRe: Let's "switch" to Something Else Pin
jibalt10-Apr-13 7:34
memberjibalt10-Apr-13 7:34 
GeneralRe: Let's "switch" to Something Else Pin
jschell10-Apr-13 9:17
memberjschell10-Apr-13 9:17 
GeneralRe: Let's "switch" to Something Else Pin
jibalt25-Apr-13 16:44
memberjibalt25-Apr-13 16:44 
GeneralRe: Let's "switch" to Something Else Pin
NAANsoft9-Apr-13 2:25
memberNAANsoft9-Apr-13 2:25 
GeneralRe: Let's "switch" to Something Else Pin
Rob Grainger9-Apr-13 4:01
memberRob Grainger9-Apr-13 4:01 
GeneralRe: Let's "switch" to Something Else Pin
NAANsoft9-Apr-13 5:23
memberNAANsoft9-Apr-13 5:23 
GeneralRe: Let's "switch" to Something Else Pin
jschell9-Apr-13 10:03
memberjschell9-Apr-13 10:03 
GeneralRe: Let's "switch" to Something Else Pin
Gary Wheeler4-Apr-13 1:47
memberGary Wheeler4-Apr-13 1:47 
GeneralRe: Let's "switch" to Something Else Pin
jibalt5-Apr-13 20:21
memberjibalt5-Apr-13 20:21 
GeneralRe: Let's "switch" to Something Else Pin
Gary Wheeler8-Apr-13 1:11
memberGary Wheeler8-Apr-13 1:11 
GeneralRe: Let's "switch" to Something Else Pin
CodeBubba9-Apr-13 2:52
memberCodeBubba9-Apr-13 2:52 
GeneralRe: Let's "switch" to Something Else Pin
RafagaX9-Apr-13 5:56
memberRafagaX9-Apr-13 5:56 
GeneralRe: Let's "switch" to Something Else Pin
Dan Sutton9-Apr-13 7:34
memberDan Sutton9-Apr-13 7:34 
GeneralRe: Let's "switch" to Something Else Pin
jschell9-Apr-13 10:08
memberjschell9-Apr-13 10:08 
GeneralRe: Let's "switch" to Something Else Pin
Martin081510-Apr-13 2:41
memberMartin081510-Apr-13 2:41 
GeneralThings that make you go WTF... Pin
Gary Wheeler1-Apr-13 2:32
memberGary Wheeler1-Apr-13 2:32 
GeneralRe: Things that make you go WTF... Pin
Matt T Heffron1-Apr-13 9:53
memberMatt T Heffron1-Apr-13 9:53 
GeneralRe: Things that make you go WTF... Pin
Gary Wheeler1-Apr-13 9:59
memberGary Wheeler1-Apr-13 9: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.150427.4 | Last Updated 27 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid