Click here to Skip to main content
15,897,371 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: if .... else case Pin
Vladimir Svyatski18-Aug-11 9:30
professionalVladimir Svyatski18-Aug-11 9:30 
GeneralRe: if .... else case Pin
Colin Mullikin18-Aug-11 14:05
professionalColin Mullikin18-Aug-11 14:05 
GeneralEvery line makes me die a little more... Pin
leppie11-Aug-11 0:37
leppie11-Aug-11 0:37 
GeneralRe: Every line makes me die a little more... Pin
Shameel11-Aug-11 6:03
professionalShameel11-Aug-11 6:03 
GeneralRe: Every line makes me die a little more... Pin
GibbleCH11-Aug-11 8:48
GibbleCH11-Aug-11 8:48 
GeneralRe: Every line makes me die a little more... Pin
leppie11-Aug-11 9:10
leppie11-Aug-11 9:10 
GeneralRe: Every line makes me die a little more... Pin
Brady Kelly11-Aug-11 10:29
Brady Kelly11-Aug-11 10:29 
GeneralRe: Every line makes me die a little more... Pin
Allan Thomas12-Aug-11 2:18
Allan Thomas12-Aug-11 2:18 
How about a 13 month KPI that has code that has logic to work out the summary values to be displayed for each month, storing values used elsewhere in seperate variables (not an array) and then having that code duplicated 13 times (with a slight change in variables/controls). It would have been at least 10 pages and all embedded in the click event of the button Frown | :( .

After checking the code to see if anything else was buried in there I refactored this (with the help of a few functions) into two loops with about a dozen lines total. It helped because a bit later I found two other places where the same thing happened and while the code was different I was able to copy and paste the code and update the loop for the different KPI's.
GeneralRe: Every line makes me die a little more... Pin
leppie12-Aug-11 3:45
leppie12-Aug-11 3:45 
GeneralIt's a jungle in there PinPopular
GibbleCH9-Aug-11 5:22
GibbleCH9-Aug-11 5:22 
GeneralRe: It's a jungle in there Pin
Shameel9-Aug-11 5:52
professionalShameel9-Aug-11 5:52 
GeneralRe: It's a jungle in there Pin
StM0n9-Aug-11 6:11
StM0n9-Aug-11 6:11 
GeneralRe: It's a jungle in there Pin
Reiss9-Aug-11 8:42
professionalReiss9-Aug-11 8:42 
GeneralRe: It's a jungle in there Pin
GibbleCH9-Aug-11 8:46
GibbleCH9-Aug-11 8:46 
GeneralRe: It's a jungle in there Pin
Sander Rossel9-Aug-11 20:26
professionalSander Rossel9-Aug-11 20:26 
GeneralRe: It's a jungle in there Pin
Fabio Franco10-Aug-11 3:47
professionalFabio Franco10-Aug-11 3:47 
GeneralRe: It's a jungle in there Pin
Sander Rossel10-Aug-11 7:47
professionalSander Rossel10-Aug-11 7:47 
GeneralRe: It's a jungle in there Pin
Fabio Franco10-Aug-11 9:25
professionalFabio Franco10-Aug-11 9:25 
GeneralRe: It's a jungle in there Pin
Sander Rossel10-Aug-11 11:14
professionalSander Rossel10-Aug-11 11:14 
GeneralRe: It's a jungle in there Pin
Fabio Franco11-Aug-11 5:01
professionalFabio Franco11-Aug-11 5:01 
GeneralRe: It's a jungle in there Pin
Sander Rossel11-Aug-11 11:59
professionalSander Rossel11-Aug-11 11:59 
GeneralRe: It's a jungle in there Pin
cpkilekofp16-Aug-11 13:02
cpkilekofp16-Aug-11 13:02 
GeneralRe: It's a jungle in there Pin
Fabio Franco17-Aug-11 1:36
professionalFabio Franco17-Aug-11 1:36 
GeneralRe: It's a jungle in there Pin
GibbleCH10-Aug-11 3:48
GibbleCH10-Aug-11 3:48 
GeneralRe: It's a jungle in there Pin
Sander Rossel10-Aug-11 7:57
professionalSander Rossel10-Aug-11 7:57 

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.