user-pic

Grinnz

Subscribe to feed Recent Actions from Grinnz

  • Tom Metro commented on A Date with CPAN, Update #3: Golden Jubilee

    >hardcoding test results has other problems

    We always coach developers to use hard coded test data to the extent practical. When writing tests you have to unlearn a lot of DRY principles. We tolerate a lot more repetition, and factor it out sparingly.

    There are two main reasons why you do this:
    1. Any bit of clever calculation in your test could could be wrong. Hard coded values are easy to hand verify.
    2. Your test should read like an example of how to use your API, and having lots of layers of indirection and data generators makes the code less readable.

  • Buddy Burden commented on A Date with CPAN, Update #3: Golden Jubilee

    > A variant similar to what you added is coming to a future version of Time::Local. PR#15

    It looks like it's there already! I'm looking forward to converting over to using these new functions: timegm_posix and timelocal_posix. Should make my job much easier. :-)

  • Buddy Burden commented on A Date with CPAN, Update #3: Golden Jubilee

    > We always coach developers to use hard coded test data to the extent practical. When writing tests you have to unlearn a lot of DRY principles. ...

    What you're suggesting can be good advice—I certainly agree that repeating yourself in unit tests is often preferable to being too clever in them, for instance—but I don't believe it is always good advice. Unfortunately, I think a proper response is beyond a comment here; perhaps I'll compose a larger blog post on this very topic in order to discuss the pros and cons.

    > Are you not able to explicitly set envir…

  • Diab Jerius commented on Preallocating scalars

    And there's also Acme::SvGrow from back in the day, which uses either Data::Peek::DGrow, or the `push( '.' . $length)` approach.

  • Peter Rabbitson commented on Perl 7 By Default

    I implore everyone to read this post, made just days after the one I am replying to. Among other things, the author who was quite *literally* there, discusses the "success" of the Python3 transition.

Subscribe to feed Responses to Comments from Grinnz

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.