Click here to Skip to main content
15,890,438 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: What If Pin
SQL Dave23-Jun-11 18:22
SQL Dave23-Jun-11 18:22 
GeneralRe: What If Pin
AspDotNetDev23-Jun-11 18:39
protectorAspDotNetDev23-Jun-11 18:39 
GeneralRe: What If Pin
fjdiewornncalwe24-Jun-11 4:43
professionalfjdiewornncalwe24-Jun-11 4:43 
GeneralRe: What If Pin
Ra-one28-Jun-11 0:04
Ra-one28-Jun-11 0:04 
GeneralLovely.... Pin
Soulus8321-Jun-11 13:11
Soulus8321-Jun-11 13:11 
GeneralRe: Lovely.... Pin
BobJanova21-Jun-11 23:59
BobJanova21-Jun-11 23:59 
GeneralRe: Lovely.... Pin
djdanlib27-Jun-11 11:19
djdanlib27-Jun-11 11:19 
GeneralThe Whole Codebase I inherited [again] Pin
Keith Barrow21-Jun-11 1:46
professionalKeith Barrow21-Jun-11 1:46 
It starts off, OK (if you ignore the Data Access stuff inside the "Object Model", so it doesn't start OK, but OK is relative in our codebase):

public class FacultyDean
{
  //Snip ... Some properties methods ctors
}


Nothing too contenious, unless you want to argue about the use of the word Faculty: all faculties have one dean, and all deans belong to 1..* Faculties so it is not necessary. I'd have called it Dean but there it is.

Here comes the complete listing for a subclass of FacultyDean:

public class NullFacultyDean : FacultyDean
{
    public NullFacultyDean()
    {
        ID = -1;
    }
}


A whole subclass for an uninitialised dean, what luxury! There is no flag to say that the Dean is null, so I'm not 100% sure what this is doing.

Oh and we have tens of classes like this all over:

public class DeanCollection : List<FacultyDean>
{
}


Again this is the full class, and 99% of them are uneccessary (Hurray! I Can't just remove theem en-masse, I have to check each!). Notice this time we have a DeanCollection rather than FacultyDeanCollection. Nice, consistent naming!

GeneralRe: The Whole Codebase I inherited [again] Pin
Nagy Vilmos21-Jun-11 2:25
professionalNagy Vilmos21-Jun-11 2:25 
GeneralRe: The Whole Codebase I inherited [again] Pin
Keith Barrow21-Jun-11 5:46
professionalKeith Barrow21-Jun-11 5:46 
GeneralRe: The Whole Codebase I inherited [again] Pin
BobJanova21-Jun-11 23:49
BobJanova21-Jun-11 23:49 
GeneralRe: The Whole Codebase I inherited [again] Pin
Pete O'Hanlon21-Jun-11 7:54
mvePete O'Hanlon21-Jun-11 7:54 
GeneralRe: The Whole Codebase I inherited [again] Pin
Keith Barrow21-Jun-11 9:06
professionalKeith Barrow21-Jun-11 9:06 
GeneralRe: The Whole Codebase I inherited [again] Pin
AspDotNetDev21-Jun-11 10:15
protectorAspDotNetDev21-Jun-11 10:15 
GeneralRe: The Whole Codebase I inherited [again] Pin
JV999921-Jun-11 20:31
professionalJV999921-Jun-11 20:31 
GeneralRe: The Whole Codebase I inherited [again] Pin
Keith Barrow21-Jun-11 21:24
professionalKeith Barrow21-Jun-11 21:24 
GeneralRe: The Whole Codebase I inherited [again] Pin
JV999921-Jun-11 22:07
professionalJV999921-Jun-11 22:07 
GeneralRe: The Whole Codebase I inherited [again] Pin
Keith Barrow22-Jun-11 8:07
professionalKeith Barrow22-Jun-11 8:07 
GeneralRe: The Whole Codebase I inherited [again] Pin
CDP180222-Jun-11 2:12
CDP180222-Jun-11 2:12 
General(Long) For your enjoyment, legacy PHP web site hell [modified] PinPopular
DoctorOwl20-Jun-11 16:17
DoctorOwl20-Jun-11 16:17 
QuestionWhat do you think of my small game made in Windows API RAW? Pin
andyharglesis17-Jun-11 20:36
andyharglesis17-Jun-11 20:36 
AnswerRe: What do you think of my small game made in Windows API RAW? PinPopular
walterhevedeich17-Jun-11 21:38
professionalwalterhevedeich17-Jun-11 21:38 
GeneralRe: What do you think of my small game made in Windows API RAW? Pin
OriginalGriff17-Jun-11 22:33
mveOriginalGriff17-Jun-11 22:33 
AnswerRe: What do you think of my small game made in Windows API RAW? Pin
AspDotNetDev17-Jun-11 22:38
protectorAspDotNetDev17-Jun-11 22:38 
AnswerRe: What do you think of my small game made in Windows API RAW? Pin
H A Tanner18-Jun-11 9:50
H A Tanner18-Jun-11 9:50 

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.