• frist? (unregistered)

    wow, my first frist! frits!

  • Whiskey (unregistered)

    Press Alt-F4 to reply to this comment.

    It was worth a try.

  • Paul (unregistered)

    Wait what, anything not involving string-mangling constitutes a shortcut? Neat trick :)

  • Derp (unregistered)

    It just dawned on me that the only things that make these "WTFs" is the level of impatience or frustration the "victim" gains in each story.

    Most of us can probably laugh and live with little derpy moments like this.

    Apparently, though, folks like jbanic need to "regain their cool" frist. Maybe the short fuse is the difference between a good job and a bad one.

  • chron3 (cs)

    Someone please put mroot back on the short bus to school... he should not be allowed to get near any code.

  • Gary (unregistered)

    Sorrybutyou'llneedtoseparatethewordsinthecommentsprogrammatically.

    Andwaitaminute.mrootisatotalidiotbutknowshowtousethisloopconstruct?

    if (rs.next()) {}
    
  • Migala (unregistered) in reply to Paul
    Paul:
    Wait what, anything not involving string-mangling constitutes a shortcut? Neat trick :)

    It is when you are used to working with Perl.

  • mroot (unregistered)

    I'm the winner because avoid having to do any thinking at all. So you see, I'm the smart one. Stupid n00bs...

  • No brain access (unregistered)

    Wait... he's talking about parsing the string... but he doesn't even have a string that contains all the addresses, he's just printing them one at a time.

    So not only was he trying to do the wrong thing, he was doing the wrong thing... wrong?

    catcha: luptatum. Sounds like a delicious wolf potato

  • EmperorOfCanada (unregistered)

    I am repeatedly shocked by the number of programmers who can't program. I once tried to explain Associative arrays to two programmers who had graduated from Waterloo. I used every synonym and semi synonym that I could come up with: Key value pairs, hashes, thing where you put in a string and it stores and retrieves a value, etc. They both sat there and looked at me blankly. So then I had to give a tutorial on the whole concept with them leaving the meeting thinking that I had made my code unnecessarily complex and could have just used a bunch of arrays and sorted/searched through them. But my favorite programmers are the one tool programmers; especially if the tool is obscure such as the Natural language or Adabas.

  • nopanic (unregistered) in reply to Derp
    Derp:
    Apparently, though, folks like jbanic need to "regain their cool" frist. Maybe the short fuse is the difference between a good job and a bad one.
    The short fuse can very well also be the difference between a junior anything and a more seasoned one. The seasoned ones tend to not take things so seriously.
  • MrBester (cs)

    I call shenanigans. Everybody has heard of Split.

    That, plus it took clueless over an hour to come up with adding a comma after each value.

  • ubersoldat (cs)

    Nothing better than a junior with superiority complex. You know what kid? Keep doing things right, you won't escalate the business ladder.

    BTW, this WTF would have been better if there were more examples of senior stupidity.

  • trwtf (unregistered)

    Wow, that's almost as retarded as Bob's son. If he can't even figure that much out, how the hell does he turn on his computer in the morning?

  • Drew (unregistered)

    Couldn't you just instanciate an array with the rs.size() and put them in without having to deal with a list?

    String[] toBeReturned = new String[rs.size()]; for (int i = 0; rs.next(); i++) { toBeReturned[i] = rs.getString("email"); }

  • ochrist (cs) in reply to EmperorOfCanada
    EmperorOfCanada:
    I am repeatedly shocked by the number of programmers who can't program. I once tried to explain Associative arrays to two programmers who had graduated from Waterloo. I used every synonym and semi synonym that I could come up with: Key value pairs, hashes, thing where you put in a string and it stores and retrieves a value, etc. They both sat there and looked at me blankly. So then I had to give a tutorial on the whole concept with them leaving the meeting thinking that I had made my code unnecessarily complex and could have just used a bunch of arrays and sorted/searched through them. But my favorite programmers are the one tool programmers; especially if the tool is obscure such as the Natural language or Adabas.

    Hey, that's not obscure. I'm working with Natural and Adabas right now :-)

  • No brain access (unregistered) in reply to EmperorOfCanada
    EmperorOfCanada:
    I am repeatedly shocked by the number of programmers who can't program. I once tried to explain Associative arrays to two programmers who had graduated from Waterloo. I used every synonym and semi synonym that I could come up with: Key value pairs, hashes, thing where you put in a string and it stores and retrieves a value, etc. They both sat there and looked at me blankly. So then I had to give a tutorial on the whole concept with them leaving the meeting thinking that I had made my code unnecessarily complex and could have just used a bunch of arrays and sorted/searched through them. But my favorite programmers are the one tool programmers; especially if the tool is obscure such as the Natural language or Adabas.

    You missed Dictionary, and if they did a mess load of Java courses HashMap might have clued them in. Do you remember the problem? About the only thing I could think of that makes any sense (from their perspective) is if you had to implement a hashmap yourself on an embedded system, in which case the sorted arrays might just make more sense... even then only if the keys where used to iterate or hold some related string information and not really for random access.

    Waterloo actually has a pretty good reputation. I didn't go there, but worked with many of them on my last CO-OP which was at a big tech company in that city. A good reputation in CS tends to mean that only 70% of the grads are hopeless instead of the normal 80%, so I guess it isn't all that surprising.

  • Warren (unregistered)

    I can shortcut the entire comments thread:

    brainless first-posts people who haven't got the joke or feel sorry for the wtf-creator people calling shenanigans people who insist upon slightly different solutions people who argue about the slightly different solutions people who say it would all be easier in another language / OS / etc.

  • itsmo (unregistered) in reply to Warren
    Warren:
    I can shortcut the entire comments thread:

    brainless first-posts people who haven't got the joke or feel sorry for the wtf-creator people calling shenanigans people who insist upon slightly different solutions people who argue about the slightly different solutions people who say it would all be easier in another language / OS / etc.

    You forgot people who comment on the comments.

  • Migala (unregistered) in reply to Warren
    Warren:
    I can shortcut the entire comments thread:

    brainless first-posts people who haven't got the joke or feel sorry for the wtf-creator people calling shenanigans people who insist upon slightly different solutions people who argue about the slightly different solutions people who say it would all be easier in another language / OS / etc.

    Hi. Welcome to TheDailyWTF!

  • Sad (unregistered)

    It just makes me sad ... And people DO think you rock at programming because you can actually think about a solution involving arrays. Just imagine speaking about LINQ (in a .Net environnement that is).

    Captcha : "haero" yeah, he needs one ...

  • dadasd (unregistered) in reply to Warren
    Warren:
    I can shortcut the entire comments thread:

    brainless first-posts people who haven't got the joke or feel sorry for the wtf-creator people calling shenanigans people who insist upon slightly different solutions people who argue about the slightly different solutions people who say it would all be easier in another language / OS / etc.

    You're new here, aren't you.

  • Nick (unregistered)

    am i missing something, shouldn't the code be:

    while(rs.Next()){ //code here }

    or it will only print one thing?

  • nico (unregistered) in reply to itsmo

    and people who never ever comment

    woops

  • frits (cs) in reply to MrBester
    MrBester:
    I call shenanigans. Everybody has heard of Split.

    That, plus it took clueless over an hour to come up with adding a comma after each value.

    Your sarcasm is so subtle, it's like it's not even there.

  • Nagesh (cs)
    public class StringSplit {
      public static void main(String args[]) throws Exception{
        String testString = "Real-How-To";
        System.out.println(
            java.util.Arrays.toString(
            testString.split("-")
        ));
    
        // output : [Real, How, To]
        }
    }
    

    mroot really needs to attend one short course in java. java is most user friendly REAL PROGRAMMING language. of course everyone think VB6 is most user friendly but keep in mind I use term "REAL" here. there are sevreal java course available online. i think he can contact me if he cannot google.

  • tehR (cs) in reply to Derp
    Derp:
    It just dawned on me that the only things that make these "WTFs" is the level of impatience or frustration the "victim" gains in each story.

    Most of us can probably laugh and live with little derpy moments like this.

    Apparently, though, folks like jbanic need to "regain their cool" frist. Maybe the short fuse is the difference between a good job and a bad one.

    Agreed. From a technical perspective nothing in the supplied code was particularly WTFy. Story reduces to a guy who has existing code but wants it to do a bit more, yet doesn't know right off the bat (the horror!) how to get it done.

    Junior dbag, in his infinite wisdom, feels time spent helping a colleague learn something new is an absolute waste of his own life and so has to sign off of AIM in order to cool off and a void a heart attack.

    Classy.

  • Anom (unregistered) in reply to MrBester
    MrBester:
    I call shenanigans. Everybody has heard of Split.

    That, plus it took clueless over an hour to come up with adding a comma after each value.

    I second this.

    Captcha : eros ( I and thought thedailywtf.com was work safe )

  • boog (unregistered) in reply to nopanic
    nopanic:
    Derp:
    Apparently, though, folks like jbanic need to "regain their cool" frist. Maybe the short fuse is the difference between a good job and a bad one.
    The short fuse can very well also be the difference between a junior anything and a more seasoned one. The seasoned ones tend to not take things so seriously.
    I'm pretty sure I would have strangled someone and got thrown in prison before I became a seasoned developer.
  • gallier2 (unregistered)

    The WTF is probably that he wants to split the string to find a specific one when he could have used an appropriate WHERE clause in his SQL request.

  • Bert Glanstron (unregistered) in reply to frits
    frits:
    MrBester:
    I call shenanigans. Everybody has heard of Split.

    That, plus it took clueless over an hour to come up with adding a comma after each value.

    Your sarcasm is so subtle, it's like it's not even there.

    You are an idiot and should be banned from using your mommy and daddy's modem.
  • Nagesh (cs) in reply to Bert Glanstron
    Bert Glanstron:
    frits:
    MrBester:
    I call shenanigans. Everybody has heard of Split.

    That, plus it took clueless over an hour to come up with adding a comma after each value.

    Your sarcasm is so subtle, it's like it's not even there.

    You are an idiot and should be banned from using your mommy and daddy's modem.

    Dear Bert, Please become more entertaining for evreyone's sake.

    Thx In Advanace, Nagesh.

  • Boris Vladamir (unregistered) in reply to Nagesh
    Nagesh:
    public class StringSplit {
      public static void main(String args[]) throws Exception{
        String testString = "Real-How-To";
        System.out.println(
            java.util.Arrays.toString(
            testString.split("-")
        ));
    
    // output : [Real, How, To]
    }
    

    }

    mroot really needs to attend one short course in java. java is most user friendly REAL PROGRAMMING language. of course everyone think VB6 is most user friendly but keep in mind I use term "REAL" here. there are sevreal java course available online. i think he can contact me if he cannot google.

    Ha ha! It is funny to see brown one trying to imitate troll!
  • zedhex (unregistered)

    so you work with amateurs. Big deal.

  • anon (unregistered) in reply to Warren
    Warren:
    I can shortcut the entire comments thread:

    brainless first-posts people who haven't got the joke or feel sorry for the wtf-creator people calling shenanigans people who insist upon slightly different solutions people who argue about the slightly different solutions people who say it would all be easier in another language / OS / etc.

    You missed about 80% of posts: an argument between Nagesh and 3 or 4 people who somehow can't spot the worlds most obvious troll.

  • The Corrector (unregistered) in reply to Nagesh
    Nagesh:
    Bert Glanstron:
    frits:
    MrBester:
    I call shenanigans. Everybody has heard of Split.

    That, plus it took clueless over an hour to come up with adding a comma after each value.

    Your sarcasm is so subtle, it's like it's not even there.

    You are an idiot and should be banned from using your mommy and daddy's modem.

    Dear Bert, Please become more entertprisey for evreyone's sake.

    Thx In Advanace, Nagesh.

    FTFY

  • Nagesh (cs) in reply to Boris Vladamir
    Boris Vladamir:
    Nagesh:
    public class StringSplit {
      public static void main(String args[]) throws Exception{
        String testString = "Real-How-To";
        System.out.println(
            java.util.Arrays.toString(
            testString.split("-")
        ));
    
    // output : [Real, How, To]
    }
    

    }

    mroot really needs to attend one short course in java. java is most user friendly REAL PROGRAMMING language. of course everyone think VB6 is most user friendly but keep in mind I use term "REAL" here. there are sevreal java course available online. i think he can contact me if he cannot google.

    Ha ha! It is funny to see brown one trying to imitate troll!

    madarchod!!!

  • Haero (unregistered)
           PreparedStatement ps  = connection.prepareStatement("SELECT * FROM email_contact");
           ResultSet rs = ps.executeQuery();
           if (rs.next()) {
                String email = rs.getString("email");
                System.out.print(email+"\n");
           }
    

    I like this one better, many interfaces can already grab this as an array.

    Captcha UXOR = short for Unix-Administrator

  • The Real Corrector (unregistered) in reply to The Corrector
    The Corrector:
    Nagesh:
    Bert Glanstron:
    frits:
    MrBester:
    I call shenanigans. Everybody has heard of Split.

    That, plus it took clueless over an hour to come up with adding a comma after each value.

    Your sarcasm is so subtle, it's like it's not even there.

    You are an idiot and should be banned from using your mommy and daddy's modem.

    Dear Bert, In case you haven't noticed, this is thedailywtf.com. The fact that you insist on using your ridiculous trolling, clearly shows that you are to young and too stupid to be posting on thedailywtf.com.

    Go away and become more entertprisey.

    Sincerely, Nagesh.

    FTFY
    No, FTFY

  • Boris Vladamir (unregistered) in reply to Nagesh
    Nagesh:
    Bert Glanstron:
    frits:
    MrBester:
    I call shenanigans. Everybody has heard of Split.

    That, plus it took clueless over an hour to come up with adding a comma after each value.

    Your sarcasm is so subtle, it's like it's not even there.

    You are an idiot and should be banned from using your mommy and daddy's modem.

    Dear Bert, Please become more entertaining for evreyone's sake.

    Thx In Advanace, Nagesh.

    You are more transparent than best Vodka.

  • shortcut for the shortcut (unregistered) in reply to Drew
    Drew:
    Couldn't you just instanciate an array with the rs.size() and put them in without having to deal with a list?

    String[] toBeReturned = new String[rs.size()]; for (int i = 0; rs.next(); i++) { toBeReturned[i] = rs.getString("email"); }

    yeah, that's what i would have done. The list approach seems like a bit of a detour actually, not a shortcut

  • Category (a) (unregistered) in reply to dadasd
    dadasd:
    Warren:
    I can shortcut the entire comments thread:

    brainless first-posts people who haven't got the joke or feel sorry for the wtf-creator people calling shenanigans people who insist upon slightly different solutions people who argue about the slightly different solutions people who say it would all be easier in another language / OS / etc.

    Your new here, aren't you.

    FTFY

  • Patrek (unregistered) in reply to MrBester

    From the code I've seen, nope, not everyone has heard of split!

  • Nagesh (cs)

    What would you know of best vodka, drinker of horse-piss?

  • Nickster (unregistered)
    From a technical perspective nothing in the supplied code was particularly WTFy. Story reduces to a guy who has existing code but wants it to do a bit more, yet doesn't know right off the bat (the horror!) how to get it done.

    The WTF is why is he asking how to parse a string into an array when he's the one creating the string. You don't need to parse something that's basically already parsed!

  • Anonymous (unregistered) in reply to Nagesh
    Nagesh:
    public class StringSplit {
      public static void main(String args[]) throws Exception{
        String testString = "Real-How-To";
        System.out.println(
            java.util.Arrays.toString(
            testString.split("-")
        ));
    
    // output : [Real, How, To]
    }
    

    }

    mroot really needs to attend one short course in java. java is most user friendly REAL PROGRAMMING language. of course everyone think VB6 is most user friendly but keep in mind I use term "REAL" here. there are sevreal java course available online. i think he can contact me if he cannot google.

    What the hell... oh, hi Nagesh. How's the cow worshipping going today?
  • jdw (unregistered) in reply to Migala
    Comment held for moderation.
  • C-Octothorpe (unregistered) in reply to Nagesh
    Nagesh:
    What would you know of best vodka, drinker of horse-piss?

    HA!

  • ca1977a (cs) in reply to Gary
    Gary:
    Sorrybutyou'llneedtoseparatethewordsinthecommentsprogrammatically.

    Andwaitaminute.mrootisatotalidiotbutknowshowtousethisloopconstruct?

    if (rs.next()) {}
    

    Copy-pasWorks every time.te code.

  • unregistered person (unregistered) in reply to Nagesh

    Sure, Java's a "most user friendly REAL PROGRAMMING language" compared to... say... Python?

    Same code:

        print "Real-how-to".split('-')

Leave a comment on “The Shortcut Guy”

Log In or post as a guest

Replying to comment #:

« Return to Article