Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which framework should I use to write modules? [closed]

Tags:

What's the best framework for writing modules -- ExtUtils::MakeMaker (h2xs) or Module::Build?

like image 665
Michael Carman Avatar asked Sep 16 '08 15:09

Michael Carman


People also ask

What is a module framework?

A framework is another specialized kind of program module which contains various pre-desinged functionality of code. A framework can be deployed in a form of one or several libraries.

Which is better Django or node JS?

The security of the Django framework is better than that of Node. js because of the fact that it has a built-in system that protects it from any security failure. Node. js is less secure than the Django framework because it needs a manual operation in the system to administer security flaws.

Which is better Django or laravel?

Django comes out on top in terms of speed (thanks in part to the faster Python), scalability and maintenance. Its built-in tools include decorators, SEO tools and third-party libraries. Laravel, on the other hand, is easier to use thanks to its simpler features, and contains strategy infusion as well.


1 Answers

NOTE This advice is out of date. Module::Build has been removed from the Perl core but lives on as a CPAN module. The pros and cons still stand, and my opinions about MakeMaker still stand.


As the former maintainer of ExtUtils::MakeMaker, I like to recommend Module::Build because MakeMaker is a horror show. Module::Build is so much better put together. But those aren't your concerns and I'll present my "least hassle for you" answer.

Executive Summary:

Because Module::Build support is not 100% in place through all of Perl, start with MakeMaker. If you want to do any customization at all, switch to Module::Build. Since their basic layout, options and interface are almost identical this will be painless. As seductive as it looks, avoid Module::Install.

Fortunately, Module::Build can emulate MakeMaker which helps some, but doesn't help if you're going to do any customization. See Module::Build::Compat.

For CPAN releases using Module::Build is fine. There's enough Module::Build stuff on CPAN now that everyone's dealt with getting it bootstrapped already.

Finally, the new configure_requires option lets CPAN shells know to install Module::Build before they can start building the module. Unfortunately only the latest CPAN shells know about configure_requires.

Oh, whatever you do don't use h2xs (unless you're writing XS code... and even then think about it).

MakeMaker Pros:

  • Comes with Perl and used by the Perl core (therefore it is actively maintained and will remain so forever)
  • Everything knows what to do with a Makefile.PL.
  • Most module authoring documentation will cover MakeMaker.
  • Uses make (those who know make can debug and patch the build process)

MakeMaker Cons:

  • Requires make (think Windows)
  • Difficult to customize
  • Even harder to customize and make cross platform
  • Difficult to debug when something goes wrong (unless you understand make)

Module::Build Pros:

  • Easier to customize/subclass
  • Pure Perl
  • Easier to debug (it's Perl)
  • Can emulate MakeMaker in several ways
  • The CPAN shell will install Module::Build for you

Module::Build Cons:

  • The Module::Build maintainers (and indeed all of the Perl Toolchain Gang) hate it
  • Older versions of CPAN clients (including CPANPLUS) don't know anything about Module::Build.

Module::Install Pros:

  • Slick interface
  • Bundles itself, you have a known version
  • Everything knows how to deal with a Makefile.PL

Module::Install Cons:

  • Requires make
  • Always uses bundled version, vulnerable to external breakage
  • Difficult to customize outside its interface
  • Mucks with the guts of MakeMaker so a new MakeMaker release will eventually break it.
  • Does not know how to generate a META file using the v2 meta-spec (increasingly a problem with newer tools)
like image 91
9 revs, 2 users 87% Avatar answered Oct 17 '22 07:10

9 revs, 2 users 87%