Click here to Skip to main content
15,919,479 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: We always use "i" as a loop counter... Pin
John R. Shaw9-Mar-07 11:30
John R. Shaw9-Mar-07 11:30 
GeneralInfinite for loops Pin
Jesse Krebs5-Mar-07 21:00
Jesse Krebs5-Mar-07 21:00 
GeneralRe: Infinite for loops Pin
Mike Dimmick6-Mar-07 3:48
Mike Dimmick6-Mar-07 3:48 
GeneralRe: Infinite for loops Pin
RodgerB6-Mar-07 9:42
RodgerB6-Mar-07 9:42 
GeneralRe: Infinite for loops Pin
jhwurmbach8-Mar-07 4:56
jhwurmbach8-Mar-07 4:56 
GeneralRe: Infinite for loops Pin
RodgerB8-Mar-07 7:17
RodgerB8-Mar-07 7:17 
GeneralRe: Infinite for loops Pin
John R. Shaw9-Mar-07 12:29
John R. Shaw9-Mar-07 12:29 
GeneralDatabase rats nest Pin
Steve Fillingham5-Mar-07 19:26
Steve Fillingham5-Mar-07 19:26 
I once came across an Access database (already WTF) that used columns instead of rows for a Calendar like application ! The Calendar table had (from memory) 1 row for each day with 50+ columns for each half hour block from 8:00am. Now you can imagine the horror it was to try to maintain such an application. The reports that ran of this dog were nightmarish, even to SELECT a single day that had 'something' happening on it looked something like

SELECT * FROM Calendar WHERE Time800 <> '' OR Time830 <> '' OR Time900 <> '' .. OR Time1600 <> ''

I can imagine what the coder would have said when asked to make the days start a little earlier than 8:00, "Oh, sure, that'll take at least another 4 months to re-schema the database and touch up all the affected queries".

And when the original developers were sacked for taking way took long and we took over the project we were questioned why we were completely rewriting it from scratch. The above Calendar table was just one example in this diseased rats nest, there were plenty of others like using hidden form controls as global variables. You would open up the main form and had absolutely no hope of actually telling what it would look like when run since it was completely covered in these demons from hell. I just hate with a passion code that does not read simple, I hate it when I cannot confidently make a simple change to some code without it screwing up something completely unrelated because the variable I modded was global and had different meanings depending on where it was called from.

Anyway that's my rant Smile | :)




Code should be simple. No excuses.
GeneralRe: Database rats nest Pin
Dirk Gutsche5-Mar-07 21:59
Dirk Gutsche5-Mar-07 21:59 
GeneralRe: Database rats nest Pin
Bradml6-Mar-07 0:53
Bradml6-Mar-07 0:53 
GeneralRe: Database rats nest Pin
Steve Fillingham6-Mar-07 19:32
Steve Fillingham6-Mar-07 19:32 
Generalif something then... nothing Pin
Fernando A. Gomez F.5-Mar-07 13:27
Fernando A. Gomez F.5-Mar-07 13:27 
GeneralRe: if something then... nothing Pin
John R. Shaw9-Mar-07 12:38
John R. Shaw9-Mar-07 12:38 
GeneralObject identifiers [modified] Pin
_oti5-Mar-07 13:12
_oti5-Mar-07 13:12 
Generalduplicate variable names seperated by scope Pin
Jason De Arte5-Mar-07 13:08
Jason De Arte5-Mar-07 13:08 
GeneralRe: duplicate variable names seperated by scope Pin
bluesboy847-Mar-07 1:06
bluesboy847-Mar-07 1:06 
GeneralUnnecessary try / catch block Pin
David Rush5-Mar-07 10:17
professionalDavid Rush5-Mar-07 10:17 
GeneralRe: Unnecessary try / catch block Pin
PIEBALDconsult5-Mar-07 12:52
mvePIEBALDconsult5-Mar-07 12:52 
GeneralRe: Unnecessary try / catch block Pin
DavidNohejl5-Mar-07 13:07
DavidNohejl5-Mar-07 13:07 
GeneralRe: Unnecessary try / catch block Pin
Ed.Poore5-Mar-07 21:36
Ed.Poore5-Mar-07 21:36 
GeneralRe: Unnecessary try / catch block Pin
David Rush6-Mar-07 9:26
professionalDavid Rush6-Mar-07 9:26 
GeneralRe: Unnecessary try / catch block Pin
GWB@s1c6-Mar-07 7:58
GWB@s1c6-Mar-07 7:58 
GeneralRe: Unnecessary try / catch block Pin
David Rush6-Mar-07 9:43
professionalDavid Rush6-Mar-07 9:43 
GeneralRe: Unnecessary try / catch block Pin
Brian R6-Mar-07 13:33
Brian R6-Mar-07 13:33 
GeneralUse Appropriate Development Tools Pin
Brian Leach5-Mar-07 10:16
Brian Leach5-Mar-07 10:16 

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.