What is the most stupid coded solution you have read/improved/witnessed?

Posted by Rigo Vides on Stack Overflow See other posts from Stack Overflow or by Rigo Vides
Published on 2010-03-22T22:27:06Z Indexed on 2010/03/22 22:31 UTC
Read the original article Hit count: 304

And for stupid I mean Illogical, non-effective, complex(the bad way), ugly code style.

I will start:

We had a requirement there when we needed to hide certain objects given the press of a button. So this framework we were using at the time provided a way to tag objects and retrieve all the objects with a certain tag in a complete iterable collection. So I presented the most logically solution given these conditions to my partner:

Me:

you know, tag all the objects we needed to hide with the same tag, then call the function to get them all, iterate trough them and make them hidden.

Partner:

I don't know, that is hardcoding for me...

Me:

So what do you suggest?

20 mins later...

Partner:

I don't know... let's put a tag to all the objects to be hidden like this, 1, 2, 3, 4, 5, 6, 7 (and so for each object to be hidden), Then we make a for from 1 to n (where n was the number of objects to hide) and we hide them all there!

© Stack Overflow or respective owner

Related posts about Community

Related posts about bad-practices