Download - Why do so many companies
Why do so many companies
reinvent
well-known CPAN modules badly and end up writing far too much
code?
I'm a
freelancer
I work with
many different companies
Ten years
Sixteen companies
A LOT of code
In many cases
it's like they've never heard of CPAN
CPAN
is
good
CPAN
is Perl's
killer app
Modern Perl programming is (often) just plumbing CPAN modules together
Less code
is good
Less code
that you don't have to maintain
is better
Well-tested code is good
Code that is tested by
hundreds of people on dozens of operating systems is better
Why would you ignore all that ready-written, pre-tested code?
Hold
that
thought
Is it
really
that bad?
A straw poll
Who doesn't use DateTime?
Who doesn't use DBIx::Class?
Who doesn't use Template Toolkit?
We are not
typical
Perl users
We read
use.perl
We read
The Perl Review
We go to
Perl Monger meetings
We go to
Perl Conferences
The average
Perl programmer knows less
about CPAN
than we do
They aren't bad programmers
They just
don't follow
the Perl world
as closely
as we do
Perhaps
their job
involves using many different languages
Perhaps
they have
better things
to do with their
time than reading everything on use.perl
Perhaps
they have
a life
To return to
our question
Why would you ignore all that ready-written, pre-tested code?
Reason 1:
People don't know what is on CPAN
Reason 2:
People don't know what is good on CPAN
Not everyone
knows how to extract the jewels
from the crap
on CPAN
The Perl
Echo Chamber strikes again
Be the
CPAN expert
in your
company
Offer training
sessions on
CPAN modules
Draw your
colleagues
into the
echo chamber
Resistance
is
futile
Reason 3:
Not Invented Here
Some companies prefer
their own code over CPAN code
CPAN code is unsupported
Reason 4:
Legacy Code
Newer modules didn't exist
when code
was written
Fair enough
(of course)
But use the
modern modules
in new
development
Refactor
when you have
the chance
Reason 5:
Older versions of required modules
Can't install DBIx::Class because
DBD::mysql
is three years
out of date
Fear of
updating
key modules
Refresh your installed modules regularly
You do have a trustworthy testing environment
I assume
(Tell management that the older versions are no longer supported)
Reason 6:
Sysadmins
Some sysadmins don't like
to install
modules
from CPAN
They prefer their operating system's own packaging system
(deb, rpm, etc)
Find a repository that packages
CPAN modules
for your
operating system
Learn to package CPAN modules
for your
operating system
Also
Sysadmins
like beer
Some vague and
ill thought out conclusions
CPAN
is
good
Use of well-chosen CPAN modules can dramatically cut the amount of code you need to write
Use of well-chosen CPAN modules can dramatically cut the amount of code you need to write
Use of
CPAN modules cut the code you write
Write
less
code
CPAN code
will be
better tested
than your own code
Everyone needs help finding
the good stuff
on CPAN
Evangelise CPAN
at your company
(I find DateTime is a good
starting point)
Mention CPAN
when talking
about successes with management
Your sysadmin
is your friend
(and often a good drinking partner)
Invite me
to laugh at
(and improve)
your codebase
Dave Cross
Magnum Solutions
[email protected]
http://mag-sol.com