Click here to Skip to main content
15,890,557 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: seeing a student code Pin
Jeroen De Dauw17-Feb-11 4:47
Jeroen De Dauw17-Feb-11 4:47 
GeneralRe: seeing a student code Pin
kdgupta8717-Feb-11 5:29
kdgupta8717-Feb-11 5:29 
GeneralRe: seeing a student code Pin
Ed Nutting21-Feb-11 1:54
Ed Nutting21-Feb-11 1:54 
GeneralRe: seeing a student code Pin
OriginalGriff21-Feb-11 2:49
mveOriginalGriff21-Feb-11 2:49 
GeneralRe: seeing a student code Pin
kdgupta8721-Feb-11 3:36
kdgupta8721-Feb-11 3:36 
GeneralRe: seeing a student code Pin
musefan17-Feb-11 5:24
musefan17-Feb-11 5:24 
GeneralRe: seeing a student code Pin
kdgupta8717-Feb-11 5:31
kdgupta8717-Feb-11 5:31 
GeneralCan you top that? PinPopular
peterchen15-Feb-11 6:00
peterchen15-Feb-11 6:00 
My rule of thumb is "4 method parameters are fine, 6 is questionable, 8 are a problem".

Here I present you what I have to deal with:

long BunnyInitSub( BunnyType eBunnyType,
               long lBunnyIndex,
               CString sBunnyLabel1,
               long lBunnyColor1,
               bool bBunnyAutoScale1,
               bool bBunnyAutoMin1,
               bool bBunnyAutoMax1,
               double dBunnyMin1,
               double dBunnyMax1,
               bool bBunnyLogScale1,
               bool bOverlap,
               long lBunnyPlotFirst,
               bool bEnableSecondPlot,
               long lBunnyPlotSecond = EASTER_LINE,
               bool bEnableSubBunny = false,
               CString sBunnyLabel2 = _T(""),
               long lBunnyColor2 = black,
               bool bBunnyAutoScale2 = true,
               bool bBunnyAutoMin2 = true,
               bool bBunnyAutoMax2 = true,
               double dBunnyMin2 = 0,
               double dBunnyMax2 = 0,
               bool bBunnyLogScale2 = false );


Thank you, Visual Assist, for coping with this horror!

(No it's not Bunny in the original code. Changed to protect the nocent.)

Yes, this is more or less two times the same information. Which are, internally, stored in a struct with similar layout as the method. Serialized raw, requiring two-way-compatibility. Which, due to some mishap with "storage size optimizations" don't even have identical alignment, so can't be replaced with two instances of half the struct. Gaaaaaaah!
FILETIME to time_t

| FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy

GeneralRe: Can you top that? Pin
Vladimir Svyatski15-Feb-11 10:10
professionalVladimir Svyatski15-Feb-11 10:10 
GeneralRe: Can you top that? Pin
Single Step Debugger15-Feb-11 10:39
Single Step Debugger15-Feb-11 10:39 
GeneralRe: Can you top that? Pin
peterchen15-Feb-11 19:34
peterchen15-Feb-11 19:34 
JokeRe: Can you top that? Pin
musefan16-Feb-11 5:29
musefan16-Feb-11 5:29 
GeneralRe: Can you top that? Pin
fat_boy17-Feb-11 5:40
fat_boy17-Feb-11 5:40 
GeneralRe: Can you top that? Pin
peterchen17-Feb-11 6:33
peterchen17-Feb-11 6:33 
GeneralRe: Can you top that? Pin
CDP180218-Feb-11 0:29
CDP180218-Feb-11 0:29 
GeneralWonderful naming Pin
Vladimir Svyatski14-Feb-11 9:46
professionalVladimir Svyatski14-Feb-11 9:46 
GeneralRe: Wonderful naming Pin
Keith Barrow14-Feb-11 10:08
professionalKeith Barrow14-Feb-11 10:08 
GeneralRe: Wonderful naming Pin
Manfred Rudolf Bihy14-Feb-11 10:22
professionalManfred Rudolf Bihy14-Feb-11 10:22 
GeneralRe: Wonderful naming Pin
Keith Barrow14-Feb-11 10:32
professionalKeith Barrow14-Feb-11 10:32 
GeneralRe: Wonderful naming Pin
Manfred Rudolf Bihy14-Feb-11 10:53
professionalManfred Rudolf Bihy14-Feb-11 10:53 
GeneralRe: Wonderful naming Pin
Vladimir Svyatski14-Feb-11 10:33
professionalVladimir Svyatski14-Feb-11 10:33 
GeneralRe: Wonderful naming Pin
Vladimir Svyatski14-Feb-11 10:26
professionalVladimir Svyatski14-Feb-11 10:26 
GeneralRe: Wonderful naming Pin
AspDotNetDev14-Feb-11 10:51
protectorAspDotNetDev14-Feb-11 10:51 
GeneralRe: Wonderful naming [modified] Pin
RobCroll14-Feb-11 16:42
RobCroll14-Feb-11 16:42 
GeneralRe: Wonderful naming Pin
Vladimir Svyatski15-Feb-11 9:43
professionalVladimir Svyatski15-Feb-11 9:43 

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.