• Nagesh (unregistered)

    Technical screenings not being necesary when to review list of certifications.

  • sigh... (unregistered) in reply to pouzzler
    pouzzler:
    Steve The Cynic:
    I'm sure that Alex and his crew would love *us* to submit more clever, fun pieces...

    We don't need a piece a day if it means having the rants from disgruntled ex-workers, rather than gems. Do you? I sure don't.

    Rants must be released continually. Pent up rants result in horrid explosions. Keep the internet safer and continue giving us an article every day - even when we don't provide any new gems.

  • (cs) in reply to You're Boss
    You're Boss:
    Rudolf:
    Andrew:
    Judith being concerned about the woman getting married is hardly a WTF. A key developer going on leave for a year has the potential to destroy a project's viability.

    Whether it sets off your PC sensitivities or not, the fact of the matter is that young, fertile women are much riskier hires than young, fertile men. Judith was just being brutally honest.

    The real WTF is that due to PC oversensitivity, you're not even allowed to ask the question. In my view it's perfectly legitimate for an employer to ask 'are you planning on having kids soon?' (both to men and women), just as you can ask 'do you have any holidays already booked?'

    (Hopefully the employee will realise that them taking 6-12 months leave will be inconvenient to the employer. If they don't care, then that shows something about the employee's attitude).

    But, because you can't ask, it just means that ALL young women are 'silently' discriminated against - even if they have no intention of having kids, or even can't.

    The discrimination may not be as overt as Judith's, but it is there.

    There's an easy way to fix problems like this. Just pay women less in direct proportion to the statistical risk.

    Only responding because I'm paranoid and think one of you might be serious...

    How about instead mandating equal amounts of "new child" leave for both males and females? Yeah I fully recognize that a lot of employee "rights" will only be instated if either another round of bloody union battles (here in the USA) takes place or-- pipe dream -- our duly bribed Congresscritters get a sudden attack of moral reality and pass a bunch of employee-protection laws.

  • anonymous (unregistered) in reply to You're Boss
    You're Boss:
    Rudolf:
    Andrew:
    Judith being concerned about the woman getting married is hardly a WTF. A key developer going on leave for a year has the potential to destroy a project's viability.

    Whether it sets off your PC sensitivities or not, the fact of the matter is that young, fertile women are much riskier hires than young, fertile men. Judith was just being brutally honest.

    The real WTF is that due to PC oversensitivity, you're not even allowed to ask the question. In my view it's perfectly legitimate for an employer to ask 'are you planning on having kids soon?' (both to men and women), just as you can ask 'do you have any holidays already booked?'

    (Hopefully the employee will realise that them taking 6-12 months leave will be inconvenient to the employer. If they don't care, then that shows something about the employee's attitude).

    But, because you can't ask, it just means that ALL young women are 'silently' discriminated against - even if they have no intention of having kids, or even can't.

    The discrimination may not be as overt as Judith's, but it is there.

    There's an easy way to fix problems like this. Just pay women less in direct proportion to the statistical risk.

    How is that easier than just not hiring them? They should be at home minding the kitchen and popping out babies anyway, right?

  • You're Boss (unregistered) in reply to cellocgw
    cellocgw:
    You're Boss:
    Rudolf:
    Andrew:
    Judith being concerned about the woman getting married is hardly a WTF. A key developer going on leave for a year has the potential to destroy a project's viability.

    Whether it sets off your PC sensitivities or not, the fact of the matter is that young, fertile women are much riskier hires than young, fertile men. Judith was just being brutally honest.

    The real WTF is that due to PC oversensitivity, you're not even allowed to ask the question. In my view it's perfectly legitimate for an employer to ask 'are you planning on having kids soon?' (both to men and women), just as you can ask 'do you have any holidays already booked?'

    (Hopefully the employee will realise that them taking 6-12 months leave will be inconvenient to the employer. If they don't care, then that shows something about the employee's attitude).

    But, because you can't ask, it just means that ALL young women are 'silently' discriminated against - even if they have no intention of having kids, or even can't.

    The discrimination may not be as overt as Judith's, but it is there.

    There's an easy way to fix problems like this. Just pay women less in direct proportion to the statistical risk.

    Only responding because I'm paranoid and think one of you might be serious...

    How about instead mandating equal amounts of "new child" leave for both males and females? Yeah I fully recognize that a lot of employee "rights" will only be instated if either another round of bloody union battles (here in the USA) takes place or-- pipe dream -- our duly bribed Congresscritters get a sudden attack of moral reality and pass a bunch of employee-protection laws.

    Well, a lot of time the women do not come back after leave...they just leave. And we're not allowed to ask about that either. So I see the risk of them having a child as equivalent to that of having to hire a permanent replacement anyway.
  • You're Boss (unregistered) in reply to anonymous
    anonymous:
    You're Boss:
    Just pay women less in direct proportion to the statistical risk.
    How is that easier than just not hiring them?
    You may find a woman that is more talented and qualified than any males you interview.
  • F (unregistered) in reply to Kabi
    Kabi:
    ...

    Such easy questions are needed because dummies can't answer them. In fact, they should be asked because around 90% of CompSci graduates are not able to answer them. There are enough blog posts in the web that state the same. Just search for "Fizzbuzz" or "Why can't programmers program".

    Fizzbuzz? I thought it was Buzzfizz.

    Damn, that must be why ...

  • Ol' Bob (unregistered) in reply to pouzzler
    pouzzler:
    The fact that a stupid manager works in IT doesn't make their quirks "curious perversions in Information Technology", but "normal perversions in Management Thinking".

    How many times must various commenters repeat this before you bring in only the clever, fun pieces, rather the rants about stupid bosse?

    Huh? I think the clever, fun pieces are the ones about the stupid bosses.

    :-)

    CAPTCHA: capio - rejecting the boss's soon-to-be stud puppet ain't gonna be a feather in your capio!

  • Ol' Bob (unregistered) in reply to DQ
    DQ:
    So she wants a young (and attractive) male so she can hook him, get married, get pregnant and have her first child so she can ask to work parttime?

    (blink-blink) Oh, they can't get married - she'd never hire herself!

    CAPTCHA: delenit : go down the aisle and you'll be delenit!

  • Lerch 98 (unregistered) in reply to You're Boss

    Hire MILFs. They're hot. They work. They already had kids and don't want more. They show up every day. They know how to dress (skirts and demin).

    Maybe Judith was a Cougar and was just looking to shag a cub.

  • Ol' Bob (unregistered) in reply to Melnorme
    Melnorme:
    Women hate hiring other women, news at 11.

    Managers hate hiring competent subordinates. Film at 11.

    CAPTCHA: praesent - I'm gonna go out and hire me a little praesent.

  • Ol' Bob (unregistered) in reply to QJo
    QJo:
    TRWTF is why Judith has not been dismissed from her position for breaking every single possible anti-discrimination law in the book. Or is TRWTF that Chris didn't act as the dessperately-needed whistleblower?

    Manager's word against his. He'd lose.

    CAPTCHA: genitus - don't take no genitus to figger that'n out.

  • funjon (unregistered) in reply to John Appleseed

    #include <stdio.h> #include <limits.h>

    void refoveo() { unsigned long long val = ULLONG_MAX; while (val) { printf("%llu\n",val--); } }

    int main (int argc, const char* argv[]) { refoveo(); return 0; }

    Sadly, the only thing I had to look up was ULLONG_MAX because I'd forgotten which macro that was.

    People really can't do this? Wuh?

    (CAPTCHA: refoveo)

  • Ol' Bob (unregistered) in reply to Moo Cow
    Moo Cow:
    QJo:
    TRWTF is why Judith has not been dismissed from her position for breaking every single possible anti-discrimination law in the book. Or is TRWTF that Chris didn't act as the dessperately-needed whistleblower?
    That's not even whistleblowing. We're talking about informing her supervisor that she is creating potential, expensive legal trouble for the company. That should get them listening.

    Bu-wah-ha-ha-ha-ha-ha-ha-ha-ha-ha-ha-ha-ha!!!

    Oh, god...(sniffle-giggle)...that was funny... :-)

    CAPTCHA - jumentum : Did jumentum what you said-um?

  • BlastYoBoots (unregistered) in reply to anonymous

    My father -- who (coincidentally) happens to be a statistician who acts as an expert witness in discrimination cases, on either side -- once had the pleasure of being told that he was too old for an opening he was applying for and that they were looking for fresher blood / younger candidates, VIA EMAIL.

    When he submitted the email evidence to the authorities, they did a double-take. Could hardly believe anyone could have been so stupid. :)

  • Calli Arcale (unregistered)

    Okay, for the edification of the likely European folks complaining about how terrible it is to hire a woman who then takes 6-12 months off, this story probably takes place in the US. US practices pertaining to parental leave are very different. The expectation here is that you will return to work as soon as you are physically able to.

    In the US, taking 6-12 months off is generally career suicide. The law requires that employers provide 12 weeks, and it is rare for mothers to take more than half of that. It is typically unpaid for fathers and adoptive mothers; for birth mothers, paid leave is not guaranteed, but those companies which do offer it consider it short term disability. That is, it's treated the same as recovery from having been hit by a bus. White-collar professionals at large companies typically get six weeks paid if you gave birth vaginally, eight weeks if c-section, unless a doctor provides a note saying it will take longer before you are physically fit to work. That's white-collar professionals at large companies. Most mothers, of course, do not get any paid leave at all. Their employers are required to not fire them for being gone for twelve weeks, but going without pay that long is seldom practical.

    So I wouldn't want to hire a woman who is eight months pregnant for a critical role that needs to be filled immediately, but it would not be unusual to hire her to start in two months, by which time she could reasonably be expected to have had the baby and recovered from childbirth.

  • Jay (unregistered) in reply to faoileag
    faoileag:
    Chris said:
    Walk me through a method that reverses a string
    I have the feeling that that interview question is missing something. Like "in place", "without a loop" or "without a temporary variable".

    Asked as it is (without some restriction), even a complete dummy should be able to produce some pseudo code.

    With the restriction it's part of the "Swap two integers without using a third variable" group of interview quetions.

    CAPTCHA uxor. u xor some bits to achieve this...

    Or maybe he was just trying to give the candidate a really easy question. If he got that right, they could move on to the more difficult ones.

  • Tom (unregistered) in reply to MrFox
    MrFox:
    Nice, perfect way of resolving the problem. Let the idiot sink in their own shit.
    This, exactly. We don't need massive bureaucracy to second-guess every hiring decision (or every other management decision) we simply need to let the bad ones fail so they can be redeployed somewhere harmless. Janitors perhaps.
  • Ol' Bob (unregistered) in reply to faoileag
    faoileag:
    Chris said:
    Walk me through a method that reverses a string
    I have the feeling that that interview question is missing something. Like "in place", "without a loop" or "without a temporary variable".

    Asked as it is (without some restriction), even a complete dummy should be able to produce some pseudo code.

    With the restriction it's part of the "Swap two integers without using a third variable" group of interview quetions.

    CAPTCHA uxor. u xor some bits to achieve this...

    (apply str (reverse "ABC"))

    Hard? I think NOT!

    CATCHA - nobis : It's nobis of yours!

  • C-Derb (unregistered)

    TRWTF is assuming only married women get pregnant.

  • Ol' Bob (unregistered) in reply to agbeladem
    agbeladem:
    new StringBuilder(string).reverse().toString();

    Define "quick"

    Not dead.

    CAPTCHA: commoveo - commoveo, baby, and let's see what happens!

  • You're Boss (unregistered) in reply to Calli Arcale

    Fairly good summary, but your leaving one thing out: and that's the payment of medical premiums before vs. after. This only happened to a colleague of mine once, but a female came in, worked for the required 90 days to get benefits. 6 months later, gave birth and took medical leave. When her leave was up, she resigned.

  • C-Derb (unregistered)

    The most obviously made up part of the story is that Judith took Lisa out to lunch after the initial interview. That just didn't happen.

  • Ken (unregistered) in reply to cellocgw
    cellocgw:
    How about instead mandating equal amounts of "new child" leave for both males and females?
    And what about those of us who choose not to have children? When do we get our six month paid vacation with guaranteed right to return to an equal or better job?

    And can I take that vacation every 9-12 months, like a breeder?

  • Ol' Bob (unregistered) in reply to faoileag
    faoileag:
    Kabi:
    faoileag:
    even a complete dummy should be able to produce some pseudo code.
    Seems like I can crush someones faith in humanity, yay..
    DaveK:
    faoileag:
    even a complete dummy should be able to produce some pseudo code.
    Again, don't bet on it
    Now I feel depressed.

    Of course I've heard / read the stories but so far I haven't met wanna-be programmers that bad in the wild.

    Although I must admit I haven't been on the employer's side of the interview table so far...

    The worst one I encountered was a phone interview with a woman. She was asked a simple question, there was a pause...and then we heard whispering in the background, with a male voice describing the answer, sotto voce - and then the woman came back on with the answer. We cut that one short pretty fast.

    The next worst one was with another woman (of south Asian background) where the person sounded pretty good on the phone. When said person came in for the interview, however, one of the interviewers (also from south Asia) talked to her for a moment or two, then grabbed the boss and said, "This isn't the same person we phone-interviewed". He'd picked up on the difference in regional accent. Again, we cut that one pretty short too.

    CAPTCHA - delentit : dammit, I just did this one - delenit from the list!

  • (cs) in reply to faoileag
    faoileag:
    As the saying goes: "If you want to kill a project, run it through legal".
    Now this is a great quote. I'll need to remember this. It seems to be quite true.
  • anonymous (unregistered) in reply to You're Boss
    You're Boss:
    anonymous:
    You're Boss:
    Just pay women less in direct proportion to the statistical risk.
    How is that easier than just not hiring them?
    You may find a woman that is more talented and qualified than any males you interview.
    If you're concerned that a candidate will be incapable of performing their job for lengthy periods of time, how do you still consider them "qualified"?
  • Ol' Bob (unregistered) in reply to faoileag
    faoileag:
    Kabi:
    faoileag:
    even a complete dummy should be able to produce some pseudo code.
    Seems like I can crush someones faith in humanity, yay..
    DaveK:
    faoileag:
    even a complete dummy should be able to produce some pseudo code.
    Again, don't bet on it
    Now I feel depressed.

    Of course I've heard / read the stories but so far I haven't met wanna-be programmers that bad in the wild.

    You ain't been 'round. I've had colleagues worse than this! There were the ones who were hired for their looks - not their good looks, mind you, but because they were of the same gender but even less attractive than the boss (which took one helluva lot of screening, I assure you)! There were the kiss-asses...the cutie-pies...the "they've got a master's degree, they must know what they're doing" types...the "they're from (country X, Y, or Z) - they're perfect!"...all factors considered except "can they cut code that will A) execute, B) Do The Right Thing, and C) not burn up every CPU cycle between now and doomsday?".

  • (cs) in reply to pouzzler
    pouzzler:
    The fact that a stupid manager works in IT doesn't make their quirks "curious perversions in Information Technology", but "normal perversions in Management Thinking".

    Excuse me, but I don't understand your reasoning. As lame as she is, Judith is in Information Technology, and her actions are certainly a perversion, so I think this story is perfectly well placed.

    That said, I've been used in a similar way: I've been told to interview people that the management had no intention of hiring because the individuals were blac... ahem inappropriate in some way. That way, if those inappropriate persons aren't hired, whose name is on the interview? Not the manager's.

    Judith is using Chris to isolate her from the consequences of her obvious bigotry and miserliness. What she wants is a white male intern to work for a pittance: Skills aren't relevant; only color, gender, and cheap.

    But she knows that this attitude will get her in trouble if HR is doing its job and detects the bias, and she wants to be able to say that, "Chris made all the hiring decisions."

    Which means she is abusive, on top of all the rest.

  • sigh... (unregistered) in reply to funjon
    funjon:
    #include <stdio.h> #include <limits.h>

    void refoveo() { unsigned long long val = ULLONG_MAX; while (val) { printf("%llu\n",val--); } }

    int main (int argc, const char* argv[]) { refoveo(); return 0; }

    Sadly, the only thing I had to look up was ULLONG_MAX because I'd forgotten which macro that was.

    People really can't do this? Wuh?

    (CAPTCHA: refoveo)

    Hmm, I read "print out all the unsigned integers from the highest possible down to 0" as inclusive (but I would verify that with the interviewer).

    So you missed one.

  • (cs) in reply to Ken
    Ken:
    cellocgw:
    How about instead mandating equal amounts of "new child" leave for both males and females?
    And what about those of us who choose not to have children? When do we get our six month paid vacation with guaranteed right to return to an equal or better job?

    And can I take that vacation every 9-12 months, like a breeder?

    Staying home with a newborn is to "vacation" as "Taking candy from a baby" is to easy.

  • Chelloveck (unregistered) in reply to faoileag
    faoileag:
    I have the feeling that that interview question is missing something. Like "in place", "without a loop" or "without a temporary variable". Asked as it is (without some restriction), even a complete dummy should be able to produce some pseudo code.

    It'd be nice to think that, wouldn't it? But unfortunately I've been that interviewer many times, doing the campus career fair circuit. The only restriction I put on it is that you can't call a pre-defined library function like "reverse_string()". There are CS and CE seniors and graduates from respectable universities who can't handle it. Some days I just want to say, "Pick your favorite language. Write 'hello, world'." Just to see how many of them would fail it.

  • anonymous (unregistered) in reply to sigh...
    sigh...:
    funjon:
    #include <stdio.h> #include <limits.h>

    void refoveo() { unsigned long long val = ULLONG_MAX; while (val) { printf("%llu\n",val--); } }

    int main (int argc, const char* argv[]) { refoveo(); return 0; }

    Sadly, the only thing I had to look up was ULLONG_MAX because I'd forgotten which macro that was.

    People really can't do this? Wuh?

    (CAPTCHA: refoveo)

    Hmm, I read "print out all the unsigned integers from the highest possible down to 0" as inclusive (but I would verify that with the interviewer).

    So you missed one.

    Not to mention that he was supposed to print all of the unsigned integers, not all of the unsigned long long integers. Creatively reinterpreting the design requirements when you're not sure of something does not win you brownie points. If in doubt, ask what size of integer they want you to use.

  • (cs)
    print(string[::-1])
  • (cs)

    Kickstarter to register TheDailyPHB.com?

  • TenshiNo (unregistered)

    Reversing a string is easy. I even made it an extension method ;)

    public static string ReverseString(this string tst)
    {
        if (tst == null || tst == "" || tst.TrimStart().TrimEnd().Length < 1)
            throw new InvalidOperationException();
        else
            return new string(tst.ToCharArray().Select(c => (byte)c).ToArray().Reverse().ToArray().Select(c => (char)c).ToArray());
    }
    

    (It's a weird feeling sitting down with the thought of "how convoluted can I make this simple process?")

  • (cs) in reply to funjon
    funjon:
    #include <stdio.h> #include <limits.h>

    void refoveo() { unsigned long long val = ULLONG_MAX; while (val) { printf("%llu\n",val--); } }

    int main (int argc, const char* argv[]) { refoveo(); return 0; }

    Sadly, the only thing I had to look up was ULLONG_MAX because I'd forgotten which macro that was.

    People really can't do this? Wuh?

    Wel you obviously can't. read the requirements.
    John Appleseed:
    Question 2 is generally to ask them to print out all the unsigned integers from the highest possible down to 0.
    John Appleseed asked for all the unsigned integers, you delivered all the unsigned long longs.

    This is definitely much more than was asked for and a waste of CPU processing time and printer paper!

  • (cs) in reply to faoileag
    faoileag:
    Kabi:
    faoileag:
    even a complete dummy should be able to produce some pseudo code.
    Seems like I can crush someones faith in humanity, yay..
    DaveK:
    faoileag:
    even a complete dummy should be able to produce some pseudo code.
    Again, don't bet on it
    Now I feel depressed.

    Of course I've heard / read the stories but so far I haven't met wanna-be programmers that bad in the wild.

    Although I must admit I haven't been on the employer's side of the interview table so far...

    I've done interviews for the last company I worked at (30 person cheap-as-possible operation), and the one I work for now (800+ employees). While the new one isn't exactly large, there are people that were brought to me at my last company that wouldn't even be used as a gopher here. Probably depends on how big your company is, and how willing/able your boss is to sacrifice anything getting done just to save money.

  • (cs) in reply to Calli Arcale
    Calli Arcale:
    Okay, for the edification of the likely European folks complaining about how terrible it is to hire a woman who then takes 6-12 months off, (...)
    OK, for the edification of the (likely) not so regular TheDailyWTF reader: Story by Remy Porter -> Read the HTML comments.
  • Fred (unregistered)

    True story: after the interviews we all agreed that one candidate was clearly more qualified. Even though the team was all male no one ever commented on the fact that she was female. We offered her the job and she accepted. We sent our thank-yous and condolences to the others. You know, although we were impressed blah blah we selected someone we felt had better qualifications.

    The Friday before her Monday start date, she called to tell us she had gotten pregnant and decided not to start the job.

    OK, now what? Do we start the interview process over? (If you've been through this from the hiring side, you know you'd rather have a tooth pulled without pain meds.) Or do we call up one of those other candidates "yeah we didn't like you so much but will you come muck through our code anyway"? They will forever know that you set them aside for someone else.

    Now I appreciate that she didn't come in, suck up training resources for two months, qualify for benefits, and then leave. But still, how are we supposed to suppress the natural human instinct to learn from such an experience?

  • Ken (unregistered) in reply to wsm66
    wsm66:
    Ken:
    cellocgw:
    How about instead mandating equal amounts of "new child" leave for both males and females?
    And what about those of us who choose not to have children? When do we get our six month paid vacation with guaranteed right to return to an equal or better job?

    And can I take that vacation every 9-12 months, like a breeder?

    Staying home with a newborn is to "vacation" as "Taking candy from a baby" is to easy.

    Why do you care how I spend the time? The point is, some people get to hit their employers with the cost of time off, and others don't.

  • (cs) in reply to TenshiNo
    TenshiNo:
    Reversing a string is easy. I even made it an extension method ;)
    public static string ReverseString(this string tst)
    {
        if (tst == null || tst == "" || tst.TrimStart().TrimEnd().Length < 1)
            throw new InvalidOperationException();
        else
            return new string(tst.ToCharArray().Select(c => (byte)c).ToArray().Reverse().ToArray().Select(c => (char)c).ToArray());
    }
    

    (It's a weird feeling sitting down with the thought of "how convoluted can I make this simple process?")

    You could simplify one conditional by using String.IsNullOrEmpty().

  • TenshiNo (unregistered) in reply to C-Derb
    C-Derb:
    TRWTF is assuming only married women get pregnant.

    No one said that only married women get pregnant. But, statistically speaking, getting married increases the likelihood of getting pregnant by several orders of magnitude.

  • Larry (unregistered)
    print "all the unsigned integers from the highest possible down to 0.\n";

    If you wanted something else, your requirements should have been more specific. Don't expect programmers to guess what you meant.

  • (cs)

    Maternity leave by country

    (food for thought)

  • TenshiNo (unregistered) in reply to chubertdev
    chubertdev:
    TenshiNo:
    Reversing a string is easy. I even made it an extension method ;)
    public static string ReverseString(this string tst)
    {
        if (tst == null || tst == "" || tst.TrimStart().TrimEnd().Length < 1)
            throw new InvalidOperationException();
        else
            return new string(tst.ToCharArray().Select(c => (byte)c).ToArray().Reverse().ToArray().Select(c => (char)c).ToArray());
    }
    

    (It's a weird feeling sitting down with the thought of "how convoluted can I make this simple process?")

    You could simplify one conditional by using String.IsNullOrEmpty().

    I know, but the whole point was to resist the urge to simplify the code. I could've writen the whole thing like this:

    return tst.ToCharArray().Reverse().ToString();

    In retrospect, I think my method name was entirely too sane, also ;)

  • (cs) in reply to TenshiNo
    TenshiNo:
    chubertdev:
    TenshiNo:
    Reversing a string is easy. I even made it an extension method ;)
    public static string ReverseString(this string tst)
    {
        if (tst == null || tst == "" || tst.TrimStart().TrimEnd().Length < 1)
            throw new InvalidOperationException();
        else
            return new string(tst.ToCharArray().Select(c => (byte)c).ToArray().Reverse().ToArray().Select(c => (char)c).ToArray());
    }
    

    (It's a weird feeling sitting down with the thought of "how convoluted can I make this simple process?")

    You could simplify one conditional by using String.IsNullOrEmpty().

    I know, but the whole point was to resist the urge to simplify the code. I could've writen the whole thing like this:

    return tst.ToCharArray().Reverse().ToString();

    In retrospect, I think my method name was entirely too sane, also ;)

    Yeah, but you should still be checking for null.

    Also, you probably shouldn't raise an exception on an empty string. I'd fully expect the reversal of an empty string to return a valid result, an empty string.

  • TenshiNo (unregistered) in reply to chubertdev
    chubertdev:
    Maternity leave by country

    (food for thought)

    Why, exactly, should companies be required to pay women for maternity leave? It was their choice to get pregnant (or at least to engage in the activity that got them pregnant).

  • TenshiNo (unregistered) in reply to chubertdev
    chubertdev:
    TenshiNo:
    chubertdev:
    TenshiNo:
    Reversing a string is easy. I even made it an extension method ;)
    public static string ReverseString(this string tst)
    {
        if (tst == null || tst == "" || tst.TrimStart().TrimEnd().Length < 1)
            throw new InvalidOperationException();
        else
            return new string(tst.ToCharArray().Select(c => (byte)c).ToArray().Reverse().ToArray().Select(c => (char)c).ToArray());
    }
    

    (It's a weird feeling sitting down with the thought of "how convoluted can I make this simple process?")

    You could simplify one conditional by using String.IsNullOrEmpty().

    I know, but the whole point was to resist the urge to simplify the code. I could've writen the whole thing like this:

    return tst.ToCharArray().Reverse().ToString();

    In retrospect, I think my method name was entirely too sane, also ;)

    Yeah, but you should still be checking for null.

    Also, you probably shouldn't raise an exception on an empty string. I'd fully expect the reversal of an empty string to return a valid result, an empty string.

    I think you're missing the point: it was supposed to be bad code, dude.

  • anonymous (unregistered) in reply to TenshiNo
    TenshiNo:
    Reversing a string is easy. I even made it an extension method ;)
    public static string ReverseString(this string tst)
    {
        if (tst == null || tst == "" || tst.TrimStart().TrimEnd().Length < 1)
            throw new InvalidOperationException();
        else
            return new string(tst.ToCharArray().Select(c => (byte)c).ToArray().Reverse().ToArray().Select(c => (char)c).ToArray());
    }
    

    (It's a weird feeling sitting down with the thought of "how convoluted can I make this simple process?")

    "" cannot be reversed " " cannot be reversed "11111" can be reversed WTF?

    P.S. You don't need to trim spaces from both sides of a string that contains nothing but spaces. Trimming from either the beginning or end of such a string will result in an empty string. Trimming it again from the other direction will accomplish nothing more.

Leave a comment on “Disqualified Candidates”

Log In or post as a guest

Replying to comment #:

« Return to Article