- 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
Bosses ask us to "just add a button" ... but it's NEVER that simple is it?
Admin
FIRST TIME THE SECOND!
Admin
Boss and "just/simple" in one sentence?
-> Problem!
Admin
C'mon people. This is actually a fairly clever and elegant data compression technique. You see, booleans often take up 32 bits of data storage. In this case, they only need 16 bits- 8 bits for the character, and 8 bits for the comma. Additionally, this is quite an ingenious way of representing a nullable boolean by using the "-" chanracter to represent the unused columns. A++ to this obviously talented developer!
Addendum (2011-02-16 09:45): For the dense, this is satire.
Admin
Die Frits!
Admin
Take, for example, the simple two-word request "ODBC support".
Admin
Admin
Yeah, we had to add that "simple" request years ago. Now we are having to go back to add "direct SQL support" as well...
Admin
No, no, NO! You have to make sure the string is....wait for it... UNICODE!!!
Admin
How did you know that's how I refer to myself?
Die Frits says "Stay in school!". Die Frits says "Brush your teeth!". Die Frits says "Tuck in your shirt!".
You get the idea.
Admin
I'm pretty sure I would have strangled the penguin by case 4.
Admin
I work with Cognos. I beat your WTF by default...
Admin
Admin
This is terrible design, yes, but how is it hard to implement the change request?
Find the id of the report to be changed, and the index of the column to be added. Go to the appropriate place in the array-string and change the '0' to a '1'. Done. Maybe.
Admin
You fools. Who writes queries for reports anymore?
Admin
Is that like choking the chicken?
In which case, I made it as far as case 2.
Admin
Wouldn't "Die Frits" say "Aufenthalt in der Schule"?
Admin
+1
But at least I can laugh at how ridiculous the SQLs it generates and the subsequent explain plans are.
iusto - verb; Iusto go to the gym, but now I'm just fat
Admin
Admin
Wait, you can edit your own posts? I registered an account to see if this is true.
Addendum (2011-02-16 09:58) Yup.
Admin
An obvious solution would be to create an array with all 36893488147419103232 possible permutations of the columns displayed and a map that maps from the report number to its index in the array. If you want to add a column, recompute the data index and retrieve that string (prepending it first with a '-').
Admin
That sounds like a great idea... if you're working your two-week notice, and really, really wanted to be mean to the other developers.
As an aside, I'd really hate to see the file size, and load time (for whatever IDE), that the report file would require.
Admin
By the looks of it, if you wanted to add a column you would need to make the same change to all 32 strings. And try injecting a column at, let's say, position 23. Might take less time to just rewrite it.
Admin
Just wrap that baby in a for loop and it'll be perfect!
Admin
Admin
This is preferred way to do this in CMS shop.
Admin
Your not too bright, are you?
Admin
Depends where he works. How do you know he doesn't own his own chain of clothing stores?
Admin
I think someone's booty hurts.
Admin
I would never have written code like that. I would use a script to write it for me.
captcha: laoreet
Admin
Admin
Admin
Admin
Admin
Yes I'm at work, but I own a chain of clothing stores so it's ok. This is actually company policy.
Admin
Admin
I have worked with Cognos and Kronos, so WTF^2.
Admin
Admin
Admin
Admin
OK, Larry. It's hard to improve on such high-level technique. However, if I could change one thing it would be that I store those strings in a plain text file so future enhancements could be made without recompiling the code. Or maybe a tab-delimited file, so they could use Excel...
Happy now?
Admin
Admin
Admin
I pretty sure every comment fake boog makes is a euphemism for masturbation.
Admin
At least all of the reports are defined in one place, making it easier for Brian H to find the code he needs to change.
You can't put a price on that.
Admin
This needs to be more enterprizy! They need to use xml and store it in the database!
yields:
Now you don't need to rebuild and deploy in order to change the columns on a report, you just need to change it in the database.
Admin
Nope, there is no for loop, or maybe a while(true), and the lack of a wooden table with OCR is simply offensive.
Admin
Unless there's something Frits isn't telling us, that would be "Der Frits!"
(Du bist nicht so klug, oder?)
Admin
Admin