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

 
GeneralLets make sure, shall we Pin
k50546-Nov-15 7:41
mvek50546-Nov-15 7:41 
GeneralRe: Lets make sure, shall we Pin
Richard Deeming6-Nov-15 8:16
mveRichard Deeming6-Nov-15 8:16 
GeneralRe: Lets make sure, shall we PinPopular
User 110609796-Nov-15 8:43
MemberUser 110609796-Nov-15 8:43 
GeneralRe: Lets make sure, shall we Pin
MacSpudster19-Nov-15 12:30
professionalMacSpudster19-Nov-15 12:30 
GeneralRe: Lets make sure, shall we Pin
Xmen Real 16-Dec-15 2:55
professional Xmen Real 16-Dec-15 2:55 
GeneralRe: Lets make sure, shall we Pin
User 1106097918-Dec-15 5:38
MemberUser 1106097918-Dec-15 5:38 
GeneralRe: Lets make sure, shall we Pin
Nguyen.H.H.Dang21-Aug-16 15:06
professionalNguyen.H.H.Dang21-Aug-16 15:06 
GeneralWhy name things sensibly, when you could also not? PinPopular
r_hyde2-Nov-15 14:16
Memberr_hyde2-Nov-15 14:16 
The application I'm newly tasked with maintaining is a large heap of WTF, but I picked this problem out to share because it demonstrates the supreme barrier to understanding that the prior developer(s) have constructed:
#define __2__
// snip
#if __2__
    // some comment-less code that has nothing ostensibly to do with the number 2
#else
    // some other comment-less code that appears to have no relationship at all  
    // to the prior alternative 
#endif

D'Oh! | :doh: OMG | :OMG: WTF | :WTF:

Actually, there are many comments all over the code, but of the sort that tell you absolutely nothing:
//only check if max > -1
if (max > -1)
{
    ...
}
Why name that variable maxCsvPosition when a careful analysis of the dozens of lines of surrounding code will tell you that? What are you, lazy? And even dozens of lines is often a luxury—many of the methods in this thing are many hundreds of lines long! The variable names are typically like the following, their scope often spanning many screens' worth of code:
ed1
s
sd
p
pd
Shouting curse words with great frequency has become my new affect here at t'office.

I despair Cry | :((
GeneralRe: Why name things sensibly, when you could also not? Pin
PIEBALDconsult2-Nov-15 14:29
professionalPIEBALDconsult2-Nov-15 14:29 
JokeRe: Why name things sensibly, when you could also not? Pin
Amarnath S2-Nov-15 17:18
professionalAmarnath S2-Nov-15 17:18 
GeneralRe: Why name things sensibly, when you could also not? Pin
r_hyde2-Nov-15 20:13
Memberr_hyde2-Nov-15 20:13 
GeneralRe: Why name things sensibly, when you could also not? Pin
Super Lloyd2-Nov-15 17:22
MemberSuper Lloyd2-Nov-15 17:22 
GeneralRe: Why name things sensibly, when you could also not? Pin
Bernhard Hiller3-Nov-15 1:01
MemberBernhard Hiller3-Nov-15 1:01 
GeneralRe: Why name things sensibly, when you could also not? Pin
Brisingr Aerowing5-Nov-15 4:54
professionalBrisingr Aerowing5-Nov-15 4:54 
GeneralRe: Why name things sensibly, when you could also not? Pin
Gary R. Wheeler7-Dec-15 12:59
MemberGary R. Wheeler7-Dec-15 12:59 
GeneralRe: Why name things sensibly, when you could also not? Pin
zandam23-Dec-15 1:10
Memberzandam23-Dec-15 1:10 
GeneralRe: Why name things sensibly, when you could also not? Pin
BillW3323-Nov-15 11:21
professionalBillW3323-Nov-15 11:21 
GeneralRe: Why name things sensibly, when you could also not? Pin
Sinisa Hajnal23-Nov-15 20:25
professionalSinisa Hajnal23-Nov-15 20:25 
GeneralWho needs security through obscurity? Pin
PIEBALDconsult31-Oct-15 16:45
professionalPIEBALDconsult31-Oct-15 16:45 
GeneralRe: Who needs security through obscurity? Pin
Nicolas Dorier31-Oct-15 19:20
professionalNicolas Dorier31-Oct-15 19:20 
GeneralRe: Who needs security through obscurity? Pin
Richard Deeming2-Nov-15 2:30
mveRichard Deeming2-Nov-15 2:30 
GeneralRe: Who needs security through obscurity? Pin
Eddy Vluggen2-Nov-15 2:48
professionalEddy Vluggen2-Nov-15 2:48 
GeneralRe: Who needs security through obscurity? Pin
Richard Deeming2-Nov-15 3:00
mveRichard Deeming2-Nov-15 3:00 
GeneralRe: Who needs security through obscurity? Pin
Eddy Vluggen2-Nov-15 3:27
professionalEddy Vluggen2-Nov-15 3:27 
GeneralRe: Who needs security through obscurity? Pin
Bernhard Hiller3-Nov-15 1:04
MemberBernhard Hiller3-Nov-15 1:04 

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.