- 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
Doesn't "fail" as a noun have a subtly different meaning to "failure", with maybe more of a sense of "in a way that really could have been predicted and avoided"?
Admin
BURN THE HERETIC!!!
:)
Admin
You don't need to hate MS in order to lose some of your sanity while working with MS-Office APIs and file formats ...
So, nothing to see here, at least not a WTF (the wording in the comments is somewhat colorful, but then, that's probably the normal reaction)
Admin
Somtimes the WHY is more important than the WHAT
Admin
Ya, these are just engineering comments in code. After spending an hour figuring out that one line of code, I always comment the reason that the unintuitive line is there.
Some guy at work just pulled his hair out for 8 hours jsut to find the one API call he was missing. And we still don't know why this particular call is needed. He should probably comment it appropriatey.
Admin
But that's not a back story, it's a rant. I got bored after the first paragraph. Save it for beer o'clock.
A comment like "Some versions of Excel append a '$' to the returned sheet name, but some don't. Make a consistent name." would convey the necessary information. If he must editorialise, a well-placed "(!)" is more than sufficient.
And anyway, the code to which the first rant applies doesn't immediately follow the comment block, which doesn't help.
Putting all this in a helper function called NormaliseSheetName() or similar would be nice too.
And I hope that after composing his Pulitzer-winning rant, he spent some of the time he had left making sure that the code would never be required to process worksheets with dollar signs in their names.
Admin
"[...] puppies, and [...]" OH DEAR GOD!!!
Admin
No. "Fail" is a verb. Not a noun. Only a verb. Verbing nouns wierds language.
Admin
Excel is not nearly as annoying as dealing with the quirks of all the garden-variety, standard-noncompliant, boot-strapped piece of bloatware that J2EE developers need to deal with.
Admin
yep, been there. I found the best way was to give the client a pre-formatted spreadsheet for them to edit and then validate the upload to make sure its columns are the same as expected, letting them know what error was found, if any. Seemed to work out well.
Admin
Complaining about bad grammar on the internet is a fail.
Admin
Admin
The first cell cannot begin with the letters 'ID' regardless of datatype because it will break. The workaround: Just put an apostrophe.
http://support.microsoft.com/kb/215591
Really normal. You're absolutely right. We're all idiots for thinking the text field should work process "ID" normally, and Microsoft is right for saying, "Just put an apostrophe!"
Here's another example: Let's say you have an SSIS package, and you try to go to excel from a SQL Server database. The column is a varchar, and let's say the values could be "1", "Sandwich", "001", "Best Buy", "WHATEVER". Excel by default will take the first 8 rows of input it gets from SQL Server, arbitrarily decide what datatype it thinks the column should be and truncate accordingly. For example, if four of the rows are numeric, it might decide the column is supposed to be numeric even though four are strings, and then delete all non numeric values from that column. This sort of stuff is frustrating.
http://weblogs.sqlteam.com/markc/archive/2010/02/16/61104.aspx
Again though, you're right. We're all crazy, and Excel is perfectly fine. The thousands of wasted man hours working around all these random GOTCHAS in excel are a small price to pay for the perfection of Microsoft Excel.
Admin
Admin
Paul is Brillant.
Admin
Admin
Rodnas, The purpose of a good comment is NOT to document WHAT you do, but WHY you do it. For that purpose, this comment is exemplary!
Admin
Hank sounds like a douche. I wouldn't want to work for him.
Sounds like something that would come from the self righteous dicks in any kind of management position within a "Microsoft shop".
You're doing it wrong.
Admin
Also, they should have written an abstraction layer around excel or any external API. That way they could have encapsulated this stupid functionality so nobody else would have to know about it.
Admin
"I think it's actually damaged the GNP of whole nations, this Excel program. It'd be interesting to know how badly."
We here in MISSOURI know that in the case of a LEGITIMATE database Excel has a way of VALIDATING and NORMALIZING the data. You must have a defective database.
Admin
When the Macintosh 2 was released, it had a 68020 processor with a maths coprocessor. To make Excel fast, Microsoft called an OS function that returned which processor and which maths coprocessor your computer had. Then they checked that your computer had a 68020 processor, and if it had one, they used the faster coprocessor. Great, Excel ran faster.
One year forward, Apple released an improved Mac with a better 68030 processor. Guess what: Micosoft checked whether you had a 68020. A 68030 is not a 68020. Excel ran slow because it didn't use the maths coprocessor.
Microsoft changed their code to check for "68020 or higher". Two years later, Apple released a cheaper model that had a 68040 without maths coprocessor. Microsoft checked for "68020 or higher". 68040 is higher than 68020, so they used the maths coprocessor. Which wasn't there. Excel crashed.
And all the time, the OS function they called returned the processor version and the maths coprocessor version.
Admin
Microsoft sucks...
Admin
This is ... almost poetic.
Admin
I would have added a similar comment to that code. Any programmer looking at the code would probably wonder wtf without the comments...
Admin
which is why I think this article isn't really a WTF in itself, or at least Paul's comments were not. And I can sympathise with Paul why he didn't like working in such an environment, yet still he did what he had to do to get things working.
If we judge the worth of a WTF article by the number of comments it gets, this one is currently in 2nd place for October with the salary soapbox one in first place and "known WTF code" bottom.
Admin
Yeah, the CPU in question was called the 68LC040 ("Low Cost").
Admin
I ran into a former co-worker the other day. I could never decide if said co-worker was inexperienced or completely incompetent. I asked what they were doing now, and the reply was that they were working at Microsoft on Office products.
I wept.
Admin
Nice try, Paul.
Admin
If you want to descend into insanity, use PHP for importing, manipulating, and then exporting as either a) a different version of excel, or b) into a database.
Admin
Sounds like oracle (nvl)....
I think you are asking to return the real names for both fields only if both alias names are absent, yes? And if the alias_name is null, the alias_surname is not, and surname is not, you want 'null,<alias_surname>', correct?
use "decode" (http://psoug.org/reference/decode_case.html)
(the same can be implemented in ANSI SQL using CASE)
but now, what exactly prompted you to ask that question here?
Admin
You mean, like
i = 1; // Asign 1 to i?
Nope. Explain why you have to do something, explain what you're doing. The code tells how you do it, unless you do it in a non-obvious way.
Admin
Way to miss the point. None of the quoted suggests that you should comment obvious. So many people here think that it's OK to rant in comments. It makes me sad.
Admin
prednisone 20mg buy online: https://prednisone1st.store/# prednisone 20mg