Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^6: Writing a better Modern::Perl

by EvanCarroll (Chaplain)
on Oct 07, 2010 at 18:37 UTC ( #864065=note: print w/ replies, xml ) Need Help??


in reply to Re^5: Writing a better Modern::Perl
in thread Writing a better Modern::Perl

Lets ignore Moose for the time being... Why do you chose not to use autodie, or indirect, or namespace::autoclean, or even mro "c3" is it because you don't understand these modules, or that you prefer the behavior without them, or that you just don't care (and should therefore care little if the behavior is changed)?



Update 1: What is "diverse code"? Does someone who refuses to use strict write "diverse code"? How do you feel you don't need these modules, and for the love of god how can a module make your code less "diverse"? And again what the hell does this have to do with nextgen? So far you've attacked having defaults, and using modules: none of this is specific to my pragma.

Update 2: I will again argue that the "diverse" nature of code shouldn't change your definition of bad practices: autodie stops silent failures from a standard library (CORE) that should throw fatal exceptions anyway.. Code run inside of Cron, or Mason pages, or modperl should have this policy/default. I don't think your argument has any more or less merit than picking if you want perl 5.12.0 or 5.0 depending on the task: after all they have different runtime profiles because of their internal sorting routines.


Evan Carroll
The most respected person in the whole perl community.
www.evancarroll.com


Comment on Re^6: Writing a better Modern::Perl
Download Code
Re^7: Writing a better Modern::Perl
by JavaFan (Canon) on Oct 07, 2010 at 18:44 UTC
    As I said, I write diverse code. None of the modules you mention, a majority of my code needs it. And it's unlikely I would ever write a file that needs all the modules your nextgen provides (and the more you add, the less likely it will be). But "use"ing modules you don't need have a negative impact: more dependencies, more chance of bugs, longer load times, more memory usage. More reason to just list the modules/pragmas you use instead of using a set of modules someone else finds convenient.
Re^7: Writing a better Modern::Perl
by JavaFan (Canon) on Oct 07, 2010 at 20:07 UTC
    What is "diverse code"?
    Well, it seems the fast majority of the code you write are OO modules (99% you said). I write OO classes. I write procedural modules. Small ones. Large ones. I also write applications. Throw away applications. Applications that will be reused. Mason pages. Code that's run from modperl. Code that's run from the command line. Code that's run from cron. Code that runs on 5.8.x. Code that runs on 5.12.x.

    Different code has different requirements. Where I may use autodie for a run-once program, I'm less likely to have a need for autodie for a module that sits between a webapp and a database. Whatever you come up with nextgen (or anyone else with a similar module), even if it's ideal for some of the code I write, it cannot be ideal for the majority of the code I write.

    As I said before, the only modules/pragmas that are used in most of my modules are 'use strict; use warnings; use 5.XXX;'. There's nothing else that I use often enough that I want it loaded by default.

      There's nothing else that I use often enough that I want it loaded by default.

      I agree, and that's why I've been reluctant to add anything but autodie to Modern::Perl. My current approach is "it enables features of the core that should be on by default and nothing more".

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://864065]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2014-08-29 00:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls