Re: Had an interview



andrew.nesterov@xxxxxxxxxxxx wrote:
...
Once I've read a following joke in a programming errs and traps book:

Implement a block that inputs either 1 or 2 and outputs the opposite:
1 -> 2, 2 -> 1
The author continue with three hypotetical solutions:
1. A programming class instructor:
if ( x == 1) x = 2;
if ( x == 2) x = 1;

I don't know why you call it "solution", since it's obviously incorrect.

2. A programmer:
if ( x == 1) x = 2;
else if ( x == 2) x = 1;

That would be a beginner/inexperienced programmer.

A "programmer" would most likely opt for the '?:' operator in this case.

3. A mathematitian:
x = 3 - x;

In reality that would the solution for a _good_ programmer.

--
Best regards,
Andrey Tarasevich
.



Relevant Pages

  • Re: - I A -
    ... flash of inspiration as a joke.. ... > programming and average software speed, and got some very good replies: ... > much people are working on such research projects today. ... This is also why I do wonder why doing it in the kernel is important.. ...
    (freebsd-hackers)
  • Re: A serious question about programmability of jokes
    ... jokes that strictly arise in my real life. ... We human beings also use logic to joke. ... What kind of programming could handle jokes? ... acceptance or rejection of this difference. ...
    (comp.programming)
  • Re: Had an interview
    ... Once I've read a following joke in a programming errs and traps book: ...
    (comp.arch.embedded)
  • Re: Ever had to judge a new to-be-hired in interview?
    ... At one place I was employed, I was the "Director Of Programming". ... Originally it was "Programming Manager" but I made them change the title ... joke that they hoped the printers would have caught or a joke by the ...
    (microsoft.public.vb.general.discussion)
  • Re: Why do we use different files for C ?
    ... If you knew how to take a joke, you would understand how absurd this sentence sounds to me. ... I am actually craving for this ng to start talking about matters of programming. ... Why dont you wip up a post about programming for a change, instead of name calling and you see that the response signal will also increase. ...
    (alt.lang.asm)