introspection (and Perl 6)
Jonathan McKeown
jonathan+londonpm at hst.org.za
Wed Jan 23 19:45:11 GMT 2008
On Wednesday 23 January 2008 17:13, David Cantrell wrote:
> > On Jan 22, 2008 5:49 AM, Ovid <publiustemp-londonpm at yahoo.com> wrote:
> > > In short, if people can't read the code I write, that's my fault. If
> > > they can't read the language I write in, that's their fault.
>
> I take it that you consider yourself to be reasonably competent in perl
> 5? Good, thought so. Now, what does this do, and how does it work?
>
> #:: ::-| ::-| .-. :||-:: 0-| .-| ::||-| .:|-. :||
> open(Q,$0);while(<Q>){if(/^#(.*)$/){for(split('-',$1)){$q=0;for(split){s/\|
> /:.:/xg;s/:/../g;$Q=$_?length:$_;$q+=$q?$Q:$Q*20;}print
> chr($q);}}}print"\n"; #.: ::||-| .||-| :|||-| ::||-| ||-:: :|||-| .:|
>
> If it's not immediately obvious to you, well, that's your fault for
> being incompetent in perl 5.
I think you're actually proving Ovid's point. I reckon writing code is like
writing prose: having a technical grasp of the language doesn't constitute
competence; you're only competent when you can write comprehensibly. That
doesn't always mean simply - imagine your morning paper written in the style
of the Teletubbies (unless you're a Sun reader, in which case try to imagine
the opposite).
> Yes, that's an obfuscated perl contest entry.
And the Bulwer-Lytton contest for prose has different rules too. So?
Being able to read Perl code is fundamental for a Perl programmer; competence
comes when you can criticise it effectively. ``War and Peace has too many
long words and not enough brightly-coloured pictures'' is a criticism - but
not perhaps a very useful one for most purposes.
Jonathan
More information about the london.pm
mailing list