in reply to I hate the leading underscores.

I don't use leading underscores. I think it's pretty simple. If it's a public method, it's part of the API. If it's part of the API, it's documented in the POD. Also, if it's documented in the POD, it's part of the API. And therefore, it's a public method. From which follows that no private method is part of the API, and no private method is mentioned in the POD. And any method that isn't mentioned in the POD is a private function.

It all boils down to encapsulation. With proper encapsulation (and documentation), users never need to look at the source to get their programs working correctly. Document well, encapsulate well, and you don't need "leading underscore" conventions (doesn't that smell awfully Hungarian?).

This implies also that I don't use POD::Coverage.

Replies are listed 'Best First'.
Re^2: I hate the leading underscores.
by stvn (Monsignor) on Feb 16, 2005 at 15:05 UTC
    This implies also that I don't use POD::Coverage.

    There is no reason you cannot still use Pod::Coverage. All you need to do is to tell it the methods which you decide are private, and it will skip them. You basically just pass in one (or more) of these options to the constructor:

    private an array of regexen which define what symbols are regarded as private (and so need not be documented)

    also_private items are appended to the private list

    trustme an array of regexen which define what symbols you just want us to assume are properly documented even if we can't find any docs for them

    And of course all these options are available thougth Test::Pod::Coverage as well.

    -stvn
Re^2: I hate the leading underscores.
by Anonymous Monk on Feb 16, 2005 at 12:44 UTC

    That's sort of what I do too. Give the public methods pod and just give the private methods comments. I'd like to just go with that and drop the underscores.