Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Lexical Unit
Sep 16, 2003

jarito posted:

I've seen MUCH worse on our exam we give to people applying for jobs.
I'll just assume your company routinely hires kindergartners then.

Adbot
ADBOT LOVES YOU

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
Speaking of regexes, here's some Perl that I saw yesterday:
code:
if($condition =~ /true/)
Yes, $condition was set from a string literal elsewhere in the code; not read in from a file or some other excuse.

pointers
Sep 4, 2008

Outlaw Programmer posted:

Why bother with the regex at all? I mean, don't you have to make sure that the value is a valid country code anyway? Can't you just check to see if the String is in some canonical set of codes?
The "approved validation rules" just check to make sure it is in valid format. I'm sure I could have drawn up a list to check if it was actually valid, but I think that it's assumed that you know the country code you're putting in, and is just making sure that you haven't made a typo that will cause the system to crash.

However, a country code is \+?\d{1,4}. The code just looped to ensure all characters were \d or '+'. 13+3124 would have matched. The loop would have been less painful if it actually did what it was supposed to.

Zombywuf
Mar 29, 2008

Lexical Unit posted:

I'll just assume your company routinely hires kindergartners then.

He didn't say he hired them.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Lexical Unit posted:

I'll just assume your company routinely hires kindergartners then.

I read somewhere that often those coding tests aren't really meant to show how clever you are, just to prove that you can program at all.

Zombywuf
Mar 29, 2008

Wheany posted:

I read somewhere that often those coding tests aren't really meant to show how clever you are, just to prove that you can program at all.
Yes, you'd be amazed by the number of people who seem to think "being able to program" is something they'll be able to get around during the interview.

I remember when I left uni how interviewers would often be shocked and amazed at my ability to solve simple programming problems. It was only after I started interviewing people that I realised why.

Lexical Unit
Sep 16, 2003

Yeah I have been interviewed by no less than 6 people over the course of a few hours by a number of companies and not a single one of them seemed interested in my coding ability. Most just wanted to know if I'd "fit the culture." Then one time someone asked me to solve a simple parallelization problem and it took me about 30 seconds, the guy was so surprised it seemed he would faint.

What's funny is usually the 5th or 6th interviewers would start off with something like, "Well I'm sure you've seen enough technical problems and written enough code already, seeing as you've been here for hours..."

"Actually no, I haven't seen any of either."

It's like no one actually wants to ask technical questions or make coding problems if they don't have to.

spiritual bypass
Feb 19, 2008

Grimey Drawer
It always pisses me off when I get a phone interview with the lead developer and then the only in-person contact I get is a stuffed suit. The suit then decides I'm not right for the position in spite of the fact that the developer must've liked my technical knowledge, otherwise I wouldn't have gotten the second interview.

Seems like it should go the other way around, right? Technical competence should come before being able to make small talk with a moron.

Nigglypuff
Nov 9, 2006


BUY ME BONESTORM
OR
GO TO HELL

royallthefourth posted:

It always pisses me off when I get a phone interview with the lead developer and then the only in-person contact I get is a stuffed suit. The suit then decides I'm not right for the position in spite of the fact that the developer must've liked my technical knowledge, otherwise I wouldn't have gotten the second interview.

Seems like it should go the other way around, right? Technical competence should come before being able to make small talk with a moron.

That's how enginetopia will be run, yes. Meantimes the disdain you are expressing for nontechnical staff and company procedure is probably more responsible for your rejection that any systemic problem with their hiring process.

spiritual bypass
Feb 19, 2008

Grimey Drawer

Nigglypuff posted:

That's how enginetopia will be run, yes. Meantimes the disdain you are expressing for nontechnical staff and company procedure is probably more responsible for your rejection that any systemic problem with their hiring process.

I've got nothing against nontechnical staff. Plenty of people make great contributions to the workplace that are not mathematical. How could I not be angered when I have a great phone conversation with a developer and then meet someone really dumb in person?

"Rate your programming ability on a scale of one to ten. Do you know any dotnet?"

I didn't tell him he was wasting my time, even though it was a horrible interview. It's only natural that I scowl when he gives me an explanation of the company history that shows it going from 20 developers to 3 and back again every couple years.

Vinterstum
Jul 30, 2003

royallthefourth posted:

Seems like it should go the other way around, right? Technical competence should come before being able to make small talk with a moron.

Not at all. Technical competence is completely useless in a company if you're unable to function properly in a team (which includes "small talk" with "morons").

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Vinterstum posted:

Not at all. Technical competence is completely useless in a company if you're unable to function properly in a team (which includes "small talk" with "morons").

Haha no.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

royallthefourth posted:

I've got nothing against nontechnical staff. Plenty of people make great contributions to the workplace that are not mathematical. How could I not be angered when I have a great phone conversation with a developer and then meet someone really dumb in person?

"Rate your programming ability on a scale of one to ten. Do you know any dotnet?"

I didn't tell him he was wasting my time, even though it was a horrible interview. It's only natural that I scowl when he gives me an explanation of the company history that shows it going from 20 developers to 3 and back again every couple years.

Why did you not walk out of the interview at this point

spiritual bypass
Feb 19, 2008

Grimey Drawer

Otto Skorzeny posted:

Why did you not walk out of the interview at this point

Because I am a whore who is desperate for money

Painless
Jan 9, 2005

Turn ons: frogs, small mammals, piles of compost
Turn offs: large birds, pitchforks
See you at the beach!
I noticed that clearing a list was taking quite a bit of time so I replaced a list.clear() call with the following line:

code:
new ( &list )std::list< Stuff, MyHackedTogetherAllocator >( list.get_allocator() );
It seems to work I guess and it shaved 20ms from my program's startup time so you know it's worth it

Vinterstum
Jul 30, 2003

Avenging Dentist posted:

Haha no.

Well said sir, well said.

Lexical Unit
Sep 16, 2003

I'd have to agree with AD. I work with some people who couldn't have a normal conversation with someone outside their field of work (or much of the time inside their field of work), especially if they tried. But they get their job done just fine.

Vinterstum
Jul 30, 2003

Lexical Unit posted:

I'd have to agree with AD. I work with some people who couldn't have a normal conversation with someone outside their field of work (or much of the time inside their field of work), especially if they tried. But they get their job done just fine.

I'm not talking about the typical social awkwardness kind of thing that a lot of us have, I'm talking about the arrogant cowboy-coder style of attitude (which is what I got from the OP), where anyone who isn't a good coder in their eyes is a "moron" and not worth their time, and typically indicates someone who'll do whatever they drat well please whether it's what they're supposed to do or not.

Lexical Unit
Sep 16, 2003

So that pretty much describes my boss :cry:

BigRedDot
Mar 6, 2008

Lexical Unit posted:

So that pretty much describes my boss :cry:

Which is especially ironic considering the utter shite that he produces. Having to use, interface to, or otherwise deal with his code is like a millstone about my neck.

BigRedDot fucked around with this message at 20:10 on Sep 3, 2009

Zombywuf
Mar 29, 2008

Vinterstum posted:

I'm not talking about the typical social awkwardness kind of thing that a lot of us have, I'm talking about the arrogant cowboy-coder style of attitude (which is what I got from the OP), where anyone who isn't a good coder in their eyes is a "moron" and not worth their time, and typically indicates someone who'll do whatever they drat well please whether it's what they're supposed to do or not.
Yeah, in the context of interviews where technical issues are ignored that's exactly what the op sounded like.

Oh wait, no he didn't.

Vinterstum
Jul 30, 2003

Zombywuf posted:

Yeah, in the context of interviews where technical issues are ignored that's exactly what the op sounded like.

He said he already went through a round of technical issues with a developer, before talking to the "suit". So yes, he did.

Zombywuf
Mar 29, 2008

Vinterstum posted:

He said he already went through a round of technical issues with a developer, before talking to the "suit". So yes, he did.
Phone interviews are for screening. I'm interested in knowing what use an interview with a single non technical person would be.

Vinterstum
Jul 30, 2003

Zombywuf posted:

Phone interviews are for screening. I'm interested in knowing what use an interview with a single non technical person would be.

Second level of screening, maybe, HR making sure they don't waste the time of the actual devs on an interview with someone who'd never fit in. Not saying it's something I would've done personally or that it's what happened here, but I've heard about similar things before (you meet first with HR, after a chat they'll either bring in a lead dev or they'll tell you they'll "contact you later").

Zombywuf
Mar 29, 2008

Vinterstum posted:

Second level of screening, maybe, HR making sure they don't waste the time of the actual devs on an interview with someone who'd never fit in. Not saying it's something I would've done personally or that it's what happened here, but I've heard about similar things before (you meet first with HR, after a chat they'll either bring in a lead dev or they'll tell you they'll "contact you later").
I see this practise as a big red warning sign.

pointers
Sep 4, 2008

-

pointers fucked around with this message at 06:58 on Jul 13, 2011

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Zombywuf posted:

I see this practise as a big red warning sign.

For sure. All the interviews I've ever been a part of have been a bunch of interviews leading up to the "stuffed suit" who is usually the hiring manager. The only interview I've ever been to where it was JUST the manager was him basically creating a team from scratch.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

pointerSex posted:

More!

code:
public static String getString(String inputStr)
{
    return inputStr;
}
It's a good thing speed isn't all that important for this application...

How could a function that just returns its input unchanged be useful. This isn't even a speed issue, as it'll get inlined away with near certainty

plushpuffin
Jan 10, 2003

Fratercula arctica

Nap Ghost

Otto Skorzeny posted:

How could a function that just returns its input unchanged be useful. This isn't even a speed issue, as it'll get inlined away with near certainty

The only way I could see this possibly being useful would be for the function to be overridden in a derived class to format the string, with the default behavior being to simply return the string unchanged.

xarph
Jun 18, 2001


pointerSex posted:

More!

code:
public static String getString(String inputStr)
{
    return inputStr;
}
It's a good thing speed isn't all that important for this application...

The only way I can see this existing is if there used to be something other than return inputStr; that was later obsoleted.

And no one knows how to refactor.

MrBishop
Sep 30, 2006

I see what you did there...

Soiled Meat

plushpuffin posted:

The only way I could see this possibly being useful would be for the function to be overridden in a derived class to format the string, with the default behavior being to simply return the string unchanged.

That seems reasonable, except that it's a static method.

xarph posted:

The only way I can see this existing is if there used to be something other than return inputStr; that was later obsoleted.

And no one knows how to refactor.

My first thought, too. Because I've done this before :(

litghost
May 26, 2004
Builder

Otto Skorzeny posted:

How could a function that just returns its input unchanged be useful. This isn't even a speed issue, as it'll get inlined away with near certainty

Python's config parser.

By default it will take your ini file and make all of the options lower case when writing to file. But of course while loaded it is case sensitive and preserves the option names case until the write. In order to remove this "feature" you must override a method, and the new methods looks like

code:
def optionxform(str):
    return str

litghost fucked around with this message at 02:17 on Sep 4, 2009

plushpuffin
Jan 10, 2003

Fratercula arctica

Nap Ghost

MrBishop posted:

That seems reasonable, except that it's a static method.

Yeah... well, then. I've got nothin.

jarito
Aug 26, 2003

Biscuit Hider

Wheany posted:

I read somewhere that often those coding tests aren't really meant to show how clever you are, just to prove that you can program at all.

This is it. We use the test to weed out those that have no chance, then do the actual technical and cultural evaluation of the people that pass.

You'd be surprised how many people will list 3-5 years of web application development on their resume and really have just played with Access and FrontPage.

Inverse Icarus
Dec 4, 2003

I run SyncRPG, and produce original, digital content for the Pathfinder RPG, designed from the ground up to be played online.

jarito posted:

This is it. We use the test to weed out those that have no chance, then do the actual technical and cultural evaluation of the people that pass.

I graduated from a top Computer Science university, and I am absolutely terrified by some of the people who graduated with me. I'm no valedictorian, a solid B student at best, but I knew my poo poo coming out. Some of the people I went to classes with don't know a pointer from their rear end in a top hat, and cheated/copied/begged their way to passing grades. I was constantly asked if I could "help" them on projects, which was always asked the day before it was due, and amounted to "I started an hour ago and I'm stuck."

I smiled a bit when I heard a bunch of the people I knew in this situation were having trouble finding jobs, but most of them eventually did. I feel bad for the companies that hired them, and hope against hope that they learned on the job what they couldn't learn in school.



On the other side of the fence, I've also done interviews for the company I work for now, Cisco. I've worked career fairs, accepting resumes, talking to people, and then afterward set up one on one interviews with candidates that matched our requirements.

Some of the people who make it past the initial resume screening amaze me. People who seemingly know nothing about what's written on their resume. They can't elaborate on their projects or coursework.

Some times, these people weasel their way up to the last round of interviews, and get on-campus interviews on site in San Jose. One time I had a guy who had a research project that obviously had to involve threading on his resume. He was finishing up his doctorate in Computer Science this Spring, and wanted a job for the Fall.

I like to ask language agnostic technical questions, if I can, so I threw out what I consider an easy one. I asked him if he knew what threads were, and he said yes. As he probably queued up a canned response to what threads are, I asked "How do you share a resource between two threads, what dangers are there, and how can you work around them?"

I was looking for anything, really. Hitting on any of the keywords, "Deadlock", "Synchronous blocks", ANYTHING, would have answered the question enough for me to feel good about this guy.

But he writhed, and started answering a question I didn't ask. He started talking about fork and pthread_create, but never addressed the question. After he finished I asked, "And what about when two threads try to write to the same data?" And he just stared at me, blinking. A future doctor of Computer Science.

I swear to God, I am so disillusioned with academia after having to interview a fair number of people. I knew this sort of thing happened when I went to school, but I had no idea at some of the garbage that still somehow floats to the top.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Inverse Icarus posted:

I swear to God, I am so disillusioned with academia after having to interview a fair number of people. I knew this sort of thing happened when I went to school, but I had no idea at some of the garbage that still somehow floats to the top.

This kind of thing has really bothered me throughout my academic career. People are so focused with trying to make a certain grade that they forget they are actually supposed to learn something. Over and over in my classes I see people end the semester with an A and in reality they haven't learned a drat thing.

deedee megadoodoo
Sep 28, 2000
Two roads diverged in a wood, and I, I took the one to Flavortown, and that has made all the difference.


Found this while looking at a performance issue the other day. I'm not a developer but our developers suck (see here) so I end up looking at code. I really don't know what I can say about this so I'll just paste the code and let it sink in...

code:
public static String replaceAll(String source, String toReplace, String replacement) {

            String temp = source;

            int startInd = temp.indexOf(toReplace);

            while (startInd >= 0 && startInd < temp.length()) {

                  temp = temp.substring(0, startInd) + replacement + temp.substring(startInd + toReplace.length());

                  startInd = startInd + replacement.length();

                  startInd = temp.indexOf(toReplace, startInd);

            }

 

            return temp;

      }

Inverse Icarus
Dec 4, 2003

I run SyncRPG, and produce original, digital content for the Pathfinder RPG, designed from the ground up to be played online.
:what: Why even bother writing that at all?

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#replaceAll%28java.lang.String,%20java.lang.String%29

Inverse Icarus fucked around with this message at 20:01 on Sep 4, 2009

deedee megadoodoo
Sep 28, 2000
Two roads diverged in a wood, and I, I took the one to Flavortown, and that has made all the difference.



That's one of the reasons it's in this thread...

Adbot
ADBOT LOVES YOU

awesmoe
Nov 30, 2005

Pillbug

Because 1.5 was only released near the end of 2004 and before that there was no replace all method, iirc

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply