• n_slash_a (unregistered)

    void main() { deque<int> a; deque<int> b; bool remove_duplicates; // populate arrays copy(b.begin(), b.end(), a.end()); sort(a.begin(), a.end()); if (remove_duplicates) { deque<int>::iterator new_end = unique(a.begin(), a.end()); a.resize(distance(a.begin(), new_end)); } // profit? }

  • JPW (unregistered)

    I haven't coded in a while, let's see how I do in Perl.

    Perl array merge

    @combined = @first_array + @second_array;

    Gosh that was hard.

    Let's try a Perl fizzbuzz. Let's use Map just to be a pain.

    @integers = (1..100); map {&carbonate($_)} @integers;

    print @integers;

    sub carbonate{ $n = $_ if ($n %3*5 == 0) {$n = 'FizzBuzz';} elsif ($n %5 == 0) {$n = 'Buzz';} elsif ($n %3 == 0) {$n = 'Fizz';} return $n; }

    Am I hired for succeeding, fired for using Perl, or mocked for some obvious failure in the above?

  • jay (unregistered) in reply to tharpa
    tharpa:
    Evan:
    tharpa:
    I also don't like Atwood's article at http://www.codinghorror.com/blog/2006/07/separating-programming-sheep-from-non-programming-goats.html. I can imagine a person with programming potential (but who's never seen a line of code before) who's never been taught about assignment, and certainly has never been taught about the perverse way that C-family programmers use the equals sign, who would just see the third line in the code there, would think it was an error and/or that the test givers were morons, and wouldn't be able to get beyond that unless they were given those critical pieces of information.
    To play devil's advocate for a second:

    If you're a hiring manager, do you want to hire someone who might have programming potential if you put in a lot of training, or do you want to decline and wait a bit longer until you get an applicant who can actually demonstrate some amount of programming proficiency already?

    The first could lead to some high rewards, yes. But it's also really high risk. Do you want to take that chance?

    If I understand your point correctly, it is that a test to separate potential programmers from non-potential programmers could have some legitimacy. I do not dispute this. My complaint was about using such a test that used the C-language perversion of the equals sign without an explanation. I would have been consistent in my view that it was an error, and none of the answers clearly addressed that possibility. Upon reading some of the comments to that article, there were quite a few other people who made the same point. Had the writers used a different assignment operator, like :=, or used "Let" syntax, it would have been a completely different question.

    Hmm, I just read the cited Atwood article. Maybe I'm missing something here, but if I'm reading this correctly, they gave the students this pre-test without first explaining how assignment in C-like languages works, and then graded students on their ability to guess correctly. This seems really, really pointless to me.

    Now if what he means is that they explained it, and then gave the quiz, and some students couldn't grasp the idea, okay, that's a different story.

  • (cs) in reply to ZoomST
    ZoomST:
    emaNrouY-Here:
    Don:
    Quango:
    ALWAYS test candidates' coding ability. Jeff Attwood's article http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html is six years old and still holds.

    I interviewed one guy who spent over an hour trying to write a FizzBuzz routine. He had a masters degree in CS.

    Masters degree doesn't really mean much. I had someone working with me previously that had a masters in IT from one of the top UK universities. Couldn't even setup a docking station...
    Pshaw! He's a Master's Degree holding developer. Setting up docking stations and doing tech repair grunt work... that's blue collar Union work.

    In all seriousness, a musician doesn't know how to repair a piano, a car owner doesn't necessarily know how to change their oil, and most computer users, developers, database admins must necessarily know how to build or setup the devices they work on (from a hardware standpoint).

    FTFY -- as popular knowledge dictates.

    A friend's father expected him to know how to use a polishing machine he rented just because he just had its degree in CS. Clearly he should wait until he had a Master's Degree!

    People usually expects you to fix their technology (for free) if you had a remotely-related degree. If you were a physician, they'll expect you to check their health (for free as well). Some jobs are almost free of this crap, such as gravedigger or a chicken sexer.

    One particular job where you are definitely never asked to perform a task for free is if have a qualification in mathematics. You frequently get asked to help with the kiddies' homework - but guess what, they're prepared to pay you big bux for the privilege.

  • AC (unregistered) in reply to jay
    jay:
    tharpa:
    Evan:
    tharpa:
    I also don't like Atwood's article at http://www.codinghorror.com/blog/2006/07/separating-programming-sheep-from-non-programming-goats.html. I can imagine a person with programming potential (but who's never seen a line of code before) who's never been taught about assignment, and certainly has never been taught about the perverse way that C-family programmers use the equals sign, who would just see the third line in the code there, would think it was an error and/or that the test givers were morons, and wouldn't be able to get beyond that unless they were given those critical pieces of information.
    To play devil's advocate for a second:

    If you're a hiring manager, do you want to hire someone who might have programming potential if you put in a lot of training, or do you want to decline and wait a bit longer until you get an applicant who can actually demonstrate some amount of programming proficiency already?

    The first could lead to some high rewards, yes. But it's also really high risk. Do you want to take that chance?

    If I understand your point correctly, it is that a test to separate potential programmers from non-potential programmers could have some legitimacy. I do not dispute this. My complaint was about using such a test that used the C-language perversion of the equals sign without an explanation. I would have been consistent in my view that it was an error, and none of the answers clearly addressed that possibility. Upon reading some of the comments to that article, there were quite a few other people who made the same point. Had the writers used a different assignment operator, like :=, or used "Let" syntax, it would have been a completely different question.

    Hmm, I just read the cited Atwood article. Maybe I'm missing something here, but if I'm reading this correctly, they gave the students this pre-test without first explaining how assignment in C-like languages works, and then graded students on their ability to guess correctly. This seems really, really pointless to me.

    Now if what he means is that they explained it, and then gave the quiz, and some students couldn't grasp the idea, okay, that's a different story.

    Yes, you are missing something. The article claims there are 3 groups of students. The first one are the students that could make up a consistent model of what those symbols meant. It doesn't matter if they get it right or wrong, just if they can imagine any way in which the questions/answers made sense, and used that to answer.

    This means it doesn't matter if they used "Let a = b" or "a := b" or "a <- b" or whatever. The model students could form may very well change, but the fact that they used one would not.

  • (cs) in reply to AC
    AC:
    jay:
    tharpa:

    If I understand your point correctly, it is that a test to separate potential programmers from non-potential programmers could have some legitimacy. I do not dispute this. My complaint was about using such a test that used the C-language perversion of the equals sign without an explanation. I would have been consistent in my view that it was an error, and none of the answers clearly addressed that possibility. Upon reading some of the comments to that article, there were quite a few other people who made the same point. Had the writers used a different assignment operator, like :=, or used "Let" syntax, it would have been a completely different question.

    Hmm, I just read the cited Atwood article. Maybe I'm missing something here, but if I'm reading this correctly, they gave the students this pre-test without first explaining how assignment in C-like languages works, and then graded students on their ability to guess correctly. This seems really, really pointless to me.

    Now if what he means is that they explained it, and then gave the quiz, and some students couldn't grasp the idea, okay, that's a different story.

    Yes, you are missing something. The article claims there are 3 groups of students. The first one are the students that could make up a consistent model of what those symbols meant. It doesn't matter if they get it right or wrong, just if they can imagine any way in which the questions/answers made sense, and used that to answer.

    This means it doesn't matter if they used "Let a = b" or "a := b" or "a <- b" or whatever. The model students could form may very well change, but the fact that they used one would not.

    Sorry, AC, the students didn't get to pick their operators. They are already there on the test.

    And also, there was no option (as far as I can tell) for those who consistently refused to continue after reading the third line, assuming it to be an error and thus reflective on the whole test.

  • Pat V. (unregistered)

    I can't believe he bluffed his way through the initial interview process. You need to get past the buzzwords, unless the people interviewing are equally oblivious. I've interviewed people, and I've been interviewed. When the person gets into the intimates of C++, and can't give me a good explaination of what I'll be doing, I know I'll be cleaning up the WTF's of someone who did good at the coding test, but spent their time finding exciting code solutions to boring problems. Much rather have someone who can look at a problem, and break it down logically. Often, the code written reflects the structure of the problem in real life. I freely admit I try very hard to write boring code.

  • Thanatos Complex (unregistered) in reply to tharpa
    tharpa:
    AC:
    jay:
    tharpa:

    If I understand your point correctly, it is that a test to separate potential programmers from non-potential programmers could have some legitimacy. I do not dispute this. My complaint was about using such a test that used the C-language perversion of the equals sign without an explanation. I would have been consistent in my view that it was an error, and none of the answers clearly addressed that possibility. Upon reading some of the comments to that article, there were quite a few other people who made the same point. Had the writers used a different assignment operator, like :=, or used "Let" syntax, it would have been a completely different question.

    Hmm, I just read the cited Atwood article. Maybe I'm missing something here, but if I'm reading this correctly, they gave the students this pre-test without first explaining how assignment in C-like languages works, and then graded students on their ability to guess correctly. This seems really, really pointless to me.

    Now if what he means is that they explained it, and then gave the quiz, and some students couldn't grasp the idea, okay, that's a different story.

    Yes, you are missing something. The article claims there are 3 groups of students. The first one are the students that could make up a consistent model of what those symbols meant. It doesn't matter if they get it right or wrong, just if they can imagine any way in which the questions/answers made sense, and used that to answer.

    This means it doesn't matter if they used "Let a = b" or "a := b" or "a <- b" or whatever. The model students could form may very well change, but the fact that they used one would not.

    Sorry, AC, the students didn't get to pick their operators. They are already there on the test.

    And also, there was no option (as far as I can tell) for those who consistently refused to continue after reading the third line, assuming it to be an error and thus reflective on the whole test.

    That would be the third group:

    8% of students didn't give a damn and left the answers blank.
    The blank group knows that it is looking at meaninglessness, and refuses to deal with it.
  • jay (unregistered)

    I'm surprised that there aren't a bunch of comments saying that Avi is an idiot, and that Fred is smart in googling for code rather than trying to write his own.

    I don't know how many times I've heard people say that it's ALWAYS better to search the web for code to solve a problem rather than trying to write it yourself, because "why re-invent the wheel?"

    Which analogy always baffles me, because in real life, manufacturers re-invent the wheel in this sense every day, and for very good reasons. It's not like there's one factory in the world that makes exactly one kind of wheel and everybody buys and uses those wheels.

    There are many good reasons to make your own wheels rather than buy from someone else.

    Most obviously, your requirements may be different. A wheel that works well on a child's tricycle may not be ideal for a thousand-ton earth-moving vehicle. For that matter, a wheel that works well on a passenger car may not be the best for a pick-up truck or a race car.

    Even if someone else's wheels would work on your vehicle, it may still be more economical to make your own. You eliminate the other guy's markup, shipping costs, etc. You are not vulnerable to disruptions in his operations -- like if your supplier's employees go on strike, you have no control over the situation, but must wait for them to resolve it while your assembly line grinds to a halt.

    Getting back to the case at hand: Software downloaded from the web is not really "free". Whether we're talking about a complete software package or some small code snippet, the same considerations apply. You may not have to pay the people who wrote it, but it takes time to search the web to find an applicable product or code sample. Then you have to learn how to install, configure, and run it. Then you have to figure out if it really meets your requirements. The more complex the problem is, the less likely that someone else's software EXACTLY meets your requirements, so you have to decide if it is close enough. If the software turns out to have bugs, you have to rely on someone else to fix it. Even if you have the source code, you have to figure out somebody else's code. You may need to integrate it into other code that you have. If software that you found turns out to not be suitable, you have to begin the process all over again.

    I've had a number of times when I was searching for a software product to meet some requirement and I had to review several available products before finding one that was suitable. This process often took days or weeks. For complete, complex software packages, it sometimes took months.

    If the requirement is both very general and very complex, the effort of finding software written by someone else can be well worth it. I would be very, very unlike to write my own database management system to support one application. There are plenty of good DBMSs out there that I could get for far less than the cost of developing my own.

    But at the other extreme, I once got into a strange argument on Stackoverflow where someone posted a question asking if Java had a built-in function to concatenate an array of Strings with some delimiter between them. Like, turn the array ["x", "y", "z"] into the string "x,y,z". I replied that I wasn't aware of one but gave him a ten-line function that would do it. I got a bunch of comments saying that I was an idiot to try to write such a function myself, that the smart thing to do would be to search the web for a library that provides such functions. The phrase "re-inventing the wheel" was used several times. Why is that a good idea? I doubt it took me ten minutes to write the function and, while I didn't test it, I could surely have debugged such a simple function in, what, half an hour? Surely it would take me longer than that to do a Google search for a similar function written by someone else, download it, figure out how to use it, and integrate it into my code. And there'd be no guarantee that it wouldn't have bugs.

    In manufacturing, it's called "make or buy". The right answer is NOT always "buy".

  • Evan (unregistered) in reply to jay
    tharpa:
    Evan:
    tharpa:
    I also don't like Atwood's article at http://www.codinghorror.com/blog/2006/07/separating-programming-sheep-from-non-programming-goats.html. I can imagine a person with programming potential (but who's never seen a line of code before) who's never been taught about assignment, and certainly has never been taught about the perverse way that C-family programmers use the equals sign, who would just see the third line in the code there, would think it was an error and/or that the test givers were morons, and wouldn't be able to get beyond that unless they were given those critical pieces of information.
    To play devil's advocate for a second:

    If you're a hiring manager, do you want to hire someone who might have programming potential if you put in a lot of training, or do you want to decline and wait a bit longer until you get an applicant who can actually demonstrate some amount of programming proficiency already?

    The first could lead to some high rewards, yes. But it's also really high risk. Do you want to take that chance?

    If I understand your point correctly, it is that a test to separate potential programmers from non-potential programmers could have some legitimacy. I do not dispute this. My complaint was about using such a test that used the C-language perversion of the equals sign without an explanation. I would have been consistent in my view that it was an error, and none of the answers clearly addressed that possibility. Upon reading some of the comments to that article, there were quite a few other people who made the same point. Had the writers used a different assignment operator, like :=, or used "Let" syntax, it would have been a completely different question.

    I have two objections to your statement.

    First, in the context of using such a question in a hiring decision, how many people (1) are good programmers and (2) would not understand the code snippet because they've never worked in any language (C, C++, Java, Python, Javascript, Ruby, Basic, etc. etc. etc.) that uses = in that way?

    It is theoretically possible that a competent programmer could have come along and only used (1) imperative languages like Pascal and TI-BASIC (literally the only two I can think of off the top of my head that use something other than = for assignment), (2) other programming paradigms that don't really have assignment (like ML, Prolog, or Factor). But really, what are the chances, especially in this day in age? And even if you find a competent programmer who that applies to, what's the chance that they'll be really good or great, and never have been exposed to = for assignment?

    Remember that, at least many places, the goal of hiring is as much to prevent bad people from being hired as to find great people.

    The second objection is to the study in context. In context, they did it during a course that was explicitly teaching about the material. What they say in the paper* is "So we planned to administer a test just after the students had begun to be taught about assignment and sequence, at the very beginning of their course, then a second time to the same subjects after the topic had been taught, and then a third time just before the examination." My take away from that is that, in other words, those students which received that treatment almost certainly had already seen the notation = for assignment. (Another group was administered the test before seeing any programming instruction, and the authors believe without prior programming experience.)

    Another observation in support of the study is that the authors were less interested in correctness as they were in consistency. If a student guessed wrong on how things worked but appeared to make a similar mistake on all of the questions, they were marked as "consistent" instead of "inconsistent". (For instance, TI-BASIC writes something like "y -> x" for "x := y". If people always interpreted "x = y" backwards, then they were marked consistent. Disclaimer: I'm not sure how this interacts with questions involving statements like "x = 3" where one of the directions is nonsensical.) Final course scores vs consistency on their study test was what the paper was investigating, not final scores vs correctness on their study test.

    On one hand it's not that the study is terribly convincing, for a variety of reasons. (For starters, doing a decent study to answer the questions they were trying to answer is extremely difficult.) On the other hand, like a lot of journalism related to scientific studies, you're responding to a somewhat poor statement of what the study analyzed rather than the study itself.

    • The paper is available online -- search for "the camel has two humps dehandi" -- but I can't link it or my post is marked spam.
    jay:
    Hmm, I just read the cited Atwood article. Maybe I'm missing something here, but if I'm reading this correctly, they gave the students this pre-test without first explaining how assignment in C-like languages works, and then graded students on their ability to guess correctly. This seems really, really pointless to me.
    Like I said before, what you're missing is twofold: (1) they gave their study tests not just before the start of the course, meaning that people weren't (well, "shouldn't" have been) guessing most of the time, and (2) they were not so much looking at correctness.
  • 3Doubloons (unregistered) in reply to tharpa
    tharpa:
    AC:
    jay:
    tharpa:

    If I understand your point correctly, it is that a test to separate potential programmers from non-potential programmers could have some legitimacy. I do not dispute this. My complaint was about using such a test that used the C-language perversion of the equals sign without an explanation. I would have been consistent in my view that it was an error, and none of the answers clearly addressed that possibility. Upon reading some of the comments to that article, there were quite a few other people who made the same point. Had the writers used a different assignment operator, like :=, or used "Let" syntax, it would have been a completely different question.

    Hmm, I just read the cited Atwood article. Maybe I'm missing something here, but if I'm reading this correctly, they gave the students this pre-test without first explaining how assignment in C-like languages works, and then graded students on their ability to guess correctly. This seems really, really pointless to me.

    Now if what he means is that they explained it, and then gave the quiz, and some students couldn't grasp the idea, okay, that's a different story.

    Yes, you are missing something. The article claims there are 3 groups of students. The first one are the students that could make up a consistent model of what those symbols meant. It doesn't matter if they get it right or wrong, just if they can imagine any way in which the questions/answers made sense, and used that to answer.

    This means it doesn't matter if they used "Let a = b" or "a := b" or "a <- b" or whatever. The model students could form may very well change, but the fact that they used one would not.

    Sorry, AC, the students didn't get to pick their operators. They are already there on the test.

    And also, there was no option (as far as I can tell) for those who consistently refused to continue after reading the third line, assuming it to be an error and thus reflective on the whole test.

    What AC meant is that it wouldn't have mattered what the assignment operator is in the test, because the test wasn't checking whether the students had the right answer, but whether they applied the same rules consistently.

    Suppose a student said after

    int a = 10; int b = 20; a = b
    that a = 20 and b = 0, if that student then said after
    int a = 30; int b = 30; a = b
    that a = 30 and b = 0, that student would be consistent, even though that is not actually what the code does. If instead he said a = 60 and b = 30, then he would be considered inconsistent

  • Ronald (unregistered) in reply to Bring Back TopCod3r
    Bring Back TopCod3r:
    Remy Porter:
    My initial instinct was to say, "a fizzbuzz algorithm is way too easy for a coding test," but y'know what? Apparently I'm wrong.

    It's almost a one-liner in a number of different languages.

    Not in java. Well not done properly:

    https://github.com/Mikkeren/FizzBuzzEnterpriseEdition

    https://github.com/Mikkeren/FizzBuzzEnterpriseEdition/blob/master/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage/impl/FizzBuzz.java

    Many issues with this code:

    1. Nothing is pulling information from the cloud (or at least from a RESTful web service) so that can't possibly be right

    2. Does not appear to be serializable and can therefore not be used in a properly scalable architecture

    3. None of the references include anything that seems related to JSON or jQuery, making this code unusable IRL

  • a key in f# minor (unregistered) in reply to levbor
    levbor:
    So on one hand he is totally clueless, doesn't even know what a URL is. On the other hand, he manages to google some sort of answer and to use an IDE?

    Something is wrong here.

    He obviously knew how to use, but didn't know the lingo pertaining to, the Internet Explorer OS.

  • jay (unregistered) in reply to AC
    AC:
    jay:
    tharpa:
    Evan:
    tharpa:
    I also don't like Atwood's article at http://www.codinghorror.com/blog/2006/07/separating-programming-sheep-from-non-programming-goats.html. I can imagine a person with programming potential (but who's never seen a line of code before) who's never been taught about assignment, and certainly has never been taught about the perverse way that C-family programmers use the equals sign, who would just see the third line in the code there, would think it was an error and/or that the test givers were morons, and wouldn't be able to get beyond that unless they were given those critical pieces of information.
    To play devil's advocate for a second:

    If you're a hiring manager, do you want to hire someone who might have programming potential if you put in a lot of training, or do you want to decline and wait a bit longer until you get an applicant who can actually demonstrate some amount of programming proficiency already?

    The first could lead to some high rewards, yes. But it's also really high risk. Do you want to take that chance?

    If I understand your point correctly, it is that a test to separate potential programmers from non-potential programmers could have some legitimacy. I do not dispute this. My complaint was about using such a test that used the C-language perversion of the equals sign without an explanation. I would have been consistent in my view that it was an error, and none of the answers clearly addressed that possibility. Upon reading some of the comments to that article, there were quite a few other people who made the same point. Had the writers used a different assignment operator, like :=, or used "Let" syntax, it would have been a completely different question.

    Hmm, I just read the cited Atwood article. Maybe I'm missing something here, but if I'm reading this correctly, they gave the students this pre-test without first explaining how assignment in C-like languages works, and then graded students on their ability to guess correctly. This seems really, really pointless to me.

    Now if what he means is that they explained it, and then gave the quiz, and some students couldn't grasp the idea, okay, that's a different story.

    Yes, you are missing something. The article claims there are 3 groups of students. The first one are the students that could make up a consistent model of what those symbols meant. It doesn't matter if they get it right or wrong, just if they can imagine any way in which the questions/answers made sense, and used that to answer.

    This means it doesn't matter if they used "Let a = b" or "a := b" or "a <- b" or whatever. The model students could form may very well change, but the fact that they used one would not.

    Hmm, again, just going on what I read in the Atwood article, I don't think that they said that they asked students to invent a notation, but rather that they gave them questions using an existing notation and asked them to guess what this notation meant.

    We're mostly programmers here, so we're already way ahead of these students. Suppose you took a class in some new programming language you had never seen before. And on the first day, you're given a pretest with questions like:

    What is the result after this code sample?

    17 ; x 4 ; y x () y

    (a) x is 4 and y is 17 (b) x is 21 and y is 4 (c) x is 0 and y is pi-squared

    I think such a question is just as fair as what it sounds like these students were given.

    Given that most students are entering the class presumably "knowing" that the equal sign means something very different from the meaning that C gives it, you are not only asking them to guess the meaning, but to guess a meaning that to many will contradict what they already know.

    Like in my example above, I had in mind that the semi-colon is an assignment operator where the value precedes the variable name, and "()" means the same as C "+=", so the right answer is (b). If you think that's bizarre and ridiculous to expect someone to figure out, is it any more bizarre than expecting someone who was taught that "=" is a logical operator giving a result of true or false, to guess that here it indicates assignment? Or to guess that "int" is a data type and that putting it before a variable name indicates the type of the variable? Etc.

    Yes, maybe if you were given a test with 20 such questions, you could study the choices in the answers, look for patterns, and apply inductive logic to determine what the operators must mean. That is, you might be able to come up with a "consistent theory" of how the operators work.

    But wow, that's not an easy problem. Even if you were told the right answer to the first couple of questions, figuring out what the operators mean from the results is not an easy problem. And the students didn't even have that much to go on -- they had a list of possible results for each problem. So they had to piece together, of all the problems and all the possible results for each, if they could come up with a theory that would make exactly one of the possible results for each problem a correct answer. Hmm, I can see this being an amusing logic puzzle, on a par with Sudoku puzzles and problems like "how can you determine which door to open by asking only one true/false question".

  • ThatSlyQuarian (unregistered)

    Honestly, the real problem with that test is the lack of critical reasoning. Assuming people who see int a = 10, int b = 20, a = b, and then assume the test itself is wrong are naive. If anything this test can weed out those thinkers who can't readily adapt to change. If only because they assume the test is wrong, and not there perception of what is being asked. If you look at the way the numbers are introduced its pretty clear what is happening.

    Without using any programming knowledge and just reading the expressions at their words. A equals 10, B equals 20, A equals B. When it askes what they are all someone has to do is read the last statement at face value. A equals B, its a choice. And its simple. But everyone has preconceived notions of what it should be, thats what this test better predicts. Ones ability to throw out his own biases.

    Of course this is assuming the taker assumes the question is valid and has an answer. Even if its not what he might expect. Like a riddle.

  • JJ (unregistered) in reply to tharpa
    tharpa:
    AC:
    This means it doesn't matter if they used "Let a = b" or "a := b" or "a <- b" or whatever. The model students could form may very well change, but the fact that they used one would not.

    Sorry, AC, the students didn't get to pick their operators. They are already there on the test.

    The "they" in AC's comment doesn't refer to the students; it refers to the people who created the test.

  • JJ (unregistered) in reply to JJ
    JJ:
    tharpa:
    AC:
    This means it doesn't matter if they used "Let a = b" or "a := b" or "a <- b" or whatever. The model students could form may very well change, but the fact that they used one would not.

    Sorry, AC, the students didn't get to pick their operators. They are already there on the test.

    The "they" in AC's comment doesn't refer to the students; it refers to the people who created the test.
    Argh. Specifically, the first "they" refers to the people who created the test.

  • Evan (unregistered) in reply to jay
    jay:
    What is the result after this code sample?

    17 ; x 4 ; y x () y

    (a) x is 4 and y is 17 (b) x is 21 and y is 4 (c) x is 0 and y is pi-squared

    I think such a question is just as fair as what it sounds like these students were given.

    Even ignoring the bit about how many of the students were already starting to learn about the results before the first of three test administrations, I strongly disagree.

    First of all, in the declaration lines like int x = 5;, that equality sign pretty much matches up with equality as used in math classes. (Specifically, the "let x = 5" type of equality, or the "defined to be" equality that's sometimes written with, e.g., a triangle over the equals sign.)

    That leaves the assignment use of =. But even there, = as assignment is not totally divorced from the definition of = as people are familiar with -- a correct if somewhat unspecific description of the behavior of "x := y" is that it "makes x == y after the line" (using := and == to be specific about what I mean). While I'll admit to preferring := myself, I mean, = was chosen for assignment in the first place for a reason, and it's not just because "well, I need a symbol and = is as good as any." That's a lot different from just inventing some syntax that doesn't have any familiarity at all.

    I'll be the first to admit that in some ways the familiarity actually makes things harder, because you have to first overcome those misconceptions. But what would those misconceptions lead to if you played them out?

    What would happen if you interpreted those lines more like they were written as "int x = 5; int y = 10; x == y;"? Well, it's basically impossible to imagine every misconception or wrong answer or wrong mental model that students would have. But at least what I'd expect the common result would be if you interpreted the assignment as a comparison would be that you would say that the results are unchanged. Perhaps you would even write a "no it isn't" next to the equality on the test. If you do that consistently, you'd get marked consistent.

    Anyway, I vehemently oppose the closing statement of the abstract ("We point out that programming teaching is useless for those who are bound to fail and pointless for those who are certain to succeed"), but the study really isn't bad in comparison to other "we did this on one or two classes" studies.

  • Evan (unregistered) in reply to Evan
    Evan:
    But at least what I'd expect the common result would be if you interpreted the assignment as a comparison would be that you would say that the results are unchanged.
    What I mean by "the results are unchanged" there is "values of x and y are unchanged by the assignment/comparison", and so for my example you'd say that the final values of x and y are 5 and 10 respectively.
  • (cs)
     HAI
     I HAS A CHEEZBURGER ITZ 1
     IM IN YR LOOP UPPIN YR CHEEZBURGER WILE BOTH SAEM CHEEZBURGER AN SMALLR OF CHEEZBURGER AN 100
    	I HAS A THREE ITZ BOTH SAEM MOD OF CHEEZBURGER AN 3 AN 0
    	I HAS A FIVE ITZ BOTH SAEM MOD OF CHEEZBURGER AN 5 AN 0
    	EITHER OF THREE AN FIVE, O RLY?
    	YA RLY
    	THREE, O RLY?
    	 YA RLY, VISIBLE "FIZZ"!
    	OIC
    	FIVE, O RLY?
    	 YA RLY, VISIBLE "BUZZ"!
    	OIC
    	VISIBLE ""
    	NO WAI
    	VISIBLE CHEEZBURGER
    	OIC
     IM OUTTA YR LOOP
     KTHXBYE
    
  • mag (unregistered) in reply to n_slash_a
    n_slash_a:
    void main() { deque<int> a; deque<int> b; bool remove_duplicates; // populate arrays copy(b.begin(), b.end(), a.end()); sort(a.begin(), a.end()); if (remove_duplicates) { deque<int>::iterator new_end = unique(a.begin(), a.end()); a.resize(distance(a.begin(), new_end)); } // profit? }

    void main and C++ stl mixture... an uninitialized POD in local scope that could result in either a true or false value at runtime... and the copy line is incorrect and throws a runtime error.. jeez.. if you're going to post code on a site like this, at least try to compile and run it

    http://codepad.org/v5O1bExB http://en.cppreference.com/w/cpp/algorithm/copy http://www.boost.org/doc/libs/1_53_0/libs/utility/value_init.htm http://users.aber.ac.uk/auj/voidmain.cgi

    UNLESS this is a huge joke and is something you copied and pasted from a stack overflow question... and if so.. you got me

  • FredW (unregistered) in reply to annon

    Um... typed it in, worked first time. Very inefficient: I think I'll have to replace fizzbuzz with something like this...

    (define l1 '(1 2 3 4 5 6 7)) (define l2 '(1 5 10 11)) (define (merge l1 l2) (cond ((null? l1) l2) ((null? l2) l1) ((< (car l1) (car l2)) (append (list (car l1)) (merge (cdr l1) l2))) (else (append (list (car l2)) (merge l1 (cdr l2)))) ) ) (merge l1 l2) (1 1 2 3 4 5 5 6 7 10 11) (define (nodups l) (cond ((< (length l) 2) l) ((= (car l) (cadr l)) (nodups (cdr l))) (else (append (list (car l)) (nodups (cdr l)))))) (nodups (merge l1 l2)) (1 2 3 4 5 6 7 10 11)

    Stupid, stupid code, glad we are on thedailywtf

  • Avi (unregistered) in reply to jay
    jay:
    I'm surprised that there aren't a bunch of comments saying that Avi is an idiot, and that Fred is smart in googling for code rather than trying to write his own.

    The problem with the interview wasn't that he googled code from the internet to answer a question. I do that all the time myself! The problems were:

    • He said he wrote the code himself, when he didn't.
    • Even if he's admitted that he didn't write it, he didn't understand the code, even to the level of knowing the difference between a constant and a variable (1 vs l).
    • The code did not work.

    As for the URL issue, it wasn't so much that he didn't know what a URL was, it was that he seemed unable to type in a URL that I gave him over the phone. I'd say, "Got to bigboxco.com/ide/H5rt3" and he'd say, "Uh, that didn't work." We tried this 3 or 4 times with different sessions until I just emailed him the URL.

  • mag (unregistered) in reply to Bring Back TopCod3r
    Bring Back TopCod3r:
    Remy Porter:
    My initial instinct was to say, "a fizzbuzz algorithm is way too easy for a coding test," but y'know what? Apparently I'm wrong.

    It's almost a one-liner in a number of different languages.

    Not in java. Well not done properly:

    https://github.com/Mikkeren/FizzBuzzEnterpriseEdition

    https://github.com/Mikkeren/FizzBuzzEnterpriseEdition/blob/master/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage/impl/FizzBuzz.java

    You need to go DEEPER!

    [image]

    ps. I went to your github, but was attracted to porn.xml... now if you'll excuse me..

  • mag (unregistered) in reply to mag

    Oops... it's actually named pom.xml. I have lost interest. Must've been the font.

  • s73v3r (unregistered) in reply to SQLer

    I think the WTF is that Fred thought he could just paste the code into the collaborative IDE, rather than simply type it out, and think the interviewer wouldn't notice.

    CAPTCHA: caecus: Caecus, if he had typed it out, then it wouldn't have all come at once, and the interviewer would be none the wiser.

  • s73v3r (unregistered) in reply to jay

    Both. They gave it before explaining, as kind of a control. Then they explained the concepts, and gave it again.

  • s73v3r (unregistered) in reply to tharpa

    If you thought there was an error, and just refused to keep going, instead of, you know, asking the test administrator what's up, then that's just as bad as not being able to form a consistent mental model.

    And AC's point is that it wouldn't matter what symbol the test used. They could have used a lightning bolt symbol, the outcome should have been similar.

  • s73v3r (unregistered) in reply to jay

    [quote user="jay"][quote user="AC"][quote user="jay"][quote user="tharpa"][quote user="Evan"][quote user="tharpa"]I also don't like Atwood's article at http://www.codinghorror.com/blog/2006/07/separating-programming-sheep-from-non-programming-goats.html. I can imagine a person with programming potential (but who's never seen a line of code before) who's never been taught about assignment, and certainly has never been taught about the perverse way that C-family programmers use the equals sign, who would just see the third line in the code there, would think it was an error and/or that the test givers were morons, and wouldn't be able to get beyond that unless they were given those critical pieces of information.[/quote]To play devil's advocate for a second:

    If you're a hiring manager, do you want to hire someone who might have programming potential if you put in a lot of training, or do you want to decline and wait a bit longer until you get an applicant who can actually demonstrate some amount of programming proficiency already?

    The first could lead to some high rewards, yes. But it's also really high risk. Do you want to take that chance?[/quote]

    If I understand your point correctly, it is that a test to separate potential programmers from non-potential programmers could have some legitimacy. I do not dispute this. My complaint was about using such a test that used the C-language perversion of the equals sign without an explanation. I would have been consistent in my view that it was an error, and none of the answers clearly addressed that possibility. Upon reading some of the comments to that article, there were quite a few other people who made the same point. Had the writers used a different assignment operator, like :=, or used "Let" syntax, it would have been a completely different question.[/quote]

    Hmm, I just read the cited Atwood article. Maybe I'm missing something here, but if I'm reading this correctly, they gave the students this pre-test without first explaining how assignment in C-like languages works, and then graded students on their ability to guess correctly. This seems really, really pointless to me.

    Now if what he means is that they explained it, and then gave the quiz, and some students couldn't grasp the idea, okay, that's a different story.[/quote]

    Yes, you are missing something. The article claims there are 3 groups of students. The first one are the students that could make up a consistent model of what those symbols meant. It doesn't matter if they get it right or wrong, just if they can imagine any way in which the questions/answers made sense, and used that to answer.

    This means it doesn't matter if they used "Let a = b" or "a := b" or "a <- b" or whatever. The model students could form may very well change, but the fact that they used one would not.[/quote]

    Hmm, again, just going on what I read in the Atwood article, I don't think that they said that they asked students to invent a notation, but rather that they gave them questions using an existing notation and asked them to guess what this notation meant.[quote]

    Right. And those that scored well were not those who were simply able to guess the notation correctly, but able to come up with a meaning for the notation (whether that be the actual meaning, or something different), and consistently apply it. That's what they were looking for.

    [quote]We're mostly programmers here, so we're already way ahead of these students. Suppose you took a class in some new programming language you had never seen before. And on the first day, you're given a pretest with questions like:

    What is the result after this code sample?

    17 ; x 4 ; y x () y

    (a) x is 4 and y is 17 (b) x is 21 and y is 4 (c) x is 0 and y is pi-squared

    I think such a question is just as fair as what it sounds like these students were given.[/quote]

    No, it's not. Your code sample is bunk because you're introducing two different operators. The sample in the article has only one. If you were to change your 3rd line to have a semicolon rather than a set of parenthesis, then one could make some kind of inference.

  • Jeff (unregistered)

    Looking up solutions to coding problems on a site actively maintained and reviewed by other programmers is such garbage, all programmers should spend hours inventing their own wheels, amirite?

  • Someone (unregistered) in reply to Jeff
    Jeff:
    Looking up solutions to coding problems on a site actively maintained and reviewed by other programmers is such garbage, all programmers should spend hours inventing their own wheels, amirite?
    It's almost like this topic was addressed from multiple different angles in this thread before.
  • Joe (unregistered) in reply to Someone
    Someone:
    Jeff:
    Looking up solutions to coding problems on a site actively maintained and reviewed by other programmers is such garbage, all programmers should spend hours inventing their own wheels, amirite?
    It's almost like this topic was addressed from multiple different angles in this thread before.

    There's always room for a better wheel. Determining whether you have the time and money to do such is a thing is an entirely different story.

  • Thanatos Complex (unregistered) in reply to Jeff
    Jeff:
    Looking up solutions to coding problems on a site actively maintained and reviewed by other programmers is such garbage, all programmers should spend hours inventing their own wheels, amirite?

    Yeah, copying non-compiling broken code out of a question posted to a site maintained and reviewed by other programmers is way better than actually knowing how to program.

  • Joe (unregistered) in reply to Thanatos Complex
    Thanatos Complex:
    Jeff:
    Looking up solutions to coding problems on a site actively maintained and reviewed by other programmers is such garbage, all programmers should spend hours inventing their own wheels, amirite?

    Yeah, copying non-compiling broken code out of a question posted to a site maintained and reviewed by other programmers is way better than actually knowing how to program.

    Beat me to it.

  • Tangurena (unregistered) in reply to Pat V.
    Pat V.:
    I can't believe he bluffed his way through the initial interview process. You need to get past the buzzwords, unless the people interviewing are equally oblivious.
    I can.

    I have an older friend who is very good with buzzwords. If interviewed by managers, he does extremely well (because he sounds like a manager and uses managerspeak) and gets hired. If interviewed by developers, he does very poorly (because he sounds like the idiots in charge of the developers) and rarely gets hired. He's been a contractor for most of the last 3 decades and is now in his upper 50s. His resume is written so that if you search for keywords, his will come very close to the top. So bascially he's hacked the resume screen and the first interview process.

    What he also does very well is listen to the keywords, buzzwords and new technologies that recruiters are asking for, and only picks up enough on that tech to get through the interview. So if recruiters start asking for SQL Server Object Smoker, he'll read up on it between the time of the request and the interview.

  • allo (unregistered) in reply to jay

    the problem with his code: in his code, = stood for assignment, while he used = instead of == in the question of possible answers, too. So it is really ambiguous, it could even be a trick quesion, that all answers are correct, because they assign the value from the answer to the variables in the answer.

  • Meep (unregistered) in reply to tharpa
    tharpa:
    I think this illustrates one of the risks of evaluating fellow programmers that we see here fairly often - one thinks that the information one uses every day is something that all programmers use every day, and/or is innate.

    Iteration and recursion are fundamental and you can't write a damned thing without them.

    Structured programming is also fundamental and there is no language that does not offer some kind of structure. Yet I constantly see people who just shit out hundred line functions that have no particular purpose.

    Types are also fundamental, and yet I see people who make everything into a damned string, and just pass strings around everywhere.

    And if you're going to claim expertise in Java (or some other OO language) you are implicitly claiming to be familiar with OOP. So when I see you jamming everything into a utility class and not using objects to bundle type and action, it's clear you lied to me about knowing Java.

    I also don't like Atwood's article... I can imagine a person with programming potential (but who's never seen a line of code before) who's never been taught about assignment, and certainly has never been taught about the perverse way that C-family programmers use the equals sign, who would just see the third line in the code there, would think it was an error and/or that the test givers were morons, and wouldn't be able to get beyond that unless they were given those critical pieces of information.

    It's not that they can't get beyond it, it's that their natural intuition is making it harder for them to code, and it will likely always put them at a disadvantage against people who just naturally accept that the symbols in an artificial language simply mean what they do, without their intuition butting in. If I can think less and achieve the same result, I'm going to get to that result faster, or get a better result in the same time.

    I remember I was going door to door canvassing, and I was with one other dude, and we had a map of the houses to visit. This guy could not read a map to save his life: when he was trying to orient himself, he'd start turning around and would turn the map in his hands at the same time. That's an extreme example, but his natural intuition was clearly working against him.

    So if that guy wanted to work as a door to door salesman, he would waste more time getting lost than someone who had a good sense of direction, and that would mean he'd get less sales, and thus less commission. So being able to identify that deficiency would help him make a good decision about what line of work to go into.

  • Friedrice The Great (unregistered) in reply to lolatu
    lolatu:
    tharpa:
    Don:
    I also don't like Atwood's article at http://www.codinghorror.com/blog/2006/07/separating-programming-sheep-from-non-programming-goats.html. I can imagine a person with programming potential (but who's never seen a line of code before) who's never been taught about assignment, and certainly has never been taught about the perverse way that C-family programmers use the equals sign, who would just see the third line in the code there, would think it was an error and/or that the test givers were morons, and wouldn't be able to get beyond that unless they were given those critical pieces of information.
    You may not like it, but they were looking at students before and after instruction. Once assignment has been explained and you still don't get it, well then you aren't going to be a programmer.

    I have interviewed many candidates over the years. Very rarely have the best ones had a CS degree of any kind. I honestly don't care if I see it on a resume. I look at resume, then code samples, then phone interview, if all those go well, then in-person with some programming exercises. Code samples are my main indicator of potential. Of course I go through them with the candidate to make sure it's actually their work (or at least they understand the code thoroughly enough to fake it).

    Best programmer I know personally: degree in Electrical Engineering.

    Best systems analyst I've ever worked with: Ph.D. in Chemistry.

    Takes all kinds!

  • Friedrice The Great (unregistered) in reply to ZoomST
    ZoomST:
    emaNrouY-Here:
    Don:
    Quango:
    ALWAYS test candidates' coding ability. Jeff Attwood's article http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html is six years old and still holds.

    I interviewed one guy who spent over an hour trying to write a FizzBuzz routine. He had a masters degree in CS.

    Masters degree doesn't really mean much. I had someone working with me previously that had a masters in IT from one of the top UK universities. Couldn't even setup a docking station...
    Pshaw! He's a Master's Degree holding developer. Setting up docking stations and doing tech repair grunt work... that's blue collar Union work.

    In all seriousness, a musician doesn't know how to repair a piano, a car owner doesn't necessarily know how to change their oil, and most computer users, developers, database admins must necessarily know how to build or setup the devices they work on (from a hardware standpoint).

    FTFY -- as popular knowledge dictates.

    A friend's father expected him to know how to use a polishing machine he rented just because he just had its degree in CS. Clearly he should wait until he had a Master's Degree!

    People usually expects you to fix their technology (for free) if you had a remotely-related degree. If you were a physician, they'll expect you to check their health (for free as well). Some jobs are almost free of this crap, such as gravedigger or a chicken sexer.

    My wife routinely expects me to know how to do anything in any program she's using, even if I've never heard of or even seen the program before ... and she doesn't have the patience to let me consult the Google oracle.

  • (cs) in reply to FredW
    FredW:
    Um... typed it in, worked first time. Very inefficient: I think I'll have to replace fizzbuzz with something like this...

    <censored>

    Stupid, stupid code, glad we are on thedailywtf

    You deserve to be hunted down by the lisp police and brutally executed for crimes against the one true language...

  • C-Derb (unregistered) in reply to Meep
    Meep:
    And if you're going to claim expertise in Java (or some other OO language) you are implicitly claiming to be familiar with OOP. So when I see you jamming everything into a utility class and not using objects to bundle type and action, it's clear you lied to me about knowing Java.
    I disagree. I know you used the phrase "claim expertise", but it is quite common for some people to know enough about an OO language to solve any problem, without actually using OOP.

    Ever heard of TheDailyWTF.com?

  • (cs) in reply to levbor
    levbor:
    So on one hand he is totally clueless, doesn't even know what a URL is. On the other hand, he manages to google some sort of answer and to use an IDE?

    Something is wrong here.

    I thought he was confused about being asked to use a browser-based IDE?

  • stdio (unregistered) in reply to levbor
    levbor:
    So on one hand he is totally clueless, doesn't even know what a URL is. On the other hand, he manages to google some sort of answer and to use an IDE?

    Something is wrong here.

    you don't need to know the word browser or understand the acronymn url to look things up on the internet

    SideBet: $10 syas he's one of those people who when told to have a look at someting on youtube (:%s/youtube/<insert other site>/g) goes to google, and enters youtube.com in the search box, then clicks the first search result. It really, really pains me when I (frequently) see (admittedly non-technical) people using the internet this way....I'm afraid tehy're gonna overlaod google.

  • The Only One (unregistered)

    You're all idiots.

  • Norman Diamond (unregistered) in reply to ¯\(°_o)/¯ I DUNNO LOL
    ¯\(°_o)/¯ I DUNNO LOL:
    CookbookChef:
    We had two people submit the same answer to one of the questions. Including the typos. A quick online search of the question revealed the web site that provided the answer, which was not even correct.
    That may have been unintentional, but intentionally putting up google-able set of incorrect answers to "homework" interview questions sounds like a great way to have cheater candidates eliminate themselves.
    Wow, that idea is full of win. I wish there were a way for such sites to help cheaters eliminate themselves without also teaching such wrong stuff to readers who genuinely want to learn.

    Meanwhile, the WTF programmer in this story was the 1%. 99% of cheaters do prosper. The meta-WTF is that the WTFs prosper more than we do. thedailymetawtf == thedailywtf.

  • P (unregistered) in reply to almien
    almien:
    Obligatory https://xkcd.com/1185/

    alt-text: "StackSort connects to StackOverflow, searches for 'Sort a list', and downloads and runs code snippets until the list is sorted"

    I would think that if a programmer has the technical knowledge to write StackSort, they probably have the technical knowledge to write the required sort in the first place :)

  • Neil (unregistered) in reply to JPW
    JPW:
    I haven't coded in a while, let's see how I do in Perl.

    Perl array merge

    @combined = @first_array + @second_array;

    Gosh that was hard.

    Let's try a Perl fizzbuzz. Let's use Map just to be a pain.

    @integers = (1 .. 100); map {&carbonate($_)} @integers;

    print @integers;

    sub carbonate{ $n = $_ if ($n %3*5 == 0) {$n = 'FizzBuzz';} elsif ($n %5 == 0) {$n = 'Buzz';} elsif ($n %3 == 0) {$n = 'Fizz';} return $n; }

    Am I hired for succeeding, fired for using Perl, or mocked for some obvious failure in the above?

    TRWTF is not doing it in 1 line:

    print map { $_ % 5 ? $_ % 3 ? "$_\n" : "Fizz\n" : $_ % 3 ? "Buzz\n" : "FizzBuzz\n" } (1 .. 100);
  • Norman Diamond (unregistered) in reply to Bananas
    Bananas:
    ObiWayneKenobi:
    Although it makes you wonder, if the guy was project lead at his old company, COULD he actually code?
    After watching the guy's failed attempt at coding, why would you believe his claim to having been project lead?
    Why? Well because he can't program, and he can't even understand what he's reading. That's why.
  • Hugo (unregistered) in reply to jay
    jay:
    I'm surprised that there aren't a bunch of comments saying that Avi is an idiot, and that Fred is smart in googling for code rather than trying to write his own.

    I don't know how many times I've heard people say that it's ALWAYS better to search the web for code to solve a problem rather than trying to write it yourself, because "why re-invent the wheel?"

    Which analogy always baffles me, because in real life, manufacturers re-invent the wheel in this sense every day, and for very good reasons. It's not like there's one factory in the world that makes exactly one kind of wheel and everybody buys and uses those wheels.

    There are many good reasons to make your own wheels rather than buy from someone else.

    Most obviously, your requirements may be different. A wheel that works well on a child's tricycle may not be ideal for a thousand-ton earth-moving vehicle. For that matter, a wheel that works well on a passenger car may not be the best for a pick-up truck or a race car.

    Even if someone else's wheels would work on your vehicle, it may still be more economical to make your own. You eliminate the other guy's markup, shipping costs, etc. You are not vulnerable to disruptions in his operations -- like if your supplier's employees go on strike, you have no control over the situation, but must wait for them to resolve it while your assembly line grinds to a halt.

    Getting back to the case at hand: Software downloaded from the web is not really "free". Whether we're talking about a complete software package or some small code snippet, the same considerations apply. You may not have to pay the people who wrote it, but it takes time to search the web to find an applicable product or code sample. Then you have to learn how to install, configure, and run it. Then you have to figure out if it really meets your requirements. The more complex the problem is, the less likely that someone else's software EXACTLY meets your requirements, so you have to decide if it is close enough. If the software turns out to have bugs, you have to rely on someone else to fix it. Even if you have the source code, you have to figure out somebody else's code. You may need to integrate it into other code that you have. If software that you found turns out to not be suitable, you have to begin the process all over again.

    I've had a number of times when I was searching for a software product to meet some requirement and I had to review several available products before finding one that was suitable. This process often took days or weeks. For complete, complex software packages, it sometimes took months.

    If the requirement is both very general and very complex, the effort of finding software written by someone else can be well worth it. I would be very, very unlike to write my own database management system to support one application. There are plenty of good DBMSs out there that I could get for far less than the cost of developing my own.

    But at the other extreme, I once got into a strange argument on Stackoverflow where someone posted a question asking if Java had a built-in function to concatenate an array of Strings with some delimiter between them. Like, turn the array ["x", "y", "z"] into the string "x,y,z". I replied that I wasn't aware of one but gave him a ten-line function that would do it. I got a bunch of comments saying that I was an idiot to try to write such a function myself, that the smart thing to do would be to search the web for a library that provides such functions. The phrase "re-inventing the wheel" was used several times. Why is that a good idea? I doubt it took me ten minutes to write the function and, while I didn't test it, I could surely have debugged such a simple function in, what, half an hour? Surely it would take me longer than that to do a Google search for a similar function written by someone else, download it, figure out how to use it, and integrate it into my code. And there'd be no guarantee that it wouldn't have bugs.

    In manufacturing, it's called "make or buy". The right answer is NOT always "buy".

    Damn Straight! A dateClass for a nuclear facility needs to be much more robust than the C# DateTime class what I use to display the timer on my Sudoku solver.

  • Almighty (unregistered) in reply to Evan
    Evan:
    jay:
    What is the result after this code sample?

    17 ; x 4 ; y x () y

    (a) x is 4 and y is 17 (b) x is 21 and y is 4 (c) x is 0 and y is pi-squared

    I think such a question is just as fair as what it sounds like these students were given.

    Even ignoring the bit about how many of the students were already starting to learn about the results before the first of three test administrations, I strongly disagree.

    First of all, in the declaration lines like int x = 5;, that equality sign pretty much matches up with equality as used in math classes. (Specifically, the "let x = 5" type of equality, or the "defined to be" equality that's sometimes written with, e.g., a triangle over the equals sign.)

    That leaves the assignment use of =. But even there, = as assignment is not totally divorced from the definition of = as people are familiar with -- a correct if somewhat unspecific description of the behavior of "x := y" is that it "makes x == y after the line" (using := and == to be specific about what I mean). While I'll admit to preferring := myself, I mean, = was chosen for assignment in the first place for a reason, and it's not just because "well, I need a symbol and = is as good as any." That's a lot different from just inventing some syntax that doesn't have any familiarity at all.

    I'll be the first to admit that in some ways the familiarity actually makes things harder, because you have to first overcome those misconceptions. But what would those misconceptions lead to if you played them out?

    What would happen if you interpreted those lines more like they were written as "int x = 5; int y = 10; x == y;"? Well, it's basically impossible to imagine every misconception or wrong answer or wrong mental model that students would have. But at least what I'd expect the common result would be if you interpreted the assignment as a comparison would be that you would say that the results are unchanged. Perhaps you would even write a "no it isn't" next to the equality on the test. If you do that consistently, you'd get marked consistent.

    Anyway, I vehemently oppose the closing statement of the abstract ("We point out that programming teaching is useless for those who are bound to fail and pointless for those who are certain to succeed"), but the study really isn't bad in comparison to other "we did this on one or two classes" studies.

    With everything, there are people boud to fail, people certain to succeed, and a whole host of midlle ground with varying chance of success (or likelihhod of failure)....

    It's like pointers in C. When you first get to see them, they make no sense at all. The syntax seems contradictory almost because you first declare it a pointer using the asterisk saying: char *fred; and later assign that location a value, using the same asterisk: *fred = 'a'; Then we throw an ampersand in for good measure, and the poor student is so hideaously confused.

    However, as you use them, you get used to how they work, and evenutally you realise that their syntaxt is quite lokical, and actually makes a lots of sense....

    Or maybe it's nopthinkg the same, I forget what I was talking about.

Leave a comment on “Cheaters Never Prosper”

Log In or post as a guest

Replying to comment #:

« Return to Article