• l10n (unregistered)

    i've used wrappers like this for localization (not WTF). overloading "confirm" was not an option.

  • ElvisBelt (unregistered)

    On a similar subject, i found this little POS in an XSLT file today.....

    <!-- This repayment fee -->

    <xsl:variable name="rfval"> xsl:choose <xsl:when test="number(translate(key('bopsdata',concat('REPAYMENTFEE',$thisnum)),'£','')) = number(translate(key('bopsdata',concat('REPAYMENTFEE',$thisnum)),'£',''))"> <xsl:value-of select="number(translate(key('bopsdata',concat('REPAYMENTFEE',$thisnum)),'£',''))"/> </xsl:when> xsl:otherwise <xsl:value-of select="0"/> </xsl:otherwise> </xsl:choose> </xsl:variable>

    i hate having to maintain this gash!

  • dkf (unregistered) in reply to Jon
    Jon:
    TheRubyWarlock:
    ... you're serious? The "GoF Book" is Design Patterns by Gamma, Helm, Vlissides (sp?) and the other guy who's name escapes me. The Gang of Four. The de facto standard book when it comes to software design patterns.
    Only Paula would call it something incoherent like "GoF Book" when everyone recognises "Design Patterns".
    Well, actually most of the really important technical/academic books are referred to by the names of their authors (often because their titles are really long and dull!) In this case, the term "gang of four" stuck for some reason (don't ask me why) and I've seen "GoF" in use in many places (including in print) for many years. In short, you're wrong.
    Jon:
    You aren't Paula, by any chance, are you?
    Your lack of real experience is really showing now. Are you Paula's anal-retentive (but otherwise brillant) brother?
  • That's Me! (unregistered) in reply to Franz Kafka
    Franz Kafka:
    Frost:

    Right, because we all know greap[sic]+sed, awk, and bash aren't available on Windows.

    um, yes they are.

    sar·casm (sär'kāz'əm) n.

    1. A cutting, often ironic remark intended to wound.
    2. A form of wit that is marked by the use of sarcastic language and is intended to make its victim the butt of contempt or ridicule.
    3. The use of sarcasm. See Synonyms at wit.
  • (cs) in reply to Hubert
    Hubert:
    It is called the Adapter pattern.
    No, this one's an example of the Simpleton pattern.
  • htg (unregistered) in reply to JOHN
    JOHN:
    Not a WTF.

    I've seen this hundreds of times in two different cases:

    1. confirmMessage used to have more logic but was refactored out, however the code calling this function is too numerous to refactor as well.

    2. confirmMessage will eventually become more complex, but confirm is used in other places that don't need the future logic, so this placeholder is created so that other modules can begin to use the function even though it is not complete yet.

    Therefore, not a WTF.

    Yes. I agree entirely.

    But I meet your sound reasoning and raise you "commented code". A comment like

    /*

    • We plan to implement our own message box like that Poke Dialog on Facebook. */

    would have sorted it all out.

  • htg (unregistered) in reply to KenW
    KenW:
    Wrong. Every single change gets tested. Period. If you change something that affects 200 places in the code, all 200 changes get tested. Anything less means you're not testing at all, and that's sloppy.

    This is a trivial change, 200 places, 1 place or 10000 places. If it was a compiled language it would be optimised out by the compiler. The manual refactoring is the human equivalent of the same.

    There's better reasons for not refactoring than the baseless worry that you'll alter the program's logic.

    Jack:
    4.) 1 check-in 200 files, 1 comment, 1 reference to the defect

    Again, wrong. The change should be commented with every one of the files checked in, so that it's history is properly tracked.

    First commit: "Removed checkMessage(msg) method". Someone checks out. Second commit: "Refactored checkMessage(msg) to message(msg)." .... two hours pass, people check out or update their code, and all get red all over their IDE's screens, what, no such method? ... Two hundredth commit: "Refactored checkMessage(msg) to message(msg)."

    Manager to You: What the dangnabbit are you doing? (if you have email notifications for each commit, you'll have the entire department on your arse).

    Far far far far far better to commit all changes ONCE, with ONE comment. You show a clear and total misunderstanding of how versioning systems work by not knowing that your ONE comment is applied to ALL the changes so that you can keep the full history that you require.

    Maybe if you work on your own per-developer branch, you'd get away with it, but I'd be livid that you would take 2 hours to do a 30 second commit. You'd still have to merge the results of all your commits into the parent branch of course...

    Glad you don't work with me. I have enough to do without trying to keep track of some sloppy amateur's work as well.

    I think the same, about you.

  • Nathan Baum (unregistered) in reply to KenW
    KenW:
    Again, wrong. The change should be commented with every one of the files checked in, so that it's history is properly tracked.
    You're saying you use a version control system which forces you to individually comment each file in a change spanning hundreds of files? The Real WTF™ is your VCS.
  • BTM (unregistered)

    Saying that it is stupid is stupid ...

    It night have been a wrapper function, that would display a DIV or something with a fancy form, but was removed after some revision / isn't yet done.

    Would you rather change hundrets of onclick="confirm(...)" in separate HTML files, or ONE functions body?

  • Jon (unregistered) in reply to dkf
    dkf:
    Jon:
    You aren't Paula, by any chance, are you?
    Your lack of real experience is really showing now. Are you Paula's anal-retentive (but otherwise brillant) brother?
    I didn't write that part.
  • dkf (unregistered) in reply to Jon
    Jon:
    dkf:
    Jon:
    You aren't Paula, by any chance, are you?
    Your lack of real experience is really showing now. Are you Paula's anal-retentive (but otherwise brillant) brother?
    I didn't write that part.
    I copied the wrong quote part? Sorry if that's so.
  • lidj geek (unregistered) in reply to GettinSadda

    not a wtf!!

  • bazz (unregistered) in reply to GettinSadda

    this typically occurs when first there is a need of a wrapper function, then later on due to changes the added logic is not needed anymore and the wrapper code becomes the same as the available library function. Instead of updateing the function call throughout the whole system, the easy way out is just to leave the wrapper in place...

  • errorkode (unregistered)

    I've actually written very similar code, makes it possible to write proper unit tests

Leave a comment on “How Did No One Think of this Before?”

Log In or post as a guest

Replying to comment #:

« Return to Article