The author of this module is a mindless drone

Alias on 2007-05-16T02:16:09

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



Lovely!

Ovid on 2007-05-16T06:48:29

You know, an Acme::Module::Starter might be called for! The POD alone is worth the price of admission.

Re:Lovely!

sigzero on 2007-05-16T13:07:50

That is too funny...

Use TT

brian_d_foy on 2007-05-16T16:51:37

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 " ",
        "/usr/local/bin/ttree"        ,
        "-s ~/.templates/modules"     ,
        "-d $cwd"                     ,
        "-define module='$module'"    ,
        "-define module_file='$file'" ,
        "-define module_dist='$dist'"
        ;
 
chdir $dist;
 
( my $base = $module ) =~ s/.*:://;
 
rename
        File::Spec->catfile( 'lib', 'Foo.pm' ),
        File::Spec->catfile( 'lib', $file );
 
sub prompt
        {
        print join "\n", @_;
        print "> ";
 
        my $line = <STDIN>;
        chomp $line;
        $line;
        }

Not surprising considering how programmers think

scot on 2007-05-16T17:29:53

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 mind waiting because I would rather see the finished product be elegant and powerful rather than quick and dirty.

The author of this module is a mindless drone

kid51 on 2007-05-16T19:03:32

ExtUtils::ModuleMaker is designed to be customizable to your individual preferences. See, e.g., ExtUtils::ModuleMaker::PBP. Would that help?

Re:The author of this module is a mindless drone

Alias on 2007-05-17T01:50:46

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.