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

 
GeneralThe best refactoring I have ever seen Pin
matt_taws17-Jan-13 1:29
matt_taws17-Jan-13 1:29 
GeneralRe: The best refactoring I have ever seen Pin
Super Lloyd17-Jan-13 2:42
Super Lloyd17-Jan-13 2:42 
GeneralRe: The best refactoring I have ever seen Pin
Jonathan C Dickinson17-Jan-13 3:22
Jonathan C Dickinson17-Jan-13 3:22 
GeneralRe: The best refactoring I have ever seen Pin
PIEBALDconsult17-Jan-13 3:48
mvePIEBALDconsult17-Jan-13 3:48 
GeneralRe: The best refactoring I have ever seen Pin
Rob Grainger1-Feb-13 3:17
Rob Grainger1-Feb-13 3:17 
GeneralWhat was I thinking Pin
Corporal Agarn16-Jan-13 1:15
professionalCorporal Agarn16-Jan-13 1:15 
GeneralRe: What was I thinking Pin
David Goebet16-Jan-13 1:40
professionalDavid Goebet16-Jan-13 1:40 
GeneralRe: What was I thinking Pin
Matt U.16-Jan-13 1:56
Matt U.16-Jan-13 1:56 
I've done something similar to this recently. It was like this:

SQL
SELECT CASE
    WHEN Field1 = 'Something #1' THEN 'Result #1'
    WHEN Field1 = 'Something #2' THEN 'N/A'
    WHEN Field1 = 'Something #3' THEN '(Empty)'
    ELSE 'N/A'
    END


And I continued to wonder why even when 'Something #1' was not met, I was seeing 'N/A' in the results. Took me a bit to figure it out. D'Oh! | :doh:
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.

GeneralRe: What was I thinking Pin
peterchen16-Jan-13 3:24
peterchen16-Jan-13 3:24 
GeneralRe: What was I thinking Pin
G James16-Jan-13 9:57
G James16-Jan-13 9:57 
JokeRe: What was I thinking Pin
Chris Maunder16-Jan-13 18:02
cofounderChris Maunder16-Jan-13 18:02 
GeneralRe: What was I thinking Pin
33deepak16-Jan-13 18:13
33deepak16-Jan-13 18:13 
GeneralRe: What was I thinking Pin
Chris Maunder16-Jan-13 18:14
cofounderChris Maunder16-Jan-13 18:14 
GeneralRe: What was I thinking Pin
James Lonero19-Jan-13 11:08
James Lonero19-Jan-13 11:08 
JokeRe: What was I thinking Pin
Andrew Rissing17-Jan-13 5:48
Andrew Rissing17-Jan-13 5:48 
GeneralRe: What was I thinking Pin
Chris Maunder17-Jan-13 9:43
cofounderChris Maunder17-Jan-13 9:43 
GeneralRe: What was I thinking Pin
Andrew Rissing17-Jan-13 9:55
Andrew Rissing17-Jan-13 9:55 
JokeRe: What was I thinking Pin
Jecc22-Jan-13 23:56
Jecc22-Jan-13 23:56 
GeneralRe: What was I thinking Pin
Nagy Vilmos23-Jan-13 0:33
professionalNagy Vilmos23-Jan-13 0:33 
GeneralRe: What was I thinking Pin
Jonathan C Dickinson16-Jan-13 21:21
Jonathan C Dickinson16-Jan-13 21:21 
GeneralRe: What was I thinking Pin
Sentenryu16-Jan-13 22:23
Sentenryu16-Jan-13 22:23 
GeneralRe: What was I thinking Pin
Jonathan C Dickinson16-Jan-13 22:26
Jonathan C Dickinson16-Jan-13 22:26 
GeneralRe: What was I thinking Pin
Ranjan.D17-Jan-13 11:32
professionalRanjan.D17-Jan-13 11:32 
GeneralRe: What was I thinking Pin
Rob Grainger1-Feb-13 3:21
Rob Grainger1-Feb-13 3:21 
GeneralRe: What was I thinking Pin
Tomz_KV17-Jan-13 2:58
Tomz_KV17-Jan-13 2:58 

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.