Click here to Skip to main content
15,867,937 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: piece of javascript code Pin
2b|!2b==?29-Jun-07 21:56
2b|!2b==?29-Jun-07 21:56 
GeneralRe: piece of javascript code Pin
Shog929-Jun-07 22:02
sitebuilderShog929-Jun-07 22:02 
GeneralRe: piece of javascript code Pin
2b|!2b==?29-Jun-07 22:42
2b|!2b==?29-Jun-07 22:42 
GeneralRe: piece of javascript code Pin
jhwurmbach2-Jul-07 0:51
jhwurmbach2-Jul-07 0:51 
GeneralRe: piece of javascript code Pin
Guffa6-Jul-07 23:26
Guffa6-Jul-07 23:26 
GeneralRe: piece of javascript code Pin
Erik Midtskogen3-Jul-07 8:49
Erik Midtskogen3-Jul-07 8:49 
GeneralRe: piece of javascript code Pin
Sathesh Sakthivel9-Jul-07 20:01
Sathesh Sakthivel9-Jul-07 20:01 
GeneralNested loops - gotta love them Pin
_Damian S_18-Jun-07 19:04
professional_Damian S_18-Jun-07 19:04 
Many years ago I was working for a semi-govt agency here in Australia (who must remain nameless to protect myself and the guilty), and we had a contract programmer in to develop some portions of a system that was deployed (via CD in those days) to 87 sites across the state.

During testing, the client complained to me that if they performed a specific function the system would hang. I tested and tested and couldn't recreate it, so I finally asked them to step me through it over the phone while I ran the code in debug mode... Turns out they were adding an entire list of around 12500 items into a particular function to flag those items... Voila!! The code appeared to hang... I stepped into the code to find this particular gem:

for intCount = 1 to numItems
// Grab some data
for intCount2 = 1 to numItems
// do some processing
loop
loop

In essence, the system wasn't hanging, it was stepping through a nested loop - a cartesian product of the items in the list (12500 of them) - I calculated that the function would have eventually returned - after around 36 hours of processing...

<sigh> And I was a full-time staff member being paid far less than the contractor who inserted that gem into the code...

---------------------------------------------------------------------
Damian - Wondering why he has to be the one to sort the mess out!!
GeneralRe: Nested loops - gotta love them Pin
Sylvester george18-Jun-07 23:12
Sylvester george18-Jun-07 23:12 
GeneralRe: Nested loops - gotta love them Pin
Michael Dunn23-Jun-07 9:12
sitebuilderMichael Dunn23-Jun-07 9:12 
GeneralRe: Nested loops - gotta love them Pin
StevenWalsh21-Jun-07 6:54
StevenWalsh21-Jun-07 6:54 
JokeRe: Nested loops - gotta love them Pin
Dave Sexton21-Jun-07 12:04
Dave Sexton21-Jun-07 12:04 
GeneralRe: Nested loops - gotta love them Pin
Lee Humphries21-Jun-07 12:42
professionalLee Humphries21-Jun-07 12:42 
GeneralRe: Nested loops - gotta love them Pin
Alberto Bar-Noy24-Jun-07 1:18
Alberto Bar-Noy24-Jun-07 1:18 
GeneralRe: Nested loops - gotta love them Pin
Sylvester george21-Jun-07 20:13
Sylvester george21-Jun-07 20:13 
GeneralRe: Nested loops - gotta love them Pin
StevenWalsh22-Jun-07 2:00
StevenWalsh22-Jun-07 2:00 
GeneralRe: Nested loops - gotta love them Pin
_Damian S_24-Jun-07 16:13
professional_Damian S_24-Jun-07 16:13 
GeneralRe: Nested loops - gotta love them Pin
DynV21-Jun-07 18:23
DynV21-Jun-07 18:23 
GeneralRe: Nested loops - gotta love them Pin
Vasudevan Deepak Kumar22-Jun-07 0:21
Vasudevan Deepak Kumar22-Jun-07 0:21 
GeneralRe: Nested loops - gotta love them Pin
KarstenK26-Jun-07 3:25
mveKarstenK26-Jun-07 3:25 
GeneralRe: Nested loops - gotta love them Pin
ThatsAlok16-Jul-07 20:47
ThatsAlok16-Jul-07 20:47 
GeneralInsert a quote into a @-quoted string literal [modified] Pin
PIEBALDconsult18-Jun-07 9:27
mvePIEBALDconsult18-Jun-07 9:27 
GeneralRe: Insert a quote into a @-quoted string literal Pin
Mike Dimmick18-Jun-07 13:16
Mike Dimmick18-Jun-07 13:16 
GeneralRe: Insert a quote into a @-quoted string literal Pin
PIEBALDconsult18-Jun-07 16:15
mvePIEBALDconsult18-Jun-07 16:15 
GeneralRe: Insert a quote into a @-quoted string literal Pin
Dario Solera20-Jun-07 9:55
Dario Solera20-Jun-07 9:55 

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.