• Anonymous (unregistered)

    What does the first paragraph has to do with the code snippet???

  • (cs)
    int    tempDouble;

    I think that covers it, really. We've heard of Hungarian ... Backwards Hungarian? Wrong Hungarian?

  • Pista (unregistered) in reply to jas88
    jas88:
    int    tempDouble;

    I think that covers it, really. We've heard of Hungarian ... Backwards Hungarian? Wrong Hungarian?

    I think the hungarianness is the smallest WTF on this line.

  • Rfoxmich (unregistered)

    If you've ever seen programs written by physicists...you'll know this ain't nothing

    Captcha Jumentum - There's energy mommentum and jumentum

  • fa2k (unregistered)

    Not the worst, but definitely deserves to be here. This kind of rounding can't be done well after formatting it as a string, so without a special formatter, this approach would be sound. There is however a DecimalFormat in Java, which is much better. As for bugs, I only see that it may miss some trailing zeros, are there any other?

  • Frosh (unregistered) in reply to jas88
    jas88:
    int    tempDouble;

    I think that covers it, really. We've heard of Hungarian ... Backwards Hungarian? Wrong Hungarian?

    "Wrongarian," surely.

  • anonymous (unregistered) in reply to jas88
    jas88:
    int    tempDouble;

    I think that covers it, really. We've heard of Hungarian ... Backwards Hungarian? Wrong Hungarian?

    Where I work, there are a few Access databases which were designed with Wrong Hungarian nomenclature. For example, this gem of a report: [image]

  • (cs)

    Good luck, Jeremy. They seem to be everwhere...

  • legacy warrior (unregistered)

    I'm starting to get annoyed at the implicit assumption that many of tdwtf articles make that anyone who is tasked with working on poor or legacy code should, and will, naturally immediately abandon ship and seek a new job. Legacy code is something that has to be dealt with for any project that's been around for a while. A job is a job and having to work on crap for a while (especially at a "first job") really should be expected.

  • martin (unregistered)

    I love the function name, btw.

  • snoofle (unregistered)

    If Bugcourse will be used entirely or even 4 times out of 5, I'm gonna resign. I think Erik would be more than happy to fill in for me. Or Remy.

  • silentd (unregistered) in reply to anonymous

    I would elect not to read it.

  • Anon (unregistered) in reply to legacy warrior
    legacy warrior:
    I'm starting to get annoyed at the implicit assumption that many of tdwtf articles make that anyone who is tasked with working on poor or legacy code should, and will, naturally immediately abandon ship and seek a new job. Legacy code is something that has to be dealt with for any project that's been around for a while. A job is a job and having to work on crap for a while (especially at a "first job") really should be expected.

    The problem isn't that the legacy code is legacy. The problem is that no one ever bothers fixing any of it or devoting any time to understanding it, leaving the New Guy to parse page after page of the worst garbage devkind has ever produced.

    If you're going to make new coders sift through garbage you've been too lazy to handle, it indicates that you don't actually give a damn about them, or your codebase.

  • Hannes (unregistered) in reply to Anon
    Anon:
    legacy warrior:
    I'm starting to get annoyed at the implicit assumption that many of tdwtf articles make that anyone who is tasked with working on poor or legacy code should, and will, naturally immediately abandon ship and seek a new job. Legacy code is something that has to be dealt with for any project that's been around for a while. A job is a job and having to work on crap for a while (especially at a "first job") really should be expected.

    The problem isn't that the legacy code is legacy. The problem is that no one ever bothers fixing any of it or devoting any time to understanding it, leaving the New Guy to parse page after page of the worst garbage devkind has ever produced.

    Maybe that's why they hired a new guy: Because no one had time to fix or even understand the legacy code. But instead of fixing the code and get rid of one huge WTF the new guy quits the job. I don't think with that kind of working morale he doesn't last long in his new job either.

  • ¯\(°_o)/¯ I DUNNO LOL (unregistered) in reply to Anon
    Anon:
    The problem isn't that the legacy code is legacy. The problem is that no one ever bothers fixing any of it or devoting any time to understanding it, leaving the New Guy to parse page after page of the worst garbage devkind has ever produced.
    The real problem isn't even that no one ever bothers fixing it. The problem is when someone wants to bother to fix it, either management or a "legacy programmer" on the "team" refuses to allow it to be fixed for whatever reason.
  • Remy Porter (unregistered) in reply to snoofle
    snoofle:
    If Bugcourse will be used entirely or even 4 times out of 5, I'm gonna resign. I think Erik would be more than happy to fill in for me. Or Remy.

    No, snoofle, I'll resign too if Discourse becomes staple of this site. Erik can have both of our jobs, if he wants it. I'm done here.

  • (cs) in reply to jas88
    jas88:
    int    tempDouble;

    I think that covers it, really. We've heard of Hungarian ... Backwards Hungarian? Wrong Hungarian?

    "Reverse Hungarian."

    Actually, I like it if you are using application Hungarian instead of system Hungarian, eg "customerID".

  • (cs)

    The commented lines won't help, since the correct answer is to not even use this function.

    Also, Java is TRWTF.

  • Rocky (unregistered) in reply to legacy warrior
    legacy warrior:
    I'm starting to get annoyed at the implicit assumption that many of tdwtf articles make that anyone who is tasked with working on poor or legacy code should, and will, naturally immediately abandon ship and seek a new job. Legacy code is something that has to be dealt with for any project that's been around for a while. A job is a job and having to work on crap for a while (especially at a "first job") really should be expected.

    In some shops you aren't allowed to fix code unless there is a ticket for it.

    Re-factoring and cleaning cruft are usually found dead by the road leading to better jobs...

  • Geoff (unregistered) in reply to Rfoxmich
    Rfoxmich:
    If you've ever seen programs written by physicists...you'll know this ain't nothing

    Captcha Jumentum - There's energy mommentum and jumentum

    Hear, hear! The two worst spaghetti Fortran programs I had to work on were both written by physicists.

    One of them even had the goto line numbering in a random order, and the author's attempt at indentation was to massively indent the first line and then have every subsequent line in the block at the left-hand margin.

  • Brendan (unregistered) in reply to Frosh
    Frosh:
    jas88:
    int    tempDouble;

    I think that covers it, really. We've heard of Hungarian ... Backwards Hungarian? Wrong Hungarian?

    "Wrongarian," surely.

    A "Hung Wrongarian" (and don't call me Shirley!)...

  • (cs)

    On legacy code:

    Never enough time to do it "right", but always enough money to "do it over". This IS the problem, sometimes legacy code is more concise and doesn't need to be altered. The "new guy" (I just finished a stint doing that!) usually wants to re-factor the code and "make it better", but the inertia to do so is EXTREME and then someone mentions "risk" and it all gets shot down. So spaghetti code accreted over the years of "fixes" that "just work" continue, and nobody wants to touch the pile of stinky stuff!

    Life goes on. We get new jobs. (SIGH)

  • foxyshadis (unregistered) in reply to fa2k
    fa2k:
    Not the worst, but definitely deserves to be here. This kind of rounding can't be done well after formatting it as a string, so without a special formatter, this approach would be sound. There is however a DecimalFormat in Java, which is much better. As for bugs, I only see that it may miss some trailing zeros, are there any other?
    If people ever actually searched for standard library functions that solved their problem, half the submissions to TDWTF would go away.
  • fatfacemcfattypants (unregistered)

    That's the weirdest random function I've ever seen.

  • Anonymous (unregistered)

    it's camelCase, nothing wrong with it when used in the correct context.

  • Norman Diamond (unregistered) in reply to foxyshadis
    foxyshadis:
    If people ever actually searched for standard library functions that solved their problem, half the submissions to TDWTF would go away.
    But then half the submissions to TDWTF would be standard library functions. We already know what category they'd be half the time. We'd really want to escape from some of the others.
  • Norman Diamond (unregistered) in reply to herby
    herby:
    On legacy code:

    Never enough time to do it "right", but always enough money to "do it over".

    In a small company there's not enough time or money to do it right AND there's not enough time or money to do it over.

    It's only legacy code when there's not enough time or money to do it over. It's still brand new code when there's not enough time or money to do it right the first time.

Leave a comment on “An Attempt at Proper JSP”

Log In or post as a guest

Replying to comment #:

« Return to Article