On Fri, 14 Mar 2008, Matisse Enzer wrote:
I'm discussing some potential refactorings at $work at wanted to give an
articulate explanation of the benefits of having package declarations match
file names, so that:
# file is Foo/bar.pm
package Foo::Bar;
One reason is so that when you see a "package" statement, you know what the
corresponding "use" statement would be, and when you see a "use" statement,
you know what the corresponding package is, and have a good clue about the
path path of the file you are importing.
What are other good reasons to have package declarations match file paths?
Because all the other Perl hackers do it that way?
It always amazes me how isolated people or small groups come up with some
completely ass backwards way of doing something, and then can't be talked
out of it.
There's a lot of value in following the existing best practices of the
Perl community as a whole. For one thing, it means you can hire people
with "Perl experience" and they can bring that experience to bear on your
application.
If you insist on reinventing every wheel, you've basically created your
own in-house Perl-like dialect. It _looks_ sorta like Perl, but it's not
Perl.
This argument goes for _any_ language or tool for which there is a
substantial community and history of shared practice.
-dave
/*==========================
VegGuide.Org
Your guide to all that's veg
==========================*/