Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Alias (5735)

Alias
  (email not shown publicly)
http://ali.as/

Journal of Alias (5735)

Tuesday May 15, 2007
09:16 PM

The author of this module is a mindless drone

[ #33283 ]

One of the fundamental problems in code generation systems is that people that use them are looking for the quickest, fastest way to get something done.

Therefore, by mere virtue of using a code generation system, they are disinclined to do things like replace the boilerplate abstracts and such.

I've needed a module starter for myself for a while, and Module::Starter seemed a bit like overkill, since my modules only have a Makefile.PL and Changes files, 2 test scripts and the module itself (with the automation doing the rest of it at release time).

While writing it, I thought I might as well implement certain functionality to make sure I always replace the boilerplate.

So here's what a typical module created by ADAMK::Starter (not going to CPAN) looks like :)

package DBIx::SQLiteSequence;

=pod

=head1 NAME

DBIx::SQLiteSequence - The author of the module is an idiot

=head1 SYNOPSIS

    The author is stupid and forgot to write the synopsis

=head1 DESCRIPTION

The author is a self-professed buffoon who forgot to write the description

=head1 METHODS

=cut

use 5.005;
use strict;

use vars qw{$VERSION};
BEGIN {
                $VERSION = '0.01';
}

#####################################################################
# Constructor and Accessors

=pod

=head2 new

The author is a mindless drone that forgot to write the docs for the new method

=cut

sub new {
                my $class = shift;

                # Create the object
                my $self = bless { @_ }, $class;

                # Check params
                die "CODE INCOMPLETE";

                return $self;
}

#####################################################################
# Main Methods

1;

=pod

=head1 SUPPORT

No support is available for this module, because the author is an
ugly troll that didn't bother to tell you what support is available.

=head1 AUTHOR

Adam Kennedy Eadamk@cpan.orgE

=head1 COPYRIGHT

Copyright 2007 Adam Kennedy <--- boring

This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the
LICENSE file included with this module.

=cut

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • You know, an Acme::Module::Starter might be called for! The POD alone is worth the price of admission.

  • My module start point is just a directory of TT templates that I process with ttree. When I want to change the templates, I don't deal with code. :)

    #!/usr/bin/perl
     
    use Cwd;
    use File::Spec;
     
    my $module = $ARGV[0] || prompt( "Module name> " );
    my $dist   = $module; $dist =~ s/::/-/g;
    my $file   = $module; $file =~ s/.*:://; $file .= ".pm";
     
    my $cwd    = File::Spec->catfile( cwd(), $dist );
     
    system
            join " ",
       

  • To me it comes down to the fact that documentation, commenting code, and cleaning up or "refactoring" code is generally considered the most boring part of IT. So eliminating the boilerplate as you mention would fall under that category. It's just another one of those things that might fall under the category of accumulating "technical debt."

    It's the tradeoff between "quick and dirty"; and elegant. There's been much hoo-ha about how long Perl 6 is taking to be completed; as I've said before I don't min
  • ExtUtils::ModuleMaker is designed to be customizable to your individual preferences. See, e.g., ExtUtils::ModuleMaker::PBP. Would that help?
    • Well, I pretty much have what I want working now, so I'm happy to leave it as is.

      It also means I can add other functionality like auto-commiting to my repository etc.

      So I'm happy for now.