• Rich (unregistered) in reply to J

    Nah, by asking for 20, next week he can ask for 40 (and the week after, 60).

    Could have an office pool to bet on when the programmer finally cracks, plus a weekly pool on how many parameters he'll add that week!

    appellatio: (adj.) something that is simultaneously apropos and appalling.

  • (cs) in reply to Me
    Me:
    I have had to clean up code that went on for approx. 250 lines just to verify that one (1) session variable had been set.
    I'm intrigued now. How can you possibly spend 250 lines to check one session variable?
  • boog (unregistered) in reply to Anon
    Anon:
    Bob:
    Max Peck:
    Like was said earlier, a for loop. Does Java have a params type for passing multiple arguments in the formal parameter list? This one is nuts!

    I think the intention is to prevent callers from having to do this (prior to Java 5):

    setRecData(new String[] { "a", "b", "c" });

    Instead, they can do this (for up to 30 trios of string arguments):

    setRecData("a", "b", "c");

    In Java 5, of course, all this becomes unnecessary. Perhaps some newbie looked at this code and wondered, "WTF?!" It is all perfectly logical, even if it is overkill.

    Not sure that's much of a saving. Basically you have an extra "new String[] { " and an extra "}" to type in the first case, an extra burden that become completely insignificant as the number of arguments increases (it's a lot of extra guff for 1 argument, it's next to nothing for 30). Plus, you lose the ability of the caller to create the array in...I don't know....maybe a for loop instead of manually typing out 30 arguments. Or in other words, doing on the caller side what the function should be doing on the callee side.

    Yeah, but TRWTF is Eclipse, which for some reason has become the IDE of choice for the Java community. Eclipse hates arrays and makes every effort to keep you from using them by exibiting unpredictable and inconsistent indentation anytime you have to use them over multiple lines. I also enjoy how Eclipse encourages you not to save your work, because if you do, it will attempt to recompile your entire project and pop up windows to tell you that the code you already know is incomplete will not compile.

    One thing that totally amazes me is the way Eclipse has managed to prevent you from sharing your project between users. Before I encountered it, if you had told me that it was possible to not be able to share projects (which simply amounts to setting a source and class path), would would not have believed you. Eclipse is everything that is wrong with Java, and its name even implies its darkness.

    Who the hell designed the interface? A transformer? Why do I need different views for browsing, editing, and debugging? No other applications work like that.

    My favorite thing that has been happening lately is that copy occasionally decides not to work either with the keyboard or the popup menu. I can CUT and paste, but I cannot COPY and paste. How can you freaking screw up one of the fundamental operations of text editing? You have to restart to get it to work right!

    I'm mad as hell, but I guess I'm going to continue to take it because my company won't pony up the cash for anything better! Who was it that was in here talking about craftsmen and tools the other day?

  • (cs) in reply to frits
    frits:
    Clearly you don't understand sarcasm.
    Clearly you don't understand the QUOTE button.
  • empire (unregistered)

    TRWTF is that he committed this in one day. What was he thinking? "Oh, someone made a feature request for my useless utility library, better get busy!" He must be a robot, because no self-respecting human being would generate those 1000+ lines of unnecessary code IMMEDIATELY after a feature request.

  • Moo (unregistered) in reply to boog
    boog:
    Yeah, but TRWTF is Eclipse, which for some reason has become the IDE of choice for the Java community. *rant*

    Well, it's good to know that PHP isn't the only thing that Eclipse totally sucks at...

  • Mark (unregistered)

    Someone should tell this coder that there is such a thing as working too hard.

  • (cs) in reply to DeGustibusNonDisputandumEst
    DeGustibusNonDisputandumEst:
    The real wtf is java.
    No, the real wtf is PHP, even though it's not related to this article.
  • (cs) in reply to boog
    boog:
    Anon:
    Bob:
    Max Peck:
    Like was said earlier, a for loop. Does Java have a params type for passing multiple arguments in the formal parameter list? This one is nuts!

    I think the intention is to prevent callers from having to do this (prior to Java 5):

    setRecData(new String[] { "a", "b", "c" });

    Instead, they can do this (for up to 30 trios of string arguments):

    setRecData("a", "b", "c");

    In Java 5, of course, all this becomes unnecessary. Perhaps some newbie looked at this code and wondered, "WTF?!" It is all perfectly logical, even if it is overkill.

    Not sure that's much of a saving. Basically you have an extra "new String[] { " and an extra "}" to type in the first case, an extra burden that become completely insignificant as the number of arguments increases (it's a lot of extra guff for 1 argument, it's next to nothing for 30). Plus, you lose the ability of the caller to create the array in...I don't know....maybe a for loop instead of manually typing out 30 arguments. Or in other words, doing on the caller side what the function should be doing on the callee side.

    Yeah, but TRWTF is Eclipse, which for some reason has become the IDE of choice for the Java community. Eclipse hates arrays and makes every effort to keep you from using them by exibiting unpredictable and inconsistent indentation anytime you have to use them over multiple lines. I also enjoy how Eclipse encourages you not to save your work, because if you do, it will attempt to recompile your entire project and pop up windows to tell you that the code you already know is incomplete will not compile.

    One thing that totally amazes me is the way Eclipse has managed to prevent you from sharing your project between users. Before I encountered it, if you had told me that it was possible to not be able to share projects (which simply amounts to setting a source and class path), would would not have believed you. Eclipse is everything that is wrong with Java, and its name even implies its darkness.

    Who the hell designed the interface? A transformer? Why do I need different views for browsing, editing, and debugging? No other applications work like that.

    My favorite thing that has been happening lately is that copy occasionally decides not to work either with the keyboard or the popup menu. I can CUT and paste, but I cannot COPY and paste. How can you freaking screw up one of the fundamental operations of text editing? You have to restart to get it to work right!

    I'm mad as hell, but I guess I'm going to continue to take it because my company won't pony up the cash for anything better! Who was it that was in here talking about craftsmen and tools the other day?

    Uhhh... My eclipse has none of those problems. Where did you get yours?

    Okay I have one issue with eclipse: the preferences are stored per-workspace. So if I start a new workspace, then all my key mappings need to be reset, and I need to turn off the $%#@ spell checker again.

    The Real WTF is spell checking your source code!!!

    (The workaround is to create a blank default workspace, configure it, and copy that instead of using eclipse to create a new workspace).

  • (cs) in reply to dkf
    dkf:
    frits:
    Clearly you don't understand sarcasm.
    Clearly you don't understand the QUOTE button.

    Nope. I've never used it before. Doy!

    Clearly you do understand hyperlinks, though.

  • Beans (unregistered) in reply to boog
    boog:
    Yeah, but TRWTF is Eclipse, which for some reason has become the IDE of choice for the Java community. Eclipse hates arrays and makes every effort to keep you from using them by exibiting unpredictable and inconsistent indentation anytime you have to use them over multiple lines. I also enjoy how Eclipse encourages you not to save your work, because if you do, it will attempt to recompile your entire project and pop up windows to tell you that the code you already know is incomplete will not compile.
    Surely all that behaviour can be changed in the config? Auto format and save behaviours are both configurable, aren't they?
  • Steve (unregistered)

    The real WTF is that he put the commas on the left... who does that???

  • Mark (unregistered) in reply to Airhead
    Airhead:
    DeGustibusNonDisputandumEst:
    The real wtf is java.
    No, the real wtf is PHP, even though it's not related to this article.
    I think you'll find TRWTF is VB. Also unrelated to today's article.
  • boog (unregistered) in reply to Beans
    Beans:
    boog:
    Yeah, but TRWTF is Eclipse, which for some reason has become the IDE of choice for the Java community. Eclipse hates arrays and makes every effort to keep you from using them by exibiting unpredictable and inconsistent indentation anytime you have to use them over multiple lines. I also enjoy how Eclipse encourages you not to save your work, because if you do, it will attempt to recompile your entire project and pop up windows to tell you that the code you already know is incomplete will not compile.
    Surely all that behaviour can be changed in the config? Auto format and save behaviours are both configurable, aren't they?
    You would think so, but not available. It's incomprehensible, almost as if the writers are playing a massive practical joke on the Java community.
  • (cs)

    I must say, thank you Alex for posting this code in its entirety. Though omitting the bulk of it for brevity can be easier on the eyes, much is lost in the translation.

    Presenting the monster in all its glory as you have done conveys so much more of the situation. I can almost see the immense void that takes residence in the head of its original programmer. I am in awe.

  • Mark (unregistered) in reply to Steve
    Steve:
    The real WTF is that he put the commas on the left... who does that???
    Agreed, that's really dumb. A comma marks the end of a clause so it should be after the clause it delimits, not before the next one on the next line. Very weird style, glad I don't work with this guy.
  • (cs)

    One thing that most of the suggestions (all of them?) leave out is the compile time checking that the number of parameters is a multiple of 3....

  • iToad (unregistered) in reply to Moo
    Moo:
    boog:
    Yeah, but TRWTF is Eclipse, which for some reason has become the IDE of choice for the Java community. *rant*

    Well, it's good to know that PHP isn't the only thing that Eclipse totally sucks at...

    It kind of sucks at C++ too. Why the hell can't it compile single source code files without a mass project rebuild?

  • (cs) in reply to boog
    boog (unregistered):
    <bunch of boohoo-ing about Eclipse/>

    I'm mad as hell, but I guess I'm going to continue to take it because my company won't pony up the cash for anything better! Who was it that was in here talking about craftsmen and tools the other day?

    I think it was you. Maybe me. But who can tell anymore?

  • iToad (unregistered) in reply to Mark
    Mark:
    Someone should tell this coder that there is such a thing as working too hard.

    He probably wrote a script to generate the code automatically.

  • boog (unregistered) in reply to boog
    boog:
    boog:
    <bunch of boohoo-ing about Eclipse/>

    I'm mad as hell, but I guess I'm going to continue to take it because my company won't pony up the cash for anything better! Who was it that was in here talking about craftsmen and tools the other day?

    I think it was you. Maybe me. But who can tell anymore?
    Why are you replying to yourself.

  • neminem (unregistered) in reply to Mark
    Mark:
    I think you'll find TRWTF is VB. Also unrelated to today's article.
    If you just want to start saying that the real WTF is a random crappy language, with no relevance to today's story, why stop at VB? Why not FORTRAN? Or for that matter, Brainfuck? Or LOLCode or Whitespace?
  • egg (unregistered)

    For the love of god and all that is holy can we please just get an:

    // ed: snip

  • (cs) in reply to boog
    boog:
    boog:
    boog:
    <bunch of boohoo-ing about Eclipse/>

    I'm mad as hell, but I guess I'm going to continue to take it because my company won't pony up the cash for anything better! Who was it that was in here talking about craftsmen and tools the other day?

    I think it was you. Maybe me. But who can tell anymore?
    Why are you replying to yourself.
    It sounds like someone doesn't understand recursion.

  • Mark (unregistered) in reply to neminem
    neminem:
    Mark:
    I think you'll find TRWTF is VB. Also unrelated to today's article.
    If you just want to start saying that the real WTF is a random crappy language, with no relevance to today's story, why stop at VB? Why not FORTRAN? Or for that matter, Brainfuck? Or LOLCode or Whitespace?
    I guess humor's not your strong suit.
  • (cs) in reply to tom103
    tom103:
    Wait... Java doesn't have variable-length argument lists ?

    In C# only one overload would have been needed:

    public void setRecData(params String[] data)
    {
        ...
    }
    Look at String.Format in the framework. It actually has overloads for one, two, and three parameters, as well as a params overload for more. The pattern in today's WTF actually has some grounding in practicality, he just screwed it up badly.
  • (cs) in reply to boog
    boog:
    I must say, thank you Alex for posting this code in its entirety. Though omitting the bulk of it for brevity can be easier on the eyes, much is lost in the translation.

    Presenting the monster in all its glory as you have done conveys so much more of the situation. I can almost see the immense void that takes residence in the head of its original programmer. I am in awe.

    I agree. This is one of those things that you really need to see in full to believe.

  • (cs)

    TRWTF is that I can't reply 'coz something called 'Akismet' sez that I am spam. WTF?

  • (cs) in reply to Severity One
    Severity One:
    The other WTF is the 'throws Exception', which is saying that something might go wrong in this method, but you don't know what, and you've removed the possibility for the user of the method to distinguish between compile-time and run-time exceptions.
    This is a common trait on either lazy coders, or those migrating from .NET, where there is no such thing as a checked Exception. That architecture actively encourages the dreaded Diaper pattern; later the aforementioned coders will start throwing generic Exceptions everywhere. I've suffered from this as well!
  • Anonymous (unregistered) in reply to danixdefcon5
    danixdefcon5:
    TRWTF is that I can't reply 'coz something called 'Akismet' sez that I am spam. WTF?
    So Akismet gets logged-in users as well? I thought it was just us unregistered riff-raff that fell foul to the wrath of Akismet.

    The actual problem is that you are trying to post a completely legitimate comment. If you try to make your post sound a bit spammier Akismet will let it right through.

  • (cs) in reply to Anonymous
    Anonymous:
    danixdefcon5:
    TRWTF is that I can't reply 'coz something called 'Akismet' sez that I am spam. WTF?
    So Akismet gets logged-in users as well? I thought it was just us unregistered riff-raff that fell foul to the wrath of Akismet.

    The actual problem is that you are trying to post a completely legitimate comment. If you try to make your post sound a bit spammier Akismet will let it right through.

    Akismet is an equal-opportunity WTF. It treats us registered riff-raff just as badly as you unregistered scum.

  • Idiocracy Reigneth (unregistered) in reply to frits
    frits:
    Me:
    <soapbox> Exactly, someone should fire this guy immediately and threaten him with severe and lasting bodily harm if he ever touches a computer again.

    Nothing but pitchforks and torches for people who write code like this.

    I have had to clean up code that went on for approx. 250 lines just to verify that one (1) session variable had been set. Don't have that code to post, but wish I did to give you guys a good laugh, facepalm, etc. </soapbox>

    No, he should be sent to prison, since that is the place where rehabilitation occurs.
    "You have been sentenced to 1 night of Rehabilitation"

  • Wo0t (unregistered) in reply to boog
    boog:
    I also enjoy how Eclipse encourages you not to save your work, because if you do, it will attempt to recompile your entire project and pop up windows to tell you that the code you already know is incomplete will not compile.
    Turn off Build Automatically.
  • boog (unregistered) in reply to Wo0t
    Wo0t:
    boog:
    I also enjoy how Eclipse encourages you not to save your work, because if you do, it will attempt to recompile your entire project and pop up windows to tell you that the code you already know is incomplete will not compile.
    Turn off Build Automatically.
    Eclipse hates this and was not designed to work this way. If you do this, you get even more unpredictable results.
  • (cs) in reply to neminem
    neminem:
    Mark:
    I think you'll find TRWTF is VB. Also unrelated to today's article.
    If you just want to start saying that the real WTF is a random crappy language, with no relevance to today's story, why stop at VB? Why not FORTRAN? Or for that matter, Brainfuck? Or LOLCode or Whitespace?

    That can't be. Languages that were intented to be WTFs can't be TRWTF.

    By the way, that is not relevant to today's story.

  • Larry (unregistered) in reply to Mcoder
    Mcoder:
    neminem:
    Mark:
    I think you'll find TRWTF is VB. Also unrelated to today's article.
    If you just want to start saying that the real WTF is a random crappy language, with no relevance to today's story, why stop at VB? Why not FORTRAN? Or for that matter, Brainfuck? Or LOLCode or Whitespace?

    That can't be. Languages that were intented to be WTFs can't be TRWTF.

    By the way, that is not relevant to today's story.

    TRWTF is that whooshing sound you keep hearing.

  • Matt Westwood (unregistered) in reply to Steve
    Steve:
    The real WTF is that he put the commas on the left... who does that???

    Commas on the left are a useful technique because then you can easily add lines without getting caught out with end effects.

    CAPTCHA: "Consequat": as a result, he defecated.

  • Design Pattern (unregistered) in reply to boog
    boog:
    I'm mad as hell, but I guess I'm going to continue to take it because my company won't pony up the cash for anything better!
    Your company does not have 0$ in cash to pony up for Netbeans or IntelliJ IDEA Community Edition?

    How will they pay your wage?

  • Design Pattern (unregistered) in reply to boog
    boog:
    Eclipse hates this (...)
    It is sentient?
  • Adam (unregistered)

    I can hear the Zerg voice in the back of my head going:

    SPAWN MORE OVERLOADS!

  • Mark (unregistered) in reply to Matt Westwood
    Matt Westwood:
    Steve:
    The real WTF is that he put the commas on the left... who does that???

    Commas on the left are a useful technique because then you can easily add lines without getting caught out with end effects.

    CAPTCHA: "Consequat": as a result, he defecated.

    This may be useful if you're still using a display from the 70s with an 80 char line limit but I fail to see what relevance it has today. I have my IDE spread across two monitors for a total horizontal resolution of 2560 pixels and this is using a couple of cheapo 5 year old monitors, nothing special. I really don't need to worry about missing a trailing comma and most other devs of this day and age don't either. Plus, for all you IDE lovers, you'll know if you missed a comma as soon as you hit return because the auto-format will behave differently.

  • (cs) in reply to toth
    toth:
    You've found a magic bullet. Any time you want to get him out of the way so that you can work on code uninterrupted by him, just say "We need to spawn more overlords."
    FTFY
  • Design Pattern (unregistered) in reply to daily
    daily:
    toth:
    You've found a magic bullet. Any time you want to get him out of the way so that you can work on code uninterrupted by him, just say "We need to spawn more overlords."
    FTFY
    I for one say welcome to our old meme!

    I have overloaded your setRecData. Pray that i don't overload it any further!

  • (cs) in reply to Mark
    Mark:
    Steve:
    The real WTF is that he put the commas on the left... who does that???
    Agreed, that's really dumb. A comma marks the end of a clause so it should be after the clause it delimits, not before the next one on the next line. Very weird style, glad I don't work with this guy.

    You see it all the time in SQL - it allows you to delete a line or comment a line in a big column list, without causing a syntax error...

    select col1, col2,
    col3 --you can't comment out this line from table

    select col1 ,col2 ,col3 --now you can comment it without an error from table

  • (cs) in reply to boog
    boog:
    Yeah, but TRWTF is Eclipse, <Eclipse bashing>

    Speaking of which, does anyone have recommendations for Python IDEs that are not Eclipse?

  • (cs) in reply to boog
    boog:
    I'm mad as hell, but I guess I'm going to continue to take it because my company won't pony up the cash for anything better! Who was it that was in here talking about craftsmen and tools the other day?
    NetBeans is free.
  • Iago (unregistered) in reply to boog
    boog:
    Eclipse hates arrays and makes every effort to keep you from using them by exibiting unpredictable and inconsistent indentation anytime you have to use them over multiple lines.
    Seems pretty predictable and consistent to me. And it's not like you can't adjust the indentation with that big blank key at the bottom of your keyboard if you really care that much.
    boog:
    I also enjoy how Eclipse encourages you not to save your work, because if you do, it will attempt to recompile your entire project and pop up windows to tell you that the code you already know is incomplete will not compile.
    This is a lie. Eclipse does not pop up any windows. It indicates errors in an unobtrusive panel at the bottom of the screen.
    boog:
    One thing that totally amazes me is the way Eclipse has managed to prevent you from sharing your project between users.
    Allow me to introduce you to the concept of "source control". If you want to share code between users, they should "check out" separate copies from a central store called a "repository". Then they can both edit it without trampling on each other's changes.
    boog:
    Why do I need different views for browsing, editing, and debugging? No other applications work like that.
    It's useful. You don't want the variable inspection panel to be visible when you aren't debugging, for example. And plenty of applications have different views for when you're doing different things. I don't hear many people complain about Outlook displaying different things for email, tasks, and calendars, or Word displaying different things for editing text and editing tables.

    Of course Emacs is superior in every way, but that doesn't mean Eclipse is totally useless.

  • Pyrexkidd (unregistered) in reply to boog
    boog:
    Anon:
    Bob:
    Max Peck:
    Like was said earlier, a for loop. Does Java have a params type for passing multiple arguments in the formal parameter list? This one is nuts!

    I think the intention is to prevent callers from having to do this (prior to Java 5):

    setRecData(new String[] { "a", "b", "c" });

    Instead, they can do this (for up to 30 trios of string arguments):

    setRecData("a", "b", "c");

    In Java 5, of course, all this becomes unnecessary. Perhaps some newbie looked at this code and wondered, "WTF?!" It is all perfectly logical, even if it is overkill.

    Not sure that's much of a saving. Basically you have an extra "new String[] { " and an extra "}" to type in the first case, an extra burden that become completely insignificant as the number of arguments increases (it's a lot of extra guff for 1 argument, it's next to nothing for 30). Plus, you lose the ability of the caller to create the array in...I don't know....maybe a for loop instead of manually typing out 30 arguments. Or in other words, doing on the caller side what the function should be doing on the callee side.

    Yeah, but TRWTF is Eclipse, which for some reason has become the IDE of choice for the Java community. Eclipse hates arrays and makes every effort to keep you from using them by exibiting unpredictable and inconsistent indentation anytime you have to use them over multiple lines. I also enjoy how Eclipse encourages you not to save your work, because if you do, it will attempt to recompile your entire project and pop up windows to tell you that the code you already know is incomplete will not compile.

    One thing that totally amazes me is the way Eclipse has managed to prevent you from sharing your project between users. Before I encountered it, if you had told me that it was possible to not be able to share projects (which simply amounts to setting a source and class path), would would not have believed you. Eclipse is everything that is wrong with Java, and its name even implies its darkness.

    Who the hell designed the interface? A transformer? Why do I need different views for browsing, editing, and debugging? No other applications work like that.

    My favorite thing that has been happening lately is that copy occasionally decides not to work either with the keyboard or the popup menu. I can CUT and paste, but I cannot COPY and paste. How can you freaking screw up one of the fundamental operations of text editing? You have to restart to get it to work right!

    I'm mad as hell, but I guess I'm going to continue to take it because my company won't pony up the cash for anything better! Who was it that was in here talking about craftsmen and tools the other day?

    Uhh...

    NetBeans? http://netbeans.org/downloads/

    Although I entirely understand a company not wanting to pony up for free software.

    But compared to Eclipse--Well there is no comparison.

    Captcha iusto: Something you did in a past life.

  • EngleBart (unregistered) in reply to boog
    boog:
    Eclipse bash
    I suspect a troll, but I will take the bait.

    I am using an ancient version of Eclipse and it has settings that will solve your every whine except the Copy/Paste. You could probably get better support answers by posting in a better location.

    (Look at the Window, Preferences, Java, Code Style, Code Formatter, button:Edit..., tab:Line Wrapping, Default indentation for wrapped lines AND Default indentation for array.) (Import/Export preferences)(Autobuild off), etc.

    Possible causes for the copy paste:

    1. Someone has installed a password stealer on your box.
    2. Your coworkers love to hear you whine and mess with basic settings on your preferences just to mess with your head. (Should we let boog copy code today? Nah!) (Next week, let's take away paste!) Solution: LOCK your computer if you cannot see your keyboard!
  • (cs) in reply to boog
    boog:
    I must say, thank you Alex for posting this code in its entirety. Though omitting the bulk of it for brevity can be easier on the eyes, much is lost in the translation.

    Presenting the monster in all its glory as you have done conveys so much more of the situation. I can almost see the immense void that takes residence in the head of its original programmer. I am in awe.

    Originally, I had snipped it... but, as you mentioned, watching scrollbar size grow in your browser as the article downloads conveys exactly what it'd feel like when stumbling across. To me, the WTF wasn't so much the useless wrapping code, but the fact that the developer just kept going after 1000's of lines.

Leave a comment on “Overloaded Help”

Log In or post as a guest

Replying to comment #:

« Return to Article