Click here to Skip to main content
15,886,799 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: PHP form processing: the easy way Pin
MacRaider48-Jun-11 7:02
MacRaider48-Jun-11 7:02 
GeneralRe: PHP form processing: the easy way Pin
austin hamman8-Jun-11 11:01
austin hamman8-Jun-11 11:01 
GeneralRe: PHP form processing: the easy way Pin
predicador8-Jun-11 14:20
predicador8-Jun-11 14:20 
GeneralRe: PHP form processing: the easy way Pin
H A Tanner18-Jun-11 10:52
H A Tanner18-Jun-11 10:52 
GeneralArrays are overrated, let's use over9000 variables instead! PinPopular
Jeroen De Dauw5-Jun-11 4:32
Jeroen De Dauw5-Jun-11 4:32 
GeneralRe: Arrays are overrated, let's use over9000 variables instead! Pin
StM0n5-Jun-11 5:02
StM0n5-Jun-11 5:02 
GeneralRe: Arrays are overrated, let's use over9000 variables instead! Pin
Brad Barnhill15-Jun-11 11:26
Brad Barnhill15-Jun-11 11:26 
GeneralThe perfect teacher PinPopular
Kubajzz2-Jun-11 1:37
Kubajzz2-Jun-11 1:37 
See this piece of code:

C#
class Person
{
    private string name;
    private string sname;

    public Person(string argName, string argSName)
    {
        name = argName;
        sname = argSName;
    }

    public string getName()
    {
        return name;
    }

    public string getSName()
    {
        return sname;
    }

    public override string ToString()
    {
        return name + " " + sname;
    }
}


Now consider these few facts:
- the code is in C#, not Java
- in case you haven't noticed, this code violates some basic good-style C# coding guidelines
- the person who wrote this code teaches C# programming at university
- this piece of code was given to his students as a do-it-like-this example
- he never, ever uses properties (Java-style getXXX() and setXXX() methods seem to be good enough for him...)
- he sometimes names his classes and methods in Czech using diactitics (yes, it compiles fine since VS is Unicode-based, but... WTF?)
- And more!
QuestionRe: The perfect teacher Pin
Chris Meech2-Jun-11 2:18
Chris Meech2-Jun-11 2:18 
AnswerRe: The perfect teacher PinPopular
Kubajzz2-Jun-11 2:37
Kubajzz2-Jun-11 2:37 
GeneralRe: The perfect teacher Pin
Chris Meech2-Jun-11 2:42
Chris Meech2-Jun-11 2:42 
AnswerRe: The perfect teacher Pin
Dalek Dave2-Jun-11 14:27
professionalDalek Dave2-Jun-11 14:27 
GeneralRe: The perfect teacher Pin
musefan2-Jun-11 2:34
musefan2-Jun-11 2:34 
GeneralRe: The perfect teacher Pin
_Erik_2-Jun-11 3:10
_Erik_2-Jun-11 3:10 
GeneralRe: The perfect teacher Pin
RobCroll2-Jun-11 3:39
RobCroll2-Jun-11 3:39 
GeneralRe: The perfect teacher Pin
Kubajzz2-Jun-11 3:50
Kubajzz2-Jun-11 3:50 
GeneralRe: The perfect teacher Pin
RobCroll2-Jun-11 4:25
RobCroll2-Jun-11 4:25 
GeneralRe: The perfect teacher Pin
AspDotNetDev2-Jun-11 10:17
protectorAspDotNetDev2-Jun-11 10:17 
GeneralRe: The perfect teacher Pin
Mel Pama8-Jun-11 20:13
professionalMel Pama8-Jun-11 20:13 
GeneralRe: The perfect teacher Pin
AspDotNetDev8-Jun-11 20:16
protectorAspDotNetDev8-Jun-11 20:16 
GeneralRe: The perfect teacher Pin
OriginalGriff2-Jun-11 3:50
mveOriginalGriff2-Jun-11 3:50 
GeneralRe: The perfect teacher Pin
RobCroll2-Jun-11 4:38
RobCroll2-Jun-11 4:38 
GeneralRe: The perfect teacher Pin
GibbleCH2-Jun-11 6:15
GibbleCH2-Jun-11 6:15 
GeneralRe: The perfect teacher Pin
BobJanova7-Jun-11 4:10
BobJanova7-Jun-11 4:10 
GeneralRe: The perfect teacher Pin
AspDotNetDev2-Jun-11 10:11
protectorAspDotNetDev2-Jun-11 10:11 

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.