in reply to Re^4: Meta-perl - sorting my perl subs with perl?
in thread Meta-perl - sorting my perl subs with perl?

POD != comment. The intended audience is different. If you treat them as the same, both sides will suffer.

Comments are for the programmer, that is, the person maintaining the code. POD is there to create a manual. The intended audience is the user of the code. I usually do not document my subs in the same order as they appear in the file, and I typically have quite a number of subs that will not be documented in the user manual. And I want to be able to reorder my subs, or my documentation, without having to reorder the other.

have to duplicate your POD in a comment.
So what? If the goal is to minimize the work you need to do as a programmer, don't write any POD or comments. If the the goal is to create a better product, I don't care if there's some duplication going on. Copy and paste is cheap and easy. (But it will be a selective copy and paste anyway).
  • Comment on Re^5: Meta-perl - sorting my perl subs with perl?

Replies are listed 'Best First'.
Re^6: Meta-perl - sorting my perl subs with perl?
by educated_foo (Vicar) on Jan 23, 2012 at 16:46 UTC
    Not really -- programmer documentation is for the programmer. "C-h f" shows the doc-string. If I want to see what a function does, I type "C-h f"; if I change a function, I edit the doc-string it contains. Emacs also has a manual -- written in the god-awful Texinfo format and updated by hand -- that provides higher-level documentation.

    FWIW, I try to document my modules with POD next to each public function and a higher-level description at the end.

      Who is "the programmer" here? The person maintaining the function? Or the person using the function?

      Two different people. Two different sets of documentation. If it's only available using a specific editor, both people lose.

        Who is "the programmer" here? The person maintaining the function? Or the person using the function?
        Obviously, the programmer is the person editing the function.
        Two different people. Two different sets of documentation. If it's only available using a specific editor, both people lose.
        If you're editing Emacs Lisp in something other than Emacs, you're an idiot.