Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: A Perl aptitude test

by hv (Prior)
on May 02, 2003 at 18:30 UTC ( [id://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

Replies are listed 'Best First'.
Re: Re: A Perl aptitude test
by TheDamian (Vicar) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://255119]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-23 23:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found