monger frustration …

Par mc, 27 août 2009 9 h 12 min

Perl is the first real language i used (i learnt to program with pascal and C but my first daily use programs where in perl), that’s right … But it’s wrong i sticked on perl « just because i know it »: I honnestly gave a try to python, ruby, php, lua, i’m abble to write code in C, C++, i read haskell, erlang or java codes.

I Finally sticked on perl after a long time of experiment (and i know that my next langages would be haskell and perl6) because i’m happy to see how it’s possible to write short and readable code when you know perl concepts and rules.

sub clear_session { (shift)->clear[qw< foo bar bang bing >] }
 
$_=2 for my ($a,$b,$c,$d);
 
sub trim_lr { s/ ^ \s* | \s* $ //xg } 
trim_lr for values %author;
 
sub commented_line { / ^ \s* # / }
 
my @lines = do {
    my $filename = 'foo.pl';
    open my $fh,$filename or die "can't open $filename: $!";
    map {
	if (commented_line) { () }
	else { "$. :".uc }
    }
};

… but now … i write code for a big OSS project with tons of lines of code and i realize that all those knowledges are useless because coworkers want you to write « more explicitly » and even the PBP tells you to use the « return » keyword.

sub clear_session { (shift)->clear[qw< foo bar bang bing >] }

becomes

sub clear_session {
    my $session    = shift;
    my @attributes = ( 'foo', 'bar', 'bang', 'bing' );
    return $session->clear(@attributes);
}

Yeah … i trully understand my coworkers because i remember, years ago, i had a poke on those kind of lines before understanding them and want to learn how to write them. I thought for years that the only thing that people missed to love perl is « understanding ». I realize i was wrong: lot of them just don’t like to be concise: they don’t want to understand and they are perfectly right in their point of view.

Now is the day i give up (in koha at least) fighting for spreading perl skills no one care about. A poor (and autoproclamed more readable) perl subset exists: it’s called python … and i’m wondering why i spent so much time to become a monger.

Related posts:

  1. feed your hashref
  2. a MARC mapper in few lines of perl
  3. wb to blogohell …
  4. Class::ISA et généalogie ascendante
  5. Template::Declare::Quickly ?

n commentaire à “monger frustration …”

  1. matts dit :

    plouf

Laisser un commentaire

Panorama Theme by Themocracy