[bcn-pm] Fwd: What is the "best" code on the CPAN?

Alex Muntada alexm a alexm.org
dic feb 8 01:56:39 PST 2012


Aquesta pregunta a Perl QA m'ha semblat una llista
interessant de temes a tenir en compte per valorar
la qualitat del codi en Perl:

http://www.nntp.perl.org/group/perl.qa/2012/02/msg13099.html

Crec que seria interessant tenir-ho en compte per a
la preparació del curs avançat.

Ahir en Diego va comentar en privat que el 10 de març
li anava bé. Estaria bé saber si la resta no dieu res
perquè ja us sembla bé o si és perquè no podreu o
voleu participar en el curs. Queda poc més d'1 mes...

Salut i Perl!


---------- Forwarded message ----------
From: Jeffrey Thalhammer
Date: Wed, Feb 8, 2012 at 03:29
Subject: What is the "best" code on the CPAN?
To: Perl QA <perl-qa a perl.org>


I'm working with a group of Perl developers with various backgrounds
and skill levels.  We have instituted a fairly effective code
inspection process, but we still get bogged down in debates over what
"good code" is.   Unfortunately, the developers work in isolated silos
and spend the vast majority of the time looking only at their own
code.  So they rarely have an opportunity to see what good (or just
better) code might actually look like.

I want the team to see how to do things right, rather than debating
all the ways to do it wrong.  So for our next code inspection, I want
them to study some "good" code from the CPAN.  So the question is,
which distribution provides the best example.  These are the things I
think I want in such an example (in no particular order):

Object-orientation using Moose.
Prudent use of Perl idioms without being overly clever.
A discernible architecture and clear separation of concerns.
Strong examples of encapsulation / inheritance / polymorphism.
Demonstrates inversion-of-control principles.
Well named variables and subroutines.
Well factored code with minimal complexity.
A clear pattern for extension and reuse.
Useful documentation (e.g. POD, comments).
High-value tests at the functional and unit level.
Perl::Critic compliance (any set of Policies will do).
Effective use of other CPAN modules for routine tasks.
Effective error handling.
Effective use of Roles.
Self-documenting code.
Robust and consistent API.

So in your opinion, which distribution on the CPAN best demonstrates
these qualities?  Or do you think there are other more important
qualities that I should be looking for?  I realize there is more than
one way to do it, so I don't really expect to find the "best" code.  I
just want something I can hold up as strong example that people
(including myself) can learn from and aspire to.

-Jeff


Més informació sobre la llista de correu Barcelona-pm