Click here to Skip to main content
15,887,267 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 use are foreign keys anyway? Pin
Sander Rossel13-Feb-18 2:42
professionalSander Rossel13-Feb-18 2:42 
GeneralRe: What use are foreign keys anyway? Pin
Jörgen Andersson13-Feb-18 3:10
professionalJörgen Andersson13-Feb-18 3:10 
GeneralRe: What use are foreign keys anyway? Pin
Jörgen Andersson15-Feb-18 7:22
professionalJörgen Andersson15-Feb-18 7:22 
GeneralRe: What use are foreign keys anyway? Pin
Bruce Patin20-Feb-18 6:03
Bruce Patin20-Feb-18 6:03 
GeneralRe: What use are foreign keys anyway? Pin
Jörgen Andersson20-Feb-18 6:05
professionalJörgen Andersson20-Feb-18 6:05 
GeneralRe: What use are foreign keys anyway? Pin
Alister Morton19-Feb-18 4:57
Alister Morton19-Feb-18 4:57 
GeneralRe: What use are foreign keys anyway? Pin
Sander Rossel19-Feb-18 6:56
professionalSander Rossel19-Feb-18 6:56 
GeneralRe: What use are foreign keys anyway? Pin
Out of Memory12-Mar-18 1:20
Out of Memory12-Mar-18 1:20 
I've seen this too, and know the reason. It's not a good reason, but it's a reason.

I'd designed and built a database with full referential integrity.
A team of programmers started to build a system around it.
Every time their code violated the rules, guess what? An exception was triggered! As intended. Imagine that.

It came to time to roll out the project. This meant deploying a fresh copy of the database to a production server. I used the same scripts that I'd written to deploy the development copy.

This resulted in a herd of coders arriving at my desk, all red in the face, and demanding that I use the copy on the development machine. It seems that between them, their understanding of error handling consisted of "on error goto", and they'd been so overwhelmed by the exceptions that the RI in the database caused, they'd removed all of it from the database. Seems my idiot boss saw no harm in giving them admin rights on the database server. Thankfully, he took my side when I explained to him why the project was going to be delayed!

So, if you're surrounded by idiots, then there's a reason why the RI was removed. It's not a good reason, but it's certainly a reason. Namely, you're surrounded by idiots.
GeneralRe: What use are foreign keys anyway? Pin
Sander Rossel12-Mar-18 2:04
professionalSander Rossel12-Mar-18 2:04 
GeneralRe: What use are foreign keys anyway? Pin
S Douglas28-Mar-18 11:13
professionalS Douglas28-Mar-18 11:13 
GeneralRe: What use are foreign keys anyway? PinPopular
CodeWraith13-Feb-18 3:15
CodeWraith13-Feb-18 3:15 
GeneralRe: What use are foreign keys anyway? Pin
RJOberg13-Feb-18 4:26
professionalRJOberg13-Feb-18 4:26 
GeneralRe: What use are foreign keys anyway? Pin
CodeWraith13-Feb-18 4:35
CodeWraith13-Feb-18 4:35 
GeneralRe: What use are foreign keys anyway? Pin
Nelek15-Feb-18 2:19
protectorNelek15-Feb-18 2:19 
GeneralRe: What use are foreign keys anyway? Pin
CodeWraith15-Feb-18 2:41
CodeWraith15-Feb-18 2:41 
GeneralRe: What use are foreign keys anyway? Pin
Nelek15-Feb-18 2:45
protectorNelek15-Feb-18 2:45 
GeneralRe: What use are foreign keys anyway? Pin
CodeWraith15-Feb-18 2:51
CodeWraith15-Feb-18 2:51 
GeneralRe: What use are foreign keys anyway? Pin
Nelek15-Feb-18 3:30
protectorNelek15-Feb-18 3:30 
GeneralRe: What use are foreign keys anyway? Pin
CodeWraith15-Feb-18 3:34
CodeWraith15-Feb-18 3:34 
GeneralRe: What use are foreign keys anyway? Pin
jackbrownii29-Mar-18 7:29
professionaljackbrownii29-Mar-18 7:29 
GeneralRe: What use are foreign keys anyway? Pin
Nathan Minier16-Feb-18 1:13
professionalNathan Minier16-Feb-18 1:13 
GeneralRe: What use are foreign keys anyway? Pin
CodeWraith16-Feb-18 2:00
CodeWraith16-Feb-18 2:00 
GeneralRe: What use are foreign keys anyway? Pin
Nathan Minier16-Feb-18 2:08
professionalNathan Minier16-Feb-18 2:08 
GeneralRe: What use are foreign keys anyway? Pin
CodeWraith16-Feb-18 2:43
CodeWraith16-Feb-18 2:43 
GeneralRe: What use are foreign keys anyway? Pin
#realJSOP27-Feb-18 5:46
mve#realJSOP27-Feb-18 5:46 

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.