Click here to Skip to main content
15,902,492 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: ALWAYS USE A STRINGBUILDER! Pin
richard_k5-Nov-10 19:18
richard_k5-Nov-10 19:18 
GeneralRe: ALWAYS USE A STRINGBUILDER! Pin
Member 968-Nov-10 6:25
Member 968-Nov-10 6:25 
GeneralRe: ALWAYS USE A STRINGBUILDER! Pin
PIEBALDconsult8-Nov-10 13:55
mvePIEBALDconsult8-Nov-10 13:55 
GeneralRe: ALWAYS USE A STRINGBUILDER! Pin
Member 968-Nov-10 16:13
Member 968-Nov-10 16:13 
GeneralRe: ALWAYS USE A STRINGBUILDER! Pin
PIEBALDconsult9-Nov-10 2:05
mvePIEBALDconsult9-Nov-10 2:05 
GeneralRange Checking Pin
AspDotNetDev31-Oct-10 12:25
protectorAspDotNetDev31-Oct-10 12:25 
GeneralRe: Range Checking Pin
fjdiewornncalwe31-Oct-10 16:02
professionalfjdiewornncalwe31-Oct-10 16:02 
GeneralRe: Range Checking Pin
AspDotNetDev1-Nov-10 6:19
protectorAspDotNetDev1-Nov-10 6:19 
The fact that an integer is being set to 1 or 0 rather than using a bool is a pretty good indicator that some of this code was copied from the database. Here is what my best guess is as to how this code evolved:
*Only single numbers were checked, so they were put in a database table.
*Next, certain ranges needed to be checked, and they were hard coded in the SP that checked single numbers.
*Somebody thought the SQL code looked ugly or needed to use the SP without ranges, so they moved that to the VB.Net.
*Somebody thought the VB.Net looked ugly, so they added ranges to the database table.
*At some point, there was some VB.Net copy/pasting so that hard coded logic stayed.

Result: Dead | X|

GeneralRe: Range Checking Pin
fjdiewornncalwe2-Nov-10 1:33
professionalfjdiewornncalwe2-Nov-10 1:33 
GeneralRe: Range Checking Pin
BillW338-Nov-10 6:46
professionalBillW338-Nov-10 6:46 
GeneralRe: Range Checking Pin
makumazan8431-Oct-10 23:41
makumazan8431-Oct-10 23:41 
GeneralRe: Range Checking Pin
fjdiewornncalwe1-Nov-10 2:59
professionalfjdiewornncalwe1-Nov-10 2:59 
GeneralRe: Range Checking Pin
AspDotNetDev1-Nov-10 6:20
protectorAspDotNetDev1-Nov-10 6:20 
JokeRe: Range Checking Pin
fjdiewornncalwe2-Nov-10 1:34
professionalfjdiewornncalwe2-Nov-10 1:34 
GeneralRe: Range Checking Pin
richard_k5-Nov-10 19:24
richard_k5-Nov-10 19:24 
GeneralRe: Range Checking Pin
Chris Meech1-Nov-10 5:03
Chris Meech1-Nov-10 5:03 
GeneralRe: Range Checking Pin
AspDotNetDev1-Nov-10 6:22
protectorAspDotNetDev1-Nov-10 6:22 
GeneralRe: Range Checking Pin
fjdiewornncalwe2-Nov-10 1:35
professionalfjdiewornncalwe2-Nov-10 1:35 
GeneralUgly, ugly, ugly! Pin
jamie55031-Oct-10 12:24
jamie55031-Oct-10 12:24 
GeneralRe: Ugly, ugly, ugly! Pin
AspDotNetDev31-Oct-10 12:29
protectorAspDotNetDev31-Oct-10 12:29 
GeneralRe: Ugly, ugly, ugly! Pin
Lutosław31-Oct-10 14:33
Lutosław31-Oct-10 14:33 
GeneralWhen the CEO becomes a developer I Pin
imagiro29-Oct-10 23:31
imagiro29-Oct-10 23:31 
GeneralRe: When the CEO becomes a developer I Pin
richard_k5-Nov-10 19:27
richard_k5-Nov-10 19:27 
GeneralWell it made me laugh anyway Pin
musefan29-Oct-10 6:33
musefan29-Oct-10 6:33 
GeneralRe: Well it made me laugh anyway Pin
Chris Meech29-Oct-10 6:51
Chris Meech29-Oct-10 6:51 

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.