introspection (and Perl 6)

Jeff Anderson captvanhalen at gmail.com
Wed Jan 23 17:40:03 GMT 2008


On Jan 23, 2008 12:19 PM, Jonathan Rockway <jon at jrock.us> wrote:
> Anyone have any thoughts on this?

Not really, but i do have thoughts on Dave's words:

> To be blunt, if you're writing perl code for your job, then what you *like* isn't particularly important.

Amen to that. I have learned from recent experience that what I like
is not as important as writing code that fits in with the environment
of people I work with. I try to avoid extremes -- Java/COBOL on one
side and now Perl 6 on the other.*

At my recent place of employment, my boss did not like me using $_,
too many maps, and lack of parentheses in conditions. So, instead of
whining, i took the money and coded to his standard. After a few weeks
of this, i started to prefer being more explicit. I stopped using one
liners with if unless and for -- opting to go ahead and use braces:

print for @tables;

for my $table (@tables) {
    print $table;
}

Because i am no longer coding for myself. Remember -- if you leave
code behind for a few months, you might as well not even own it
anymore. You are not going to look at it and immediately remember what
your thoughts were like you were able to when you were writing it. You
may have written the code, but 3 months later without studying it and
you find that you don't even remember what you did.

So, my advice is stop writing code for yourself -- because you are
going to change. :)

* so much for avoiding extremes ;)


-- 
jeffa


More information about the london.pm mailing list