develooper Front page | perl.perl5.porters | Postings from June 2015

Re: [perl #125471] sprintf behavior or documentation bug

Thread Next
June 25, 2015 13:07
Re: [perl #125471] sprintf behavior or documentation bug
Message ID:
> perl's sprintf() formatting mostly follows the C standard where applicable, which states:
>  If the space and + flags both appear, the space flag is ignored.

This is a *much* clearer way to explain it than documenting the combined behavior anew.

Even if the second explanation is fixed to say "nonnegative" rather than "positive," repeating the explanation at all only leaves the reader scrutinizing the two behavior descriptions to see what, if anything, is different.  On the other hand, if you just say that adding a space has no effect on the +, the user will know immediately what to expect--and there's no chance of getting details wrong in the repeated explanation, because there isn't one.

The benefits of modularization are just as applicable to documentation as to code. :-)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About