Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: How to measure Perl skills?

by Abigail-II (Bishop)
on Mar 23, 2004 at 21:52 UTC ( #339220=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: How to measure Perl skills?
in thread How to measure Perl skills?

I can't think off the top of my head why you wouldn't want strict vars in code you intend to maintain, but I'm sure there is a justification sometimes.
I would care about proper scoping of variables (which also implies using lexicals where lexicals ought to be used). "use strict" doesn't enforce scoping. It's not a magical wand. It's not a requirement to have proper scoping either. A program doesn't become bad (or harder to maintain) if you remove the "use strict" line for a good maintainable program, neither does a bad program become good by the introduction if a "use strict" line.

"use strict" is an aid but it's neither necessary nor sufficient to write good programs. I'd be hestitant to work for anyone who focusses on details, forgetting the overall picture.

Abigail


Comment on Re: How to measure Perl skills?
Re: Re: How to measure Perl skills?
by optimist (Beadle) on Mar 24, 2004 at 19:35 UTC
    Good points. I think I haven't expressed myself very well. As I mentioned before, among the problems with our existing codebase is the fact that most of the data is stored and passed around via (undeclared) globals. This obviously makes the code very hard to understand and maintain. When I try to refactor a chunk of this, the way I start is a search and replace, driven by slapping a "use strict" at the top of one sub at a time, then on the top of the file, and I watch the compiler barf. Getting a clean compile after that doesn't mean the program is now perfect, but at that point at least I can get a better sense of the flow of data, which makes it possible to do more interesting refactorings.
    "use strict" is an aid but it's neither necessary nor sufficient to write good programs.

    In general, yes. Although there is a back-burner project to move a big chunk of the system into mod_perl, and IIRC from the last time I did that, any program that won't compile strict will have some problems when it is moved to a persistent environment.

    I'd be hestitant to work for anyone who focusses on details, forgetting the overall picture.

    Fair enough. In reality, there has to be a major subjective (Is it subjective? It's holistic, at least -- how much do my teeth itch when I read the code? How happy would I be if I had to maintain it? Would I want to rewrite or seriously refactor it first?) component to the evaluation of any hiring candidate. I don't see myself rejecting anyone because of any single, specific thing they wrote, or failed to write.

    Thanks for your comments. You're helping clarify my thoughts on this.

Re: Re: How to measure Perl skills?
by Mur (Pilgrim) on Mar 29, 2004 at 18:46 UTC
    "use strict" is an aid but it's neither necessary nor sufficient to write good programs. I'd be hestitant to work for anyone who focusses on details, forgetting the overall picture.
    I was once "fired" from a short online web programming job for not using strict.

    The guy who'd hired me was himself a Perl programmer, subcontracting this job to me because he had more work than time. I took a day or two to code up a prototype solution for him, and (due to the thinness of his original requirements IMHO) fired it off to him with a "how's this, is it something like what you need?"

    He responded with an expression of horror that my code was missing use strict and use warnings. I was clearly unsuitable to perform Perl programming, for him or anyone else, if I didn't understand this basic principle.

    I guess I would advise fellow Monks to use strict until and unless you know the boss feels otherwise, or trusts you to make the call.

    Or, like Abigail, be prepared to NOT work for them.

    --
    Jeff Boes
    Database Engineer
    Nexcerpt, Inc.
    vox 269.226.9550 ext 24
    fax 269.349.9076
     http://www.nexcerpt.com
    ...Nexcerpt...Connecting People With Expertise

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2014-10-02 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (53 votes), past polls