• ParkinT (cs)

    So Paul is now working as a Campaign Speech Writer for a US Presidential Candidate.

  • Anon (unregistered)

    His comments are valid.

  • mott555 (cs) in reply to ParkinT

    I had to do some COM interop stuff with Excel a while ago, and I tend to agree with his ramblings.

  • anonymous (unregistered)

    I also had to work with excel files, and he's damn right: it's a mess.

  • Remy Porter (cs)

    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.

  • Herwig (unregistered)

    I got caught. I do not see the wtf

  • ctw (unregistered)

    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.

  • Andrea (unregistered)

    I do not understand what is the problem. He documents correctly an ugly workaround, even if in slightly caricatural terms.

  • Jerome Eteve (unregistered)

    That's actually a piece of comment that adds valuable information for future developers. Well, except the humorous bits :). Not really a CodeSOD

  • Jan (unregistered)

    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".

  • Smug Unix User (unregistered)

    Purple prose in code Words of truth slice the demons Excel king of evil

  • Bob (unregistered)

    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.

  • Justin (unregistered) in reply to Jan

    I think the WTF is that they let Paul leave, when he was clearly a decent coder and absolutely correct in all his opinions.

  • anonymous (unregistered)

    DISCLAIMER: Here obviously the WTF is the API for Excel, not the poor, funny Paul.

  • unwesen (unregistered)

    Well at least I'm not the only one siding with Paul here. I'll leave it at that.

  • conifer (unregistered) in reply to Smug Unix User

    So, what's TRWTF? Excel? That an anti-Microsoft guy should get a job at a Microsoft shop?

  • Rodnas (unregistered)

    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>

  • hartmut (unregistered)

    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 ...

  • jas88 (cs)

    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?)

  • tony (unregistered)

    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)

  • AP² (unregistered)

    Definitively not a WTF.

    Related, from the Sup-mail source:

    ## I've turned off the following sanity check because Microsoft Exchange fails it. ## Exchange actually reports two different INTERNALDATEs for the exact same message ## when queried at different points in time. ## ## ## RFC2060 defines the semantics of INTERNALDATE for messages that arrive ## via SMTP for via various IMAP commands, but states that "All other ## cases are implementation defined.". Great, thanks guys, yet another ## useless field. ## ## Of course no OTHER imap server I've encountered returns DIFFERENT values for ## the SAME message. But it's Microsoft; what do you expect? If their programmers ## were any good they'd be working at Google.

    (There's more, about IMAP, but this was specifically about an MS "product")

  • Ho Miscreant! (unregistered)

    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.

  • Nagesh (unregistered)

    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.

  • Peter (unregistered)

    "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)

  • TheSHEEEP (unregistered)

    So, the real WTF here is an indirect one, being Excel?

  • Abico (unregistered)

    TRWTF is: who is the person talking to Hank's writing?

  • anonymouse (unregistered)

    The only WTF here is using var for everything

  • DataDevGus (unregistered)

    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

  • aaa (unregistered) in reply to Rodnas

    And to figure why it does that?

  • Sarten X (unregistered) in reply to Rodnas
    Rodnas:
    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>
    What the code does is obvious. Why it does what it does is not so obvious, so the comment is vital to preventing future regressions. The comedic tone and hyperbole are also vital for improving morale.

    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.

  • Medinoc (cs) in reply to Sarten X
    Sarten X:
    Rodnas:
    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>
    What the code does is obvious. Why it does what it does is not so obvious, so the comment is vital to preventing future regressions. The comedic tone and hyperbole are also vital for improving morale.

    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.

    Seconded, saying WHY something is done is more important than saying WHAT it is. That's the thing proponents of the "code is its own documentation" philosophy don't understand.

  • @Deprecated (cs)

    "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."

  • biziclop (cs) in reply to Medinoc
    Medinoc:
    Sarten X:
    Rodnas:
    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>
    What the code does is obvious. Why it does what it does is not so obvious, so the comment is vital to preventing future regressions. The comedic tone and hyperbole are also vital for improving morale.

    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.

    Seconded, saying WHY something is done is more important than saying WHAT it is. That's the thing proponents of the "code is its own documentation" philosophy don't understand.

    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.

  • Paul (unregistered) in reply to Peter

    The real WTF is that Paul accepted a job at a Microsoft shop.

  • Patrick Chasco (PBC) (unregistered)

    Please, guys. Stop pumping up Paul's ego. I actually have to work with this guy.

  • ¯\(°_o)/¯ I DUNNO LOL (unregistered) in reply to Anon
    Anon:
    His comments are valid.
    Ah, Excel.

    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.

  • Lupe (unregistered)

    TRETF is

        File.Delete(sourceFileName);

    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.

  • Scarred programmer (unregistered)

    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.

  • golddog (unregistered) in reply to biziclop
    biziclop:
    Medinoc:
    Sarten X:
    Rodnas:
    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>
    What the code does is obvious. Why it does what it does is not so obvious, so the comment is vital to preventing future regressions. The comedic tone and hyperbole are also vital for improving morale.

    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.

    Seconded, saying WHY something is done is more important than saying WHAT it is. That's the thing proponents of the "code is its own documentation" philosophy don't understand.

    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.

    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.

  • Cbuttius (cs)

    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.

  • macmac (unregistered)

    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.

  • macmac (unregistered)
    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.

    Hi, you must still be at school.

  • Tom (unregistered)

    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.

  • DonaldK (unregistered)

    CSV files a mess in concept. In practice, it's much worse.

  • Ben Jammin (unregistered) in reply to @Deprecated
    Comment held for moderation.
  • Ben Jammin (unregistered) in reply to macmac
    macmac:
    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.

    Hi, you must still be at school.

    I lol'd

  • Anon (unregistered) in reply to Patrick Chasco (PBC)
    Patrick Chasco (PBC):
    Please, guys. Stop pumping up Paul's ego. I actually have to work with this guy.
    Soon enough you will be working for him and not with him.
  • warmachine (cs)

    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.

  • Major DoucheBag (unregistered)

    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.

  • Cbuttius (cs) in reply to macmac
    macmac:
    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.

    Hi, you must still be at school.

    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.

Leave a comment on “Not Good Enough for Paul”

Log In or post as a guest

Replying to comment #:

« Return to Article