- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Why do people have to be "clever"? They create clusterfucks that seem to only show up after they leave their jobs
Admin
https://matthewmazur.files.wordpress.com/2013/04/5goodideafairy.jpg
Admin
an added benefit is that the clever hans who defecated the crapcode will put it on his resume and use it to get a better job than the poor sap who has to pooper-scoop the mess he left behind.
Admin
I disbelieve that there are 65 disjoint functions that a food additive can perform.
Admin
Colour, colour_new, colour_prod, colour_dev. It starts to add up!
Admin
@Decius - why would there not be more than 64 functions? It does say in the text: "every legal additive to food so that paranoid hippies can call them liars and insist they all cause cancer and autism. "
So it probably started out as something like enum hippyComplaint { Color = 1, SweetFlavour = 2, SourFlavour = 4, Cancer = 8, Autism = 16, BowelCancer = 32, ProstateCancer = 64, MakesYouThinkYouCanFlyOffBuildings = 128, StopsYouListeningToJanisJoplin = 256 .....
}
Admin
"I disbelieve that there are 65 disjoint functions that a food additive can perform."
Wikipedia lists 21 major categories of effect. It doesn't take many subcategories to get above 65.
https://en.wikipedia.org/wiki/Food_additive
Admin
I disbelieve that you've never seen out of control bitmask creep, especially when a specific bitmask can never, ever be re-used as another indicator and other flags unrelated to function start sneaking in. Of course if they threw it all out and started over again they might end up with less than 64 - but luckily in this case all they had to do was throw it all out.
Admin
the best part is changing it to a float, if it was actually used as a bitmask, would REALLY fudge things up
Admin
Nasch, pretty much has it right. The wikipedia list is more or less the same as what we used, but there are subcategories and the like. What actually happened on that day though, was that we added regulations for a new country that managed its additives slightly differently so on the data entry side, we all of a sudden had an extra 20 or so "different" additives, and that pushed us up to 67.
Admin
Bonus funny: my manager really pushed back on deleting the code. "I'm sure they wrote that for a reason." I had to sit him down and explain that that's what source control is for, and demo "undeleting" something using git, before he reluctantly allowed me to make my changes.
Admin
Bitmask are such a foolish idea in the 21st century. We can "waste" memory with serialized strings, now.
Admin
Ha! I was going to comment with something like 'I hope you didn't tell management, because they'd have sh@#fit about deleting anything in "working" code', but I got distracted. That you were able to convince him puts him above the usual.
Admin
... or there may have been a reason at the time, but the callers have all since been removed.
Admin
Also color, color_new, color_prod and color_dev.