in reply to Re: Module Bloat and the Best Solution
in thread Module Bloat and the Best Solution

we're above copy/paste programming, aren't we?

What do you think that means?

Because to me, it's an almost entirely meaningless statement.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re^2: Module Bloat and the Best Solution

Replies are listed 'Best First'.
Re^3: Module Bloat and the Best Solution
by bart (Canon) on Nov 12, 2007 at 18:49 UTC
    Copy/paste programming, as I understand it, is looking up code where you did something similar, copy and paste it into your script, and then edit what needs to be different.

    If you need to do this, this shows to me that there's something wrong with the language you're using, or at least, with the way you're using it. A sign of weakness — especially if that's the best way to do it.

      So, is it copy/paste programming if I use for my $i ( 1 .. 10 ) { in two different programs?

      Should I do that as:

      use Useful::For qw[ ForRange ]; ForRange \my $i, 1, 10, { print $$i; }

      ?

      How about a Useful::If, and a Useful::While and a ...

      Of course, now all our programs have to start with:

      use Useful::For qw[ ForRange ]; use UseFul::If; use UseFul::While; ...

      But that is so repetative. That has to be a candidate for a module right!

      use Useful; Use qw[ For If While ]; ...

      But hang on. We lost the ability to select individual routines from each module. We have to fix that, so:

      use Useful; Useful { For => qw[ ForRange ], If => qw[ :all ], While => qw[ :all ], };

      Better, but still a lot of C&P. How about:

      use Perl qw[ :all ];

      Perfect!


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.