Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: A Perl aptitude test

by hv (Parson)
on May 02, 2003 at 18:30 UTC ( #255119=note: print w/ replies, xml ) Need Help??


in reply to A Perl aptitude test

I'm not sure how to answer this, because I find it difficult to imagine describing someone who got 3, 5, 6 or 7 wrong as a "fairly decent" perl programmer. 2 and 4 are more difficult, particularly since the candidate needs to guess how much they should say - I'm sure you could write for an hour on either one without exhausting the subject.

But they all seem reasonable questions; the only one I think is a bit unreasonable is #1, because it is code you wouldn't normally ever expect to write except in error. Perhaps more reasonable would be to say something like:

1. This code prints "5". Why is the "+" sign necessary? print +(2 * 3) - 1;

Because of their open-ended nature, I'd also be inclined to put 2 and 4 last, and perhaps keep just one of them: they feel more like "extra credit" questions.

Hugo


Comment on Re: A Perl aptitude test
Download Code
Re: Re: A Perl aptitude test
by TheDamian (Priest) on May 02, 2003 at 22:39 UTC
    the only one I think is a bit unreasonable is #1, because it is code you wouldn't normally ever expect to write except in error.

    I think the problem with the question is that the parens are there only to be "tricky". The error would be more understandable if the parenthesized operation was of lower precedence.

    So I'd have posed the question like this:

    1. The following line of code is an example of a common coding error in Perl:
      print (2 + 3) * 4;
      1. What does the statement print?
      2. Why?
      3. How could you fix it?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://255119]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2014-10-25 00:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (138 votes), past polls