Click here to Skip to main content
15,887,083 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: Illogical Logic PinPopular
Lutosław17-Dec-11 5:12
Lutosław17-Dec-11 5:12 
GeneralRe: Illogical Logic Pin
ekolis17-Dec-11 11:28
ekolis17-Dec-11 11:28 
GeneralRe: Illogical Logic Pin
Lutosław18-Dec-11 3:33
Lutosław18-Dec-11 3:33 
GeneralRe: Illogical Logic Pin
Manfred Rudolf Bihy18-Dec-11 4:08
professionalManfred Rudolf Bihy18-Dec-11 4:08 
GeneralRe: Illogical Logic Pin
AdamEcc20-Dec-11 2:51
AdamEcc20-Dec-11 2:51 
GeneralRe: Illogical Logic Pin
Julien Villers18-Dec-11 22:38
professionalJulien Villers18-Dec-11 22:38 
GeneralRe: Illogical Logic Pin
DerekT-P20-Dec-11 3:35
professionalDerekT-P20-Dec-11 3:35 
GeneralSimply not Normalisation Cricket. PinPopular
Keith Barrow14-Dec-11 3:42
professionalKeith Barrow14-Dec-11 3:42 
Our students have to take basic skills exams, they are essential to getting th degree, so these tables are important. Unfortunately, the Database design looks like it was written by a gorilla mashing the keyboard. And The gorilla was not happy with the world. So far I've found:

0) A bool/bit column that never has a non-true value, and a text column with the same text in each row.
1) A date column, and a column next to it with the day of the week (Monday, Tuesday etc) as text.
2) A table that holds exam sessions with capacity and the number of students enrolled. Why is this bad? Because we have a table relating students enrolled to each session, so the real attendance is the count of those and not some needless, brittle, maintained value.
3) Two tables that define whether a student has enrolled to a skills exam. The student is always present in the first with a boolean "Enrolled", but only present in the second if they have enrolled.

The worst thing is I can't even fix it: I don't know what else sits on it. I do have the code I'm replacing written, badly, in VB.NET which is also self-obstifucating and has Database work in the UI. They didn't get the database stuff right either: the inserts which enroll a student aren't in a transaction so if anything goes wrong the database will be in an invalid state.

Mad | :mad:

GeneralRe: Simply not Normalisation Cricket. Pin
Julien Villers14-Dec-11 6:06
professionalJulien Villers14-Dec-11 6:06 
GeneralRe: Simply not Normalisation Cricket. Pin
Nagy Vilmos15-Dec-11 23:56
professionalNagy Vilmos15-Dec-11 23:56 
GeneralRe: Simply not Normalisation Cricket. Pin
Brady Kelly16-Dec-11 1:48
Brady Kelly16-Dec-11 1:48 
GeneralRe: Simply not Normalisation Cricket. Pin
Mike Marynowski16-Dec-11 12:35
professionalMike Marynowski16-Dec-11 12:35 
GeneralRe: Simply not Normalisation Cricket. Pin
Florin Jurcovici17-Dec-11 4:05
Florin Jurcovici17-Dec-11 4:05 
GeneralRe: Simply not Normalisation Cricket. Pin
Brady Kelly17-Dec-11 4:10
Brady Kelly17-Dec-11 4:10 
GeneralRe: Simply not Normalisation Cricket. Pin
interarticle17-Dec-11 22:22
interarticle17-Dec-11 22:22 
GeneralRe: Simply not Normalisation Cricket. Pin
Tom Chantler16-Dec-11 1:54
professionalTom Chantler16-Dec-11 1:54 
GeneralRe: Simply not Normalisation Cricket. Pin
Klae16-Dec-11 4:45
Klae16-Dec-11 4:45 
GeneralRe: Simply not Normalisation Cricket. Pin
A_WoodApple16-Dec-11 5:56
A_WoodApple16-Dec-11 5:56 
GeneralRe: Simply not Normalisation Cricket. Pin
Florin Jurcovici17-Dec-11 4:12
Florin Jurcovici17-Dec-11 4:12 
GeneralRe: Simply not Normalisation Cricket. Pin
Allan Thomas17-Dec-11 1:47
Allan Thomas17-Dec-11 1:47 
GeneralConverting a string to an int PinPopular
Shameel13-Dec-11 8:19
professionalShameel13-Dec-11 8:19 
GeneralRe: Converting a string to an int PinPopular
GibbleCH13-Dec-11 10:09
GibbleCH13-Dec-11 10:09 
GeneralRe: Converting a string to an int Pin
Shameel13-Dec-11 17:47
professionalShameel13-Dec-11 17:47 
GeneralRe: Converting a string to an int Pin
PIEBALDconsult13-Dec-11 15:48
mvePIEBALDconsult13-Dec-11 15:48 
GeneralRe: Converting a string to an int Pin
Shameel13-Dec-11 17:53
professionalShameel13-Dec-11 17:53 

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.