Click here to Skip to main content
15,914,419 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: Commenting code... Pin
CDP18026-Sep-11 21:28
CDP18026-Sep-11 21:28 
GeneralRe: Commenting code... Pin
Keith Barrow6-Sep-11 3:01
professionalKeith Barrow6-Sep-11 3:01 
GeneralRe: Commenting code... Pin
Sander Rossel6-Sep-11 6:48
professionalSander Rossel6-Sep-11 6:48 
GeneralRe: Commenting code... Pin
Phan7om8-Sep-11 2:29
Phan7om8-Sep-11 2:29 
GeneralRe: Commenting code... Pin
annathor8-Sep-11 22:53
annathor8-Sep-11 22:53 
GeneralShort but stinky... PinPopular
Rob Grainger4-Sep-11 4:29
Rob Grainger4-Sep-11 4:29 
GeneralRe: Short but stinky... Pin
BillW334-Sep-11 16:13
professionalBillW334-Sep-11 16:13 
JokeRe: Short but stinky... Pin
Peter_in_27804-Sep-11 18:57
professionalPeter_in_27804-Sep-11 18:57 
JokeA bad Case of comparison Pin
Julien Villers1-Sep-11 3:58
professionalJulien Villers1-Sep-11 3:58 
GeneralRe: A bad Case of comparison Pin
thoiness1-Sep-11 4:16
thoiness1-Sep-11 4:16 
GeneralRe: A bad Case of comparison Pin
Jeroen De Dauw1-Sep-11 9:21
Jeroen De Dauw1-Sep-11 9:21 
GeneralRe: A bad Case of comparison Pin
RCoate1-Sep-11 11:14
RCoate1-Sep-11 11:14 
GeneralRe: A bad Case of comparison Pin
Julien Villers2-Sep-11 0:23
professionalJulien Villers2-Sep-11 0:23 
GeneralRe: A bad Case of comparison Pin
Freak302-Sep-11 4:38
Freak302-Sep-11 4:38 
GeneralRe: A bad Case of comparison Pin
Julien Villers5-Sep-11 2:07
professionalJulien Villers5-Sep-11 2:07 
GeneralTo sleep or to do 'events'. That is the question. Pin
Member 205300631-Aug-11 0:17
Member 205300631-Aug-11 0:17 
GeneralRe: To sleep or to do 'events'. That is the question. Pin
Nagy Vilmos31-Aug-11 1:08
professionalNagy Vilmos31-Aug-11 1:08 
GeneralRe: To sleep or to do 'events'. That is the question. Pin
BillW3331-Aug-11 4:46
professionalBillW3331-Aug-11 4:46 
JokeRe: To sleep or to do 'events'. That is the question. Pin
Sander Rossel31-Aug-11 11:26
professionalSander Rossel31-Aug-11 11:26 
GeneralApostrophe's to the rescue PinPopular
Sander Rossel30-Aug-11 3:58
professionalSander Rossel30-Aug-11 3:58 
Just read this story in the lounge[^]. Reminds me of a true shame...

Our 'senior', SQL expert recently wrote some dynamic SQL SP recently.
He is fully aware of SQL injection and actually went about it keeping security in the back of his head.
This is what he came up with (just his idea, not the query)...
SQL
sql_statement = 'select '''@param''' from someTable'

I took a look at the query and asked him what in the hell all those apostrophes where doing there (the thing was full of it, lots of magic going on there!).
He said that was to prevent SQL injection. Can you imagine my reaction?
I broke it with a single search for "D'artagnan" Poke tongue | ;-P

It was then and there that I (a SQL rookie) thaught him about quotename[^]... WTF | :WTF:
It's an OO world.
modified on Tuesday, August 30, 2011 10:23 AM

GeneralRe: Apostrophe's to the rescue Pin
jocstar1-Sep-11 4:02
jocstar1-Sep-11 4:02 
GeneralRe: Apostrophe's to the rescue Pin
Sander Rossel1-Sep-11 6:32
professionalSander Rossel1-Sep-11 6:32 
JokeRe: Apostrophe's to the rescue Pin
VallarasuS2-Sep-11 2:03
VallarasuS2-Sep-11 2:03 
GeneralIs this a coding horror? Pin
OriginalGriff27-Aug-11 0:09
mveOriginalGriff27-Aug-11 0:09 
GeneralRe: Is this a coding horror? Pin
Shameel27-Aug-11 23:39
professionalShameel27-Aug-11 23:39 

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.