Posted on 2008-06-24 17:00:11-07 by jkeenan1
Scope creep limits usefulness of File-HomeDir

I see that as of November 2006, the scope of File::HomeDir has greatly expanded:

0.60_04 Thu 2 Nov 2006 Stephen Steneker stennie@cpan.org
- win32: add support for my_pictures, my_videos
- darwin: add support for my_music, my_pictures, my_videos
- Skip "root" tests on darwin, not supported - add POD docs with examples for o/s specific implementations

This is unfortunate, because this scope creep burdens File::HomeDir with excessive, OS-specific dependencies -- which in turn creates unnecessary dependencies and complications for those CPAN distributions that have File::HomeDir as a prerequisite. Here is an actual use case.

About two weeks ago, following a re-install of MAC OS X on my laptop, I had to reinstall all the CPAN distributions I had previously installed using the cpan shell. I wanted to install David Golden's CPAN::Reporter. I've long been interested in xdg's work in this area, but was always skeptical of the fact that it sits atop a pile of dependencies on other non-core CPAN distributions not under the author's control -- which have dependencies of their own.

Nonetheless I proceeded to install CPAN-Reporter via cpan. When asked whether I wanted to install the dependencies, I said "Yes" repeatedly but with increasing concern each time. When it came time to install File-HomeDir, I said "Yes" -- only to learn that I was now installing the Mac::Carbon modules. While these modules may be necessary for location of many useful directories on Mac OS X, I know they are not needed for the location of a user's home directory on that system. Mac::Carbon apparently includes XS code, so all of a sudden I saw C compilation going on. Why I wondered, was any C compilation needed for CPAN-Reporter?

Then things got really weird. My iBook G4 started talking back to me! I heard voices saying, "Mac Carbon" and "antidisestablishmentarianism." I didn't realize what was happening at first and thought my computer had somehow contracted a virus. I immediately hit Control-C to abort the installation process.

Net result: I never got CPAN-Reporter installed. In this case, File-HomeDir violated the "principle of least surprise" in more ways than one. I am now going to be skeptical of any CPAN distribution which has File-HomeDir as a dependency.

Direct Responses: 8168 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.