• chris (unregistered) in reply to @Deprecated
    @Deprecated:
    "The real WTF is using the word FAIL as a noun..."

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

  • (cs) in reply to DonaldK
    DonaldK:
    CSV files a mess in concept. In practice, it's much worse.

    BURN THE HERETIC!!!

    :)

  • turist (unregistered)

    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)

  • mindwhip (unregistered) in reply to Rodnas

    Somtimes the WHY is more important than the WHAT

  • Fool (unregistered)

    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.

  • (cs) in reply to hikari
    hikari:
    That's the kind of comment I put in code sometimes; when you've been banging your head against the desk for the best part of day trying to figure out why something doesn't work, only to find that it's because of some bizarre piece of esoterica, that possibly had some logically explanation but you have no idea what it is, sarcasm and bile is often the way to go.

    Also they're comments - they don't hurt the code and sometimes a little back story helps explain why this method that seems stupid exists. And if the way they're written gives a future developer a reason to smile, then so much the better.

    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.

  • comatose developer (unregistered)

    "[...] puppies, and [...]" OH DEAR GOD!!!

  • pencilcase (unregistered) in reply to chris
    chris:
    @Deprecated:
    "The real WTF is using the word FAIL as a noun..."

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

    No. "Fail" is a verb. Not a noun. Only a verb. Verbing nouns wierds language.

  • omarazam (unregistered)

    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.

  • (cs) in reply to Remy Porter
    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!

    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.

  • (cs) in reply to pencilcase
    pencilcase:
    chris:
    @Deprecated:
    "The real WTF is using the word FAIL as a noun..."

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

    No. "Fail" is a verb. Not a noun. Only a verb. Verbing nouns wierds language.

    Complaining about bad grammar on the internet is a fail.

  • JJ (unregistered) in reply to pencilcase
    pencilcase:
    chris:
    @Deprecated:
    "The real WTF is using the word FAIL as a noun..."

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

    No. "Fail" is a verb. Not a noun. Only a verb. Verbing nouns wierds language.

    But isn't this nouning verbs?

  • Anonymous (unregistered) in reply to Mozzis

    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.

  • Freddy Bob (unregistered) in reply to Smug Unix User
    Smug Unix User:
    Purple prose in code Words of truth slice the demons Excel king of evil
    Smug enough to put 6 syllables in the last line of a haiku?
  • A different Paul (unregistered)

    Paul is Brillant.

  • Norman Diamond (unregistered) in reply to pencilcase
    pencilcase:
    No. "Fail" is a verb. Not a noun. Only a verb. Verbing nouns wierds language.
    "Excel" is a verb. Not a noun. Only a verb. Excel doesn't excel, it's a fail.
  • As anti-MS as the next guy (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>

    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!

  • MikeyB (unregistered)

    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.

  • MikeyB (unregistered) in reply to MikeyB

    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.

  • MMxxx (unregistered) in reply to Anonymous

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

  • gnasher729 (unregistered) in reply to ¯\(°_o)/¯ I DUNNO LOL

    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.

  • vpass1187 (unregistered)

    Microsoft sucks...

  • JDR (unregistered) in reply to Smug Unix User

    This is ... almost poetic.

  • resa (unregistered)

    I would have added a similar comment to that code. Any programmer looking at the code would probably wonder wtf without the comments...

  • (cs) in reply to resa
    resa:
    I would have added a similar comment to that code. Any programmer looking at the code would probably wonder wtf without the comments...

    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.

  • tooki (unregistered) in reply to gnasher729

    Yeah, the CPU in question was called the 68LC040 ("Low Cost").

  • ILackedAles (unregistered)

    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.

  • paul (unregistered) in reply to gnasher729

    Nice try, Paul.

  • Shark8 (unregistered) in reply to tony
    tony:
    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)

    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.

  • (cs) in reply to paratus
    paratus:
    I've got a query that stores two sets of related data in different fields (name/surname and alias name/alias surname if you like). If an alias is present, I want to use that, otherwise I want to use the real name. I was using NVL, but ran into some problems:
    SELECT nvl(alias_name, name), nvl(alias_surname, surname) FROM mydata
    
    Unfortunately, alias_name can be nnull even when the surname is present (and I don't really want to concatenate them, because that will cause problems in the calling program.

    Could you please assist?

    Cheers.

    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)

    select
        decode(alias_name||alias_surname,null,name,alias_name) as name,
        decode(alias_name||alias_surname,null,surname,alias_surname) as surname,
    from mydata
    

    (the same can be implemented in ANSI SQL using CASE)

    but now, what exactly prompted you to ask that question here?

  • dolor (unregistered) in reply to Name Withheld
    Name Withheld:
    First of all, comments aren't for voicing your opinions, they should be concise, and to the point.

    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.

  • Guy (unregistered) in reply to dolor

    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.

  • Derekwaisy (unregistered)
    Comment held for moderation.
  • Jimmyanten (unregistered)

    prednisone 20mg buy online: https://prednisone1st.store/# prednisone 20mg

Leave a comment on “Not Good Enough for Paul”

Log In or post as a guest

Replying to comment #:

« Return to Article