in reply to Is it me?

I'm having a hazy re-collection that this issue has come up before. I believe the reasoning is that most error checking and such is left out of magazines in the interest of conserving space for the core idea of the article.

-derby

Replies are listed 'Best First'.
Re^2: Is it me?
by chester (Hermit) on Sep 14, 2005 at 18:36 UTC
    It's usually left out of the examples/description/synopsis in modules on CPAN too, probably for the sake of simplicity and clarity. I notice that a lot of the posts here leave it out (probably for the same reason), even by people who I'm sure use them when they write real code. It would say it depends on the nature of the code; is it demonstration, or is it meant to be used as-is?

    So no, I don't immediately discount code if it's missing a use warnings.

Re^2: Is it me?
by GrandFather (Saint) on Sep 14, 2005 at 23:59 UTC

    In such cases it is generally a good idea to say explicitly that error checking has been omited for the sake of clarity.

    The danger of not including the checking and of not making it clear that there should be error checking, is that such code becomes the example that people follow.


    Perl is Huffman encoded by design.