- 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
So Paul is now working as a Campaign Speech Writer for a US Presidential Candidate.
Admin
His comments are valid.
Admin
I had to do some COM interop stuff with Excel a while ago, and I tend to agree with his ramblings.
Admin
I also had to work with excel files, and he's damn right: it's a mess.
Admin
Appropriate.
Every time I see "Jet Engine", I shudder a little. And then my users go, "Hey, we'd love to be able to just upload loosely formatted spreadsheets to get data entered into the system. Add that as a feature!"
AAAAHHHHHHRRRRRRGGGGG.
Admin
I got caught. I do not see the wtf
Admin
So... he writes code that solves complicated, annoying problems, while thoroughly documenting the quirks of the API that might otherwise make the code counterintuitive.
...if you don't want this guy, I'll put in a word at my company.
Admin
I do not understand what is the problem. He documents correctly an ugly workaround, even if in slightly caricatural terms.
Admin
That's actually a piece of comment that adds valuable information for future developers. Well, except the humorous bits :). Not really a CodeSOD
Admin
I think the WTF is the fact that this was submitted as WTF. The poster obviously didn't have to deal with these issues in Microsoft technologies.
Quite surprising for someone claiming to come from a "Microsoft shop".
Admin
Purple prose in code Words of truth slice the demons Excel king of evil
Admin
Looks good, on the whole.
That 6th-like sense of outrage and self-rightseousness seems quite common around programmers. If you want decent geeks, make sure your managers can handle it.
Admin
I think the WTF is that they let Paul leave, when he was clearly a decent coder and absolutely correct in all his opinions.
Admin
DISCLAIMER: Here obviously the WTF is the API for Excel, not the poor, funny Paul.
Admin
Well at least I'm not the only one siding with Paul here. I'll leave it at that.
Admin
So, what's TRWTF? Excel? That an anti-Microsoft guy should get a job at a Microsoft shop?
Admin
Well he did comment the code. Unfortuanly, it takes less time to read the code and figure out what is does, than reading the comment. And THAT my friends is NOT best practices. </troll>
Admin
I would probably have created an extra sanitzeSheetName method for this, but that aside having done a larger "application" with Excel, VBA, even DDE (AFAIR) i totally agree with the language used in the comments ...
Admin
It does sound like Excel's API is a whole pile of WTF in itself - the name must end in a $, but the API call to retrieve the name may or may not be correct?!
When you have code with a comment about needing to stick squirrel noises in filenames, the WTF is the need to insert squirrel noises, not commenting about the stupidity of needing to do so!
(I've only done battle with Excel over COM, which was more than painful enough, not to mention ludicrously slow to read and write a handful of characters at a time; I'm very glad that if I ever need to do that again now, there's a decent library for reading Excel files without having to wade through the WTF-API. Of course, the fact I was processing user data from people who didn't see the problem with numbers meandering from column to column as you go was another WTF: 'well, it's still over on the right, what does it matter whether it's column L or column K?)
Admin
I totally agree with Paul. In fact, this is reminiscent of comments I've left in Excel related code. The only way you'd disagree is if you've never had to do something non-trivial with an Excel API (any of them, they're all horrid)
Admin
Definitively not a WTF.
Related, from the Sup-mail source:
(There's more, about IMAP, but this was specifically about an MS "product")
Admin
Sorry, but the dude is correct in his code comments. I've just done some work the Office COM objects and it's a nightmare I don't wish to revisit. Where is the WTF here, other than the overly descriptive rant in the comment.
Admin
I'm willing to consider it a minor WTF that Paul's solution was to do global search-and-replaces over the entire string, when, according to his comments, the problem was only about by certain magic characters appearing (or not appearing) at the far end of the string.
Admin
"Basically, if something wasn't perfect, it was a disaster. Also, he failed to mention his anti-Microsoft tendencies."
By show of hands, who among you thought that they might be 'Paul' after reading this bit.
(raises hand)
Admin
So, the real WTF here is an indirect one, being Excel?
Admin
TRWTF is: who is the person talking to Hank's writing?
Admin
The only WTF here is using var for everything
Admin
Would tend to agree with the thoughts above Excel as general Office Tool is fine; as a Data delivery method into systems its a real pain. I work a fair bit with importing and exporting to Excel (no choice) and it doesn't even play well with Microsoft's own Tool - SSIS
Admin
And to figure why it does that?
Admin
Besides... it's unlikely anyone will ever take the time to read the comment unless there's already a bug, and they're going back over old code.
Admin
Admin
"The real WTF is using the word FAIL as a noun..."
"PS., why is every line quoted in the article?" "Okay, I know why, it just looks odd."
Admin
Actually, that IS the "code is its own documentation" principle at work. You don't need to document the code (i.e. what the code does) as it's obvious.
What you need to document is the thought process behind the code.
Admin
The real WTF is that Paul accepted a job at a Microsoft shop.
Admin
Please, guys. Stop pumping up Paul's ego. I actually have to work with this guy.
Admin
Did you know that Excel (at least the early versions) was written as a virtual machine executing bytecode? This was to make it more compact and easier to develop. Or something. (I think they did this with Word, too.)
Did you know that the bytecode interpreter used 8086-style segment/offset pointers?
Did you know that in Excel 1.0 for the Macintosh, the virtual machine still used segment/offset pointers, and those pointers represented real memory addresses?
Can you guess what happened when early adopters upgraded their Macintosh computers to have more than 1 megabyte of memory?
My understanding is that there was a special case in Switcher to make sure that Excel 1.0 was never given memory at higher addresses.
Admin
TRETF is
What if the Load fails? The source file will still be deleted, and you're left with something more than a missing '$' to explain away.
Admin
Count me among those who do not see what TRWTF is (I would hardly call snide comments about an inconsistent API anti-Micorsoft tendencies). Maybe Hank is a manager who does not fully understand why his developers keep complaining about the Excel files he keeps sending them?
Paul may be overly acerbic in his code comments and have the social skills of a thermonuclear device, but as someone who has wrestled with libraries that extract and modify data from file formats indented solely for display (Excel Spreadsheets, Word Documents, PDF Files,...) I can totally sympathize with his frustration.
Admin
Yes, I've been saying for years that the most important and difficult to produce type of documentation is what I call "philosopical documentation."
In other words, what the hell was I thinking when I wrote this, and why did I think that was a good idea.
Admin
The real WTF is "microsoft coding shops".
Unless you are developing software for Microsoft themselves, there is no reason why you should tie yourselves down to using their systems.
Write platform-specifics where you have to, and portable code the rest of the time.
Admin
Hire a MS hating developer, let him work with the Office API (which even MS evangelists agree is a disaster). Your employer is truly evil. Poor guy.
Admin
Hi, you must still be at school.
Admin
THe real WTF is that he is using Jet Engine instead of a a library that can better handle these work arounds such as NPOI. At least 40% of my job is knowing what other libraries and code bases are out there so that when I run into a problem, I'm not reinventing the wheel every time.
Admin
CSV files a mess in concept. In practice, it's much worse.
Admin
Who knows... it may also signify that this is a story that was posted as submitted and not embellished.
BTW, if TRWTF is NSFW comments, the story loses its appeal when it has been filtered.
Admin
Admin
Admin
I can sympathise. I once worked on a subsystem to create formatted documents using OLE Automation, where a program could control Word as if it was a user via a rich API. Incredibly slow with crashes and bugs galore. The cursor-based control meant the document generation would frequently mess up whenever the cursor jumped somewhere unexpectedly.
After a few months, I gave up and tried to generate RTF documents. Fine for simple formatting but anything more sophisticated and documentation was lacking. For example, the syntax of fields was defined but no fields were named, even for today's date. RTF was a poorly documented, alternative Word format, not a document exchange format, and the only way understand the format was to reverse engineer it by loading documents into Word and seeing what it did.
One of the many ways I learnt to hate Microsoft.
Admin
I love how he rants about having to remove the '$' then re-appended it... when from the comments given he could have done a simple if check.
Admin
No, I work and make loads of money. My systems endure and everyone who wrote in COM now understands what a big mistake it was.