What is the most stupid coded solution you have read/improved/witnessed?
- by Rigo Vides
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!