Click here to Skip to main content
15,903,175 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: Do you want string or string? Pin
BobJanova13-Feb-12 3:48
BobJanova13-Feb-12 3:48 
GeneralRe: Do you want string or string? Pin
BotCar13-Feb-12 18:56
BotCar13-Feb-12 18:56 
JokeRe: Do you want string or string? Pin
ZurdoDev13-Feb-12 5:53
professionalZurdoDev13-Feb-12 5:53 
JokeRe: Do you want string or string? Pin
BotCar13-Feb-12 19:06
BotCar13-Feb-12 19:06 
GeneralRe: Do you want string or string? Pin
KP Lee14-Feb-12 15:28
KP Lee14-Feb-12 15:28 
GeneralRe: Do you want string or string? Pin
KP Lee14-Feb-12 14:30
KP Lee14-Feb-12 14:30 
GeneralRe: Do you want string or string? Pin
Brisingr Aerowing31-Mar-12 7:04
professionalBrisingr Aerowing31-Mar-12 7:04 
GeneralBad filtering Pin
Jtai6-Feb-12 8:12
Jtai6-Feb-12 8:12 
Hi guys

im new here but i tough i would share this example of code i encountered a couple months back

in one class
SQL
Select field1,field2,field3
From table1
Where type="EDU"


the only fucntion using this result set was coded like this

VB
If(field1=cond1 and field2=con4 and Active=true)
 do something
else If(field1=cond1 and field2=con2 and Active=true)
do something
else If(field3=cond10 and field2=con2 and Active=true)
do something else

this went on for like 9 time WTF | :WTF:

now someone added another If lower down in the code but forgot the Active=true hense causing a bug ! now after searching to make sure that the Selqct wasent used anywhere else(the name was a dead give away but you never know)

First off
SQL
Select field1,field2,field3
From table1
Where type="EDU" AND Active=True

PLEASE add this AND ... just reducing the result set will bost this application speed has its database was Huge

as for the rest we where not allowed to modify working code but come on 9 inbricked iff with some repeating coditions ....

modified 6-Feb-12 21:04pm.

GeneralRe: Bad filtering Pin
ekolis6-Feb-12 10:35
ekolis6-Feb-12 10:35 
GeneralRe: Bad filtering Pin
Jtai6-Feb-12 15:04
Jtai6-Feb-12 15:04 
JokeRe: Bad filtering Pin
AspDotNetDev6-Feb-12 15:24
protectorAspDotNetDev6-Feb-12 15:24 
GeneralRe: Bad filtering Pin
KP Lee14-Feb-12 17:34
KP Lee14-Feb-12 17:34 
RantDAO Framework PinPopular
Chanoch Wiggers1-Feb-12 2:06
Chanoch Wiggers1-Feb-12 2:06 
GeneralRe: DAO Framework Pin
GibbleCH1-Feb-12 5:58
GibbleCH1-Feb-12 5:58 
GeneralRe: DAO Framework Pin
Chanoch Wiggers1-Feb-12 11:27
Chanoch Wiggers1-Feb-12 11:27 
GeneralRe: DAO Framework Pin
JackDingler14-Feb-12 9:12
JackDingler14-Feb-12 9:12 
GeneralRe: DAO Framework Pin
Sander Rossel1-Feb-12 11:50
professionalSander Rossel1-Feb-12 11:50 
GeneralRe: DAO Framework Pin
Baxter R Pearson1-Feb-12 21:25
Baxter R Pearson1-Feb-12 21:25 
GeneralRe: DAO Framework Pin
Chanoch Wiggers1-Feb-12 22:42
Chanoch Wiggers1-Feb-12 22:42 
GeneralRe: DAO Framework Pin
Baxter R Pearson2-Feb-12 1:14
Baxter R Pearson2-Feb-12 1:14 
GeneralRe: DAO Framework Pin
Kirk Wood7-Feb-12 2:10
Kirk Wood7-Feb-12 2:10 
GeneralRe: DAO Framework Pin
ekolis3-Feb-12 14:59
ekolis3-Feb-12 14:59 
GeneralRe: DAO Framework Pin
User 48220337-Feb-12 0:57
User 48220337-Feb-12 0:57 
GeneralRe: DAO Framework Pin
TylerMc0077-Feb-12 8:22
TylerMc0077-Feb-12 8:22 
GeneralRe: DAO Framework Pin
Rob Grainger12-Feb-12 14:21
Rob Grainger12-Feb-12 14:21 

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.