Click here to Skip to main content
15,887,683 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: purchased code from who knows where Pin
phil.o10-Jan-20 7:29
professionalphil.o10-Jan-20 7:29 
GeneralRe: purchased code from who knows where Pin
RickZeeland10-Jan-20 7:30
mveRickZeeland10-Jan-20 7:30 
GeneralRe: purchased code from who knows where Pin
Eddy Vluggen15-Jan-20 12:01
professionalEddy Vluggen15-Jan-20 12:01 
GeneralCross-Platform: dotnet core web api QR Codes Pin
raddevus30-Dec-19 10:00
mvaraddevus30-Dec-19 10:00 
PraiseRe: Cross-Platform: dotnet core web api QR Codes Pin
RickZeeland30-Dec-19 10:23
mveRickZeeland30-Dec-19 10:23 
GeneralRe: Cross-Platform: dotnet core web api QR Codes Pin
Brisingr Aerowing10-Jan-20 10:34
professionalBrisingr Aerowing10-Jan-20 10:34 
GeneralRe: Cross-Platform: dotnet core web api QR Codes Pin
raddevus10-Jan-20 11:04
mvaraddevus10-Jan-20 11:04 
GeneralHead, meet desk Pin
Richard Deeming20-Dec-19 3:25
mveRichard Deeming20-Dec-19 3:25 
What idiot wrote goto case default instead of goto default in one of my C# switch statements, causing an infinite loop? D'Oh! | :doh:

It certainly couldn't have been me. Blush | :O

For future reference: given:
C#
enum Foo { One, Two }
then:
C#
switch (foo)
{
    case Foo.One: goto default;
    default: Console.WriteLine("Default");
}
compiles to:
C#
if (foo != 0) { }
Console.WriteLine("Default");
whereas:
C#
switch (foo)
{
    case Foo.One: goto case default;
    default: Console.WriteLine("Default");
}
compiles to:
C#
if (foo == Foo.One)
{
    while (true)
    {
    }
}
Console.WriteLine("Default");




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Head, meet desk Pin
Greg Utas20-Dec-19 4:47
professionalGreg Utas20-Dec-19 4:47 
GeneralRe: Head, meet desk Pin
ZurdoDev20-Dec-19 8:29
professionalZurdoDev20-Dec-19 8:29 
GeneralWeird Performance PinPopular
Rick York18-Dec-19 10:11
mveRick York18-Dec-19 10:11 
GeneralRe: Weird Performance Pin
Nelek19-Dec-19 0:27
protectorNelek19-Dec-19 0:27 
GeneralRe: Weird Performance Pin
Rick York19-Dec-19 4:51
mveRick York19-Dec-19 4:51 
GeneralRe: Weird Performance Pin
Nelek19-Dec-19 8:38
protectorNelek19-Dec-19 8:38 
GeneralRe: Weird Performance Pin
Rick York20-Dec-19 8:13
mveRick York20-Dec-19 8:13 
GeneralRe: Weird Performance Pin
Nelek20-Dec-19 8:44
protectorNelek20-Dec-19 8:44 
GeneralHow many values between 0 and 0? Pin
raddevus16-Dec-19 5:59
mvaraddevus16-Dec-19 5:59 
GeneralRe: How many values between 0 and 0? Pin
Richard Deeming16-Dec-19 8:49
mveRichard Deeming16-Dec-19 8:49 
GeneralRe: How many values between 0 and 0? Pin
raddevus16-Dec-19 8:58
mvaraddevus16-Dec-19 8:58 
GeneralRe: How many values between 0 and 0? Pin
TheGreatAndPowerfulOz16-Dec-19 9:05
TheGreatAndPowerfulOz16-Dec-19 9:05 
GeneralRe: How many values between 0 and 0? Pin
raddevus16-Dec-19 9:21
mvaraddevus16-Dec-19 9:21 
GeneralRe: How many values between 0 and 0? Pin
TheGreatAndPowerfulOz16-Dec-19 10:05
TheGreatAndPowerfulOz16-Dec-19 10:05 
GeneralRe: How many values between 0 and 0? Pin
raddevus16-Dec-19 10:16
mvaraddevus16-Dec-19 10:16 
GeneralRe: How many values between 0 and 0? Pin
Richard Deeming17-Dec-19 0:28
mveRichard Deeming17-Dec-19 0:28 
GeneralRe: How many values between 0 and 0? Pin
TheGreatAndPowerfulOz17-Dec-19 5:05
TheGreatAndPowerfulOz17-Dec-19 5:05 

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.