Click here to Skip to main content
15,913,487 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.

 
GeneralWrong forum. Pin
CPallini2-Jun-08 21:42
mveCPallini2-Jun-08 21:42 
GeneralRe: Wrong forum. Pin
John Kh2-Jun-08 21:54
John Kh2-Jun-08 21:54 
GeneralRe: Wrong forum. Pin
CPallini2-Jun-08 22:12
mveCPallini2-Jun-08 22:12 
GeneralOK how do you like this: JavaScript in SQL? Pin
Tadas Budvytis30-May-08 6:14
Tadas Budvytis30-May-08 6:14 
GeneralRe: OK how do you like this: JavaScript in SQL? Pin
J a a n s30-May-08 6:19
professionalJ a a n s30-May-08 6:19 
JokeRe: OK how do you like this: JavaScript in SQL? Pin
MarkB77730-May-08 23:28
MarkB77730-May-08 23:28 
GeneralRe: OK how do you like this: JavaScript in SQL? Pin
Yusuf2-Jun-08 7:38
Yusuf2-Jun-08 7:38 
GeneralRe: OK how do you like this: JavaScript in SQL? Pin
Mike Dimmick5-Jun-08 4:18
Mike Dimmick5-Jun-08 4:18 
I agree completely. String substitution in SQL is pretty stupid (it's not very good at string manipulation), non-parameterized SQL queries are very stupid as they're easily subjected to SQL Injection attacks, and both together (and there's a third language here as well, HTML) is just confusing as all hell.

I'd split this up into only retrieving actual values from SQL Server using parameterized queries, writing a real JavaScript function that calls window.open, then writing formatted string code to generate the HTML to call the JavaScript function passing the parameters, and passing that through an HTML/XML entity encoding routine where that turns out to be necessary.

As it is, that's an unmaintainable mess.


DoEvents: Generating unexpected recursion since 1991

Generalif...AND...else! [modified] Pin
che335830-May-08 3:38
che335830-May-08 3:38 
GeneralRe: if...AND...else! Pin
Chris Meech30-May-08 4:45
Chris Meech30-May-08 4:45 
JokeRe: if...AND...else! Pin
Jeremy Tierman30-May-08 13:39
Jeremy Tierman30-May-08 13:39 
GeneralRe: if...AND...else! Pin
PIEBALDconsult31-May-08 17:43
mvePIEBALDconsult31-May-08 17:43 
GeneralRe: if...AND...else! Pin
supercat931-May-08 18:25
supercat931-May-08 18:25 
GeneralRe: if...AND...else! Pin
Oshtri Deka1-Jun-08 22:30
professionalOshtri Deka1-Jun-08 22:30 
GeneralRe: if...AND...else! Pin
CDP18021-Jun-08 22:34
CDP18021-Jun-08 22:34 
GeneralRe: if...AND...else! Pin
Ware@Work3-Jun-08 8:38
Ware@Work3-Jun-08 8:38 
GeneralRe: if...AND...else! Pin
CDP18023-Jun-08 23:31
CDP18023-Jun-08 23:31 
GeneralRe: if...AND...else! Pin
Ware@Work4-Jun-08 3:08
Ware@Work4-Jun-08 3:08 
GeneralRe: if...AND...else! Pin
Rage2-Jun-08 2:24
professionalRage2-Jun-08 2:24 
GeneralRe: if...AND...else! Pin
KarstenK2-Jun-08 2:58
mveKarstenK2-Jun-08 2:58 
GeneralRe: if...AND...else! Pin
Yusuf2-Jun-08 7:39
Yusuf2-Jun-08 7:39 
GeneralRe: if...AND...else! Pin
#realJSOP10-Jun-08 6:50
professional#realJSOP10-Jun-08 6:50 
Generalarray size Pin
darth_bug29-May-08 23:31
darth_bug29-May-08 23:31 
QuestionRe: array size Pin
CPallini30-May-08 0:35
mveCPallini30-May-08 0:35 
AnswerRe: array size Pin
Vasudevan Deepak Kumar30-May-08 1:01
Vasudevan Deepak Kumar30-May-08 1:01 

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.