• (cs)

    "firstSpaceLastName" is both funny and accurately descriptive. Kudos Rumen!

  • (cs)

    Hey, at least he's using stored procs!

  • JamieC (unregistered)

    Shouldnt this have been CodeSOD. Its a bit light for a Featured, non?

    __ Ed: Indeed it is -- Fixed!

  • nulla (unregistered)

    I bet the guy who wrote this had a college degree.

  • (cs)

    I don't have a first name, a space, and a last name. All I have is a last name, a comma, a space, and a first name.

    Should I call GetLoginByLastNameCommaSpaceFirstName() instead?

  • Sock Puppet 5 (unregistered) in reply to nulla
    nulla:
    I bet the guy who wrote this had a college degree.
    You moron, no one who actually attended a college for 4 years could write something this hideos.
  • Bryan the K (unregistered)

    Good thing people rarely name their son Jr these days, right?

  • (cs) in reply to boog
    boog:
    I don't have a first name, a space, and a last name. All I have is a last name, a comma, a space, and a first name.

    Should I call GetLoginByLastNameCommaSpaceFirstName() instead?

    No stupid! You have split it into a two value string array and string.join that bee-hotch back into GetLoginByFirstAndLastName(). Haven't you ever programmed before?

    Oh, and don't do any bounds checking or anything like that either...

  • Rumen (unregistered)

    Oh come on, my code ain't that bad, is it?

  • (cs) in reply to Rumen
    Rumen:
    Oh come on, my code ain't that bad, is it?

    No, it's perfect! In fact, without code like this, the visitors to this site might actually have to work.

  • dr memals (unregistered)

    why is the DB call made twice ?

  • (cs)

    Rumen is just making sure sure the user is really authorized: Twice the security!

  • JamieC (unregistered) in reply to dr memals
    dr memals:
    why is the DB call made twice ?

    You're new here, right?

  • jdw (unregistered) in reply to dr memals
    dr memals:
    why is the DB call made twice ?
    TRWTF is Dr. Memals.
  • Justin (unregistered) in reply to JamieC
    JamieC:
    dr memals:
    why is the DB call made twice ?

    You're new here, right?

    Four words made my day. Well, those four plus the seven that provoked them...

    Eleven words made my day.

  • (cs) in reply to Coyne
    Coyne:
    Rumen is just making sure sure the user is really authorized: Twice the security!
    You're going to need the added security, since there's no password involved here.
  • (cs) in reply to Sock Puppet 5
    Sock Puppet 5:
    nulla:
    I bet the guy who wrote this had a college degree.
    You moron, no one who actually attended a college for 4 years could write something this hideos.
    Wow. I hate to steal other people's lines, but ... You're new here, right?
  • Misho (unregistered) in reply to Coyne

    I know it is a bit confusing but "login" is actually the username. It does not log the user so it is not a security issue. It is used for search for a user when sending a message and similar activities.

  • (cs) in reply to Coyne
    Coyne:
    Rumen is just making sure sure the user is really authorized: Twice the security!

    Two factor authentication!

    Something you know: your name, and something you are: uh, your name...

    Right?

  • Robb (unregistered) in reply to Sock Puppet 5
    Sock Puppet 5:
    nulla:
    I bet the guy who wrote this had a college degree.
    You moron, no one who actually attended a college for 4 years could write something this hideos.

    Government Contractors!

    There I said it.

  • (cs) in reply to dr memals
    dr memals:
    why is the DB call made twice ?
    The second DB call is made just in case the login attached to that first and last name changes immediately after the first DB call.
  • (cs) in reply to boog
    boog:
    The second DB call is made just in case the login attached to that first and last name changes immediately after the first DB call.
    That's why you put a write lock on the user before calling the procedure!
  • (cs) in reply to Nook Schreier
    Nook Schreier:
    boog:
    The second DB call is made just in case the login attached to that first and last name changes immediately after the first DB call.
    That's why you put a write lock on the user before calling the procedure!
    Right, and this code isn't doing that. That's TRWTF!
  • DeGustibusNonDisputandumEst (unregistered) in reply to boog
    boog:
    dr memals:
    why is the DB call made twice ?
    The second DB call is made just in case the login attached to that first and last name changes immediately after the first DB call.

    //Ask Rumen

  • airdrik (unregistered) in reply to dr memals
    dr memals:
    why is the DB call made twice ?
    Once to make sure that the value is there (and trigger any exceptions that there may be from calling the SP) and once to get the actual value as a string so that it can be returned. After all, the purpose of variables is not so that you can reuse the results of complex and/or time-consuming operations. In fact, TRWTF is using a variable at all. It should have been something like:
    public string GetLoginByFirstAndLastName(string firstSpaceLastName) {
        if (this.ExecuteScalar(
            "sp_user_login_by_first_space_last_name", 
            firstSpaceLastName) != null)
        {
            return this.ExecuteScalar(
                "sp_user_login_by_first_space_last_name", 
                firstSpaceLastName)
              .ToString();
        }
        return "";
    }
    

    No variables means no errors, right?

  • (cs) in reply to C-Octothorpe
    C-Octothorpe:
    Hey, at least he's using stored procs!
    I kind of want to see the code in the stored procedure now.

    Wait, I take that back. I don't ever want to see that.

  • (cs) in reply to SCSimmons
    SCSimmons:
    C-Octothorpe:
    Hey, at least he's using stored procs!
    I kind of want to see the code in the stored procedure now.

    Wait, I take that back. I don't ever want to see that.

    Just remember: what has been seen cannot be unseen...

  • Justice League (unregistered) in reply to Sock Puppet 5
    Sock Puppet 5:
    nulla:
    I bet the guy who wrote this had a college degree.
    You moron, no one who actually attended a college for 4 years could write something this hideos.
    I think I might have a universal solution to all three of the problems:

    Problem 1: Degree vs. No Degree Problem 2: There are no women in IT Problem 3: I think these arguments are all about trolling.

    Universal Solution: People that play with computers and haunt these forums are universally immature. I can not tell you why this is the case, but I can tell you how it has caused the above problems.

    Problem 1: Degree vs. No Degree Most of the kids I went to school with had no respect for what they were learning and thus did as little as possible. The most clever of them went on to do work that required their degree--video games (as unfortunate and under-compensated as work in that field is), the FSA, and other academic disciplines. The ones who thought they were clever and spent time giggling, enamored with their own intelligence, discussing minutia with colleagues, doomed themselves to careers in business software--that which requires very few reasoning skills: just follow the patterns that have always been in place. Those who don't follow the patterns create the epic VB and J2EE WTFs that cross my eyes and are far more idiotic than anything I've seen displayed here. Immaturity kept them from REAL education, and they are several thousand dollars poorer, gaining no skills whatsoever.

    Problem 2: No women in IT Women ARE (obviously in general) more mature--eager to learn and to please the ones in authority over them. They will generally go the college path of the career. Then they encounter the immaturity of their colleagues and generally choose a different brainy discipline. Those that persist are generally the stand-offish ones. In college, the good-looking ones are worshiped (but never talked to, immaturity remember) or ignored. In both cases, the 5th-grade maturity level divides the sexes. The few that "make it" to the working world are typically very hostile from their experience. They are then seen as "overly-defensive" and avoided.

    Problem 3: Most of the folks in the above categories have too much time on their hands and spend their time trolling these forums. I am one of the damned. I was good in school. I was also immature. Now I'm stuck in b*$%ness software. But I pass the time (generally logged in as Nagesh or boog) by chumping all of you knuckleheads.

    This is my confession. This is my future.

  • JamieC (unregistered) in reply to Justice League
    Justice League:
    Sock Puppet 5:
    nulla:
    I bet the guy who wrote this had a college degree.
    You moron, no one who actually attended a college for 4 years could write something this hideos.
    I think I might have a universal solution to all three of the problems:

    Problem 1: Degree vs. No Degree Problem 2: There are no women in IT Problem 3: I think these arguments are all about trolling.

    /.. snip ../

    I think im in love.

  • (cs) in reply to JamieC
    JamieC:
    Justice League:
    Sock Puppet 5:
    nulla:
    I bet the guy who wrote this had a college degree.
    You moron, no one who actually attended a college for 4 years could write something this hideos.
    I think I might have a universal solution to all three of the problems:

    Problem 1: Degree vs. No Degree Problem 2: There are no women in IT Problem 3: I think these arguments are all about trolling.

    /.. snip ../

    I think im in love.

    I think I just threw up a little in my mouth...

  • JasonC (unregistered) in reply to Justice League
    Justice League:
    Sock Puppet 5:
    nulla:
    I bet the guy who wrote this had a college degree.
    You moron, no one who actually attended a college for 4 years could write something this hideos.
    I think I might have a universal solution to all three of the problems:

    Problem 1: Degree vs. No Degree Problem 2: There are no women in IT Problem 3: I think these arguments are all about trolling.

    /.. snip ../

    Where's the solution? Amidst all that text, I see no actual solution.

  • just me (unregistered) in reply to Justice League
    Justice League:
    ...the epic VB and J2EE WTFs that cross my eyes and are far more idiotic than anything I've seen displayed here...
    CodeSODs or it didn't happen!
  • (cs) in reply to Sock Puppet 5
    Sock Puppet 5:
    nulla:
    I bet the guy who wrote this had a college degree.
    You moron, no one who actually attended a college for 4 years could write something this hideos.

    Or use a spellchecker.

  • (cs) in reply to Justice League
    Justice League:
    Sock Puppet 5:
    nulla:
    I bet the guy who wrote this had a college degree.
    You moron, no one who actually attended a college for 4 years could write something this hideos.
    I think I might have a universal solution to all three of the problems:

    Problem 1: Degree vs. No Degree Problem 2: There are no women in IT Problem 3: I think these arguments are all about trolling.

    Universal Solution: People that play with computers and haunt these forums are universally immature. I can not tell you why this is the case, but I can tell you how it has caused the above problems.

    A couple of issues with this argument...

    1. There are those of us who ended up in business software not because we are immature, or stupid, but because we are simply too nonchalant to really care about money or ambition. Think April Ludgate on Parks and Recreation.

    2. You don't think part of the reason there are so few women in IT has something to do with the fact that 90% of CS students are men? I had entire classes in college where there were no more than two or three girls, out of about fifty total students.

  • Unregistered (unregistered) in reply to JamesQMurphy
    JamesQMurphy:
    Sock Puppet 5:
    nulla:
    I bet the guy who wrote this had a college degree.
    You moron, no one who actually attended a college for 4 years could write something this hideos.

    Or use a spellchecker.

    No, no it's a shoutout to Hideo Kojima.

  • Justice League (unregistered) in reply to ShatteredArm
    ShatteredArm:
    Justice League:
    Sock Puppet 5:
    nulla:
    I bet the guy who wrote this had a college degree.
    You moron, no one who actually attended a college for 4 years could write something this hideos.
    I think I might have a universal solution to all three of the problems:

    Problem 1: Degree vs. No Degree Problem 2: There are no women in IT Problem 3: I think these arguments are all about trolling.

    Universal Solution: People that play with computers and haunt these forums are universally immature. I can not tell you why this is the case, but I can tell you how it has caused the above problems.

    A couple of issues with this argument...

    1. There are those of us who ended up in business software not because we are immature, or stupid, but because we are simply too nonchalant to really care about money or ambition. Think April Ludgate on Parks and Recreation.

    2. You don't think part of the reason there are so few women in IT has something to do with the fact that 90% of CS students are men? I had entire classes in college where there were no more than two or three girls, out of about fifty total students.

    Lern 2 reed!

    Justice League:
    they encounter the immaturity of their colleagues and generally choose a different brainy discipline

    This also addresses a previous comment about how there are more female engineers than software engineers.

  • Vlad Poutines (unregistered) in reply to Justice League
    Justice League:
    This is my confession. This is my future.
    That you're a virgin?
  • (cs) in reply to Vlad Poutines
    Vlad Poutines:
    Justice League:
    This is my confession. This is my future.
    That you're a virgin?

    ... and this is about when I close my tab to TDWTF for the day...

  • somechick (unregistered) in reply to ShatteredArm

    [quote=ShatteredArm]2) You don't think part of the reason there are so few women in IT has something to do with the fact that 90% of CS students are men? I had entire classes in college where there were no more than two or three girls, out of about fifty total students.[/quote]

    As a female in IT, I think part of the reason there aren't more women in IT is the boys' club attitude. There's a certain level of arrogance in this field that is intimidating (or at the very least a turn-off) to most women. As the oldest (of 5) and the only girl in my generation, it doesn't bother me, and I can generally see through the big attitude to the actual technical aptitude of someone.

    I currently deal with a tech support guy who thinks he's god's gift to bits, and treats everyone else like a 3-year-old. (It's not just me. I was paranoid there for a while, until he was on the phone with a manager in my organization and told him "Uh, no. Wrong Answer." in the way you would correct someone adding 2 and 2 to get 7.) But the product is ... well, let's just say that the backend wouldn't have passed an exercise in a DBA for beginners class, and the web front-end wouldn't pass for looks in any evaluation of HTML today. To the point where I've considered how to anonymize it for a WTF. This guy knows his product, but doesn't know how broken it is, and doesn't understand that say, we'd want to be able to report on the tickets that we put into the system.

    One of the other reasons I don't think there are a lot of women is because they just aren't as interested in taking things apart and learning how they work as men are. I don't know if it's learned behavior. All I know is I got the "make 100 things from this breadboard and wire" kits as a kid, and enjoyed them. Then again, I always liked my math and science classes, and I loved the first-order logic class that I took my 2nd time around in college, but my brain only goes up to Calc II, as I failed Calc III twice before giving up a 2nd time on formal education, and I would have needed another three math classes for a CS degree. 15 years later, I don't see the need for a degree to continue in the field I've chosen, and I have test anxiety that makes it difficult to get certifications -- but I'm employed, and I enjoy what I do.

  • Limish (unregistered) in reply to C-Octothorpe
    C-Octothorpe:
    Vlad Poutines:
    Justice League:
    This is my confession. This is my future.
    That you're a virgin?

    ... and this is about when I close my tab to TDWTF for the day...

    You have a tab? You must be a regular customer.

  • somedude (unregistered) in reply to somechick

    You enjoy screwing up the quote system?

  • (cs) in reply to Justice League
    Justice League:
    ShatteredArm:
    Justice League:
    I think I might have a universal solution to all three of the problems:

    Problem 1: Degree vs. No Degree Problem 2: There are no women in IT Problem 3: I think these arguments are all about trolling.

    Universal Solution: People that play with computers and haunt these forums are universally immature. I can not tell you why this is the case, but I can tell you how it has caused the above problems.

    A couple of issues with this argument...

    1. There are those of us who ended up in business software not because we are immature, or stupid, but because we are simply too nonchalant to really care about money or ambition. Think April Ludgate on Parks and Recreation.

    2. You don't think part of the reason there are so few women in IT has something to do with the fact that 90% of CS students are men? I had entire classes in college where there were no more than two or three girls, out of about fifty total students.

    Lern 2 reed!

    Justice League:
    they encounter the immaturity of their colleagues and generally choose a different brainy discipline

    This also addresses a previous comment about how there are more female engineers than software engineers.

    YHBT. YHL. HAND.

  • (cs)

    So, wait, this code was written by a cow's stomach?

  • (cs) in reply to Justice League
    Justice League:
    ...I pass the time (generally logged in as Nagesh or boog)...
    That's highly unlikely.

    No sane person would openly admit to logging in as either of those guys.

  • Rumen's Boss (unregistered)

    I'm so happy that my cousin Rumen has his good codes recognized on this site not once but twice for outstanding code. Everyone should follow his example on how to write great code!

  • (cs) in reply to Rumen's Boss
    Rumen's Boss:
    I'm so happy that my cousin Rumen has his good codes recognized on this site not once but twice for outstanding code. Everyone should follow his example on how to write great code!

    Yeah, not too bad for a CS graduate, eh?

  • Meep (unregistered) in reply to dr memals
    dr memals:
    why is the DB call made twice ?

    Doesn't matter if it is. A smart API would memoize redundant DB calls.

  • (cs) in reply to boog
    boog:
    Justice League:
    ...I pass the time (generally logged in as Nagesh or boog)...
    That's highly unlikely.

    No sane person would openly admit to logging in as either of those guys.

    I see what you did there.

  • Ganesh (unregistered) in reply to PedanticCurmudgeon
    PedanticCurmudgeon:
    boog:
    Justice League:
    ...I pass the time (generally logged in as Nagesh or boog)...
    That's highly unlikely.

    No sane person would openly admit to logging in as either of those guys.

    I see what you did there.
    Leave booger alone to talk to sock pupets.

  • Somebody (unregistered) in reply to frits

    I have been fielding calls all day.

    Bobby Jo Stuart and Tim Van Der Hoot can not access their login. PLEASE HELP!

    CAPTCHA: NISL what!

Leave a comment on “Ask Rumen Again”

Log In or post as a guest

Replying to comment #:

« Return to Article