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

 
GeneralKill me Pin
PhilLenoir28-Aug-14 9:04
professionalPhilLenoir28-Aug-14 9:04 
GeneralRe: Kill me Pin
Gary R. Wheeler7-Sep-14 2:38
Gary R. Wheeler7-Sep-14 2:38 
GeneralWhat is null equal to? PinPopular
sloosecannon25-Aug-14 5:59
sloosecannon25-Aug-14 5:59 
GeneralRe: What is null equal to? Pin
PIEBALDconsult25-Aug-14 6:27
mvePIEBALDconsult25-Aug-14 6:27 
GeneralRe: What is null equal to? Pin
R. Giskard Reventlov25-Aug-14 6:56
R. Giskard Reventlov25-Aug-14 6:56 
AnswerRe: What is null equal to? Pin
Afzaal Ahmad Zeeshan25-Aug-14 6:59
professionalAfzaal Ahmad Zeeshan25-Aug-14 6:59 
GeneralRe: What is null equal to? Pin
sloosecannon25-Aug-14 7:45
sloosecannon25-Aug-14 7:45 
GeneralRe: What is null equal to? Pin
OriginalGriff25-Aug-14 8:15
mveOriginalGriff25-Aug-14 8:15 
See the text at the top of the page:
"a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance."

Nearly everything here is found in real code and will hopefully make you go D'Oh! | :doh: WTF | :WTF: OMG | :OMG:
And laugh that anyone could think that the right thing to do...

Generally, explanations and code fragment after the original are expected to make even less sense: just to prove it can be done! Laugh | :laugh:

For example, another way to do the original method would be
C#
public object IsNull(object o)
    {
    try
        {
        return o.Equals(null) ? o : o;
        }
    catch
        {
        return null;
        }
    }
But you'd have to be a complete moron to write that!

Oops. I just did... Blush | :O
You looking for sympathy?
You'll find it in the dictionary, between sympathomimetic and sympatric
(Page 1788, if it helps)

GeneralRe: What is null equal to? Pin
Brisingr Aerowing25-Aug-14 12:06
professionalBrisingr Aerowing25-Aug-14 12:06 
GeneralRe: What is null equal to? Pin
sloosecannon25-Aug-14 18:01
sloosecannon25-Aug-14 18:01 
GeneralRe: What is null equal to? Pin
Rob Grainger27-Aug-14 5:47
Rob Grainger27-Aug-14 5:47 
GeneralRe: What is null equal to? Pin
Rob Grainger28-Sep-14 23:20
Rob Grainger28-Sep-14 23:20 
GeneralRe: What is null equal to? Pin
Paulo Zemek25-Aug-14 8:49
mvaPaulo Zemek25-Aug-14 8:49 
GeneralRe: What is null equal to? Pin
V.25-Aug-14 19:43
professionalV.25-Aug-14 19:43 
JokeRe: What is null equal to? PinPopular
Vark11126-Aug-14 8:23
Vark11126-Aug-14 8:23 
GeneralRe: What is null equal to? Pin
sloosecannon27-Aug-14 3:40
sloosecannon27-Aug-14 3:40 
GeneralRe: What is null equal to? Pin
Eddy Vluggen27-Aug-14 7:33
professionalEddy Vluggen27-Aug-14 7:33 
GeneralRe: What is null equal to? Pin
sloosecannon27-Aug-14 7:41
sloosecannon27-Aug-14 7:41 
GeneralRe: What is null equal to? Pin
Richard Deeming27-Aug-14 7:53
mveRichard Deeming27-Aug-14 7:53 
GeneralRe: What is null equal to? Pin
jeron126-Aug-14 12:03
jeron126-Aug-14 12:03 
GeneralRe: What is null equal to? Pin
sloosecannon27-Aug-14 3:36
sloosecannon27-Aug-14 3:36 
GeneralRe: What is null equal to? Pin
Rob Grainger27-Aug-14 5:49
Rob Grainger27-Aug-14 5:49 
GeneralRe: What is null equal to? Pin
ColborneGreg31-Aug-14 7:39
ColborneGreg31-Aug-14 7:39 
GeneralRe: What is null equal to? Pin
sankarsan parida4-Sep-14 0:22
professionalsankarsan parida4-Sep-14 0:22 
GeneralRe: What is null equal to? Pin
Munchies_Matt10-Sep-14 12:59
Munchies_Matt10-Sep-14 12:59 

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.