in reply to Re^4: Should Test::Most import strict and warnings?
in thread Should Test::Most import strict and warnings?

Define "a lot." 5 lines per file and 1 line per function is at worst 150 percent more code (with one-line functions and one-function modules). If you're dumb enough to write code like that, I don't want to use it. If your code imports random modules into my code, I don't want to use it. If you can't either type out your boilerplate of choice or get your editor to do it for you, you probably shouldn't be a programmer.

Your acolytes will use "chromatic::Perl" (evidently a pragma...). Other people don't want your religion.

  • Comment on Re^5: Should Test::Most import strict and warnings?

Replies are listed 'Best First'.
Re^6: Should Test::Most import strict and warnings?
by chromatic (Archbishop) on Feb 09, 2010 at 06:20 UTC
    Define "a lot."

    A non-zero amount of unnecessary, repetitive, boilerplate code. You know, the kind we laugh at Java programmers for having to write because they can't say say 'Hello, world!' without creating classes and class methods and conforming to the proper signature of the main() method in a class of the proper name stored in the proper place in a filesystem hierarchy.

    If you're dumb enough to write code like that, I don't want to use it.

    If you're bad enough at communicating that you have to resort to personal attacks to punctuate your points... well, you're free to use software to which I've contributed anyway, because that's what free software means.

    If your code imports random modules into my code....

    If my code did that, I wouldn't use it either. Fortunately, it doesn't. It does exactly what the documentation says it does. You're also free to read the implementation to see exactly what it does. It's short. It's simple. It's straightforward. Certainly you're more than capable of verifying for yourself what happens.

    If you can't either type out your boilerplate of choice or get your editor to do it for you, you probably shouldn't be a programmer.

    If you don't see the value of removing boilerplate and preventing its spread and ensuring that no one—especially a novice‐ ever has to worry about setting up the proper editor or understanding all sorts of crazy black magic to grovel in an attempt to convince Perl to help him when it's perfectly capable of doing so, well, we have very different ideas about what makes a programming language usable.

    Note, for example, how much more test code people have written in Perl since the advent of Test::More and the removal of "black magic here... don't edit" at the start of every test.pl file you could find on the CPAN circa 2000. That's no coincidence.

    Other people don't want your religion.

    Histrionics have no place in serious discussions of programming.

      If you're bad enough at communicating that you have to resort to personal attacks to punctuate your points...
      Pot... kettle... sigh... There's a certain type of developer who tries to tame complexity by writing lots of tiny classes with one-line methods, and IME they're usually clueless.
      If my code did that, I wouldn't use it either. Fortunately, it doesn't.
      LOLWHUT? Oh... I see we're having a pedantry slap-fight here. No, your code doesn't import modules based on a quantum source of true randomness. But it does "helpfully" import pragmas that you like, but your users may not. IMHO strict is sometimes useful, and warnings is usually more trouble than it's worth, but apparently MHO doesn't count here. In any case, I think "Dogmatic::Perl" is silly, but at least it does one thing -- enforce chromatic's preferences on your code -- and does it well. Having other modules (e.g. Moose, Test::Most) import various pragmas is ridiculous.
      Histrionics have no place in serious discussions of programming.
      Hm... This isn't "discussion of programming"; it's "programming politics," and like all politics, it ain't beanbag.
Re^6: Should Test::Most import strict and warnings?
by Anonymous Monk on Feb 11, 2010 at 17:20 UTC

    Here something from my test suite:

    find t -name *.t -or -name *.pm | wc -l 301

    With strict and warnings included, that's actually six lines of code saved for every file, or roughly 1,800 lines of code I didn't have to write or remember not to forget.

      I hope that, if you insist on adding 6 lines of boilerplate to every Perl file you write, you either (1) have a keyboard shortcut for your boilerplate or (2) create files large enough that 6 lines of typing are insignificant.