Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Section Dividers - What are your thoughts (POD antipattern)

by LanX (Saint)
on Jun 08, 2020 at 08:59 UTC ( [id://11117809]=note: print w/replies, xml ) Need Help??


in reply to Re: Section Dividers - What are your thoughts
in thread Section Dividers - What are your thoughts

> but using POD for this is better than what you have

The debugger perl5db.pl is a good counterexample to this thesis.

It has a big command loop where the users input is read and the documentation for each command is interspersed for each command section.

The documentation will show up in the same order like programmed and must stay at this chronological position.

This makes refactoring the code extremely difficult. Frankly it's a PITA.

I'm a fan of interspersed function docs with POD, but

  • only use it for external documentation.
  • don't make code position dependend on it
  • remember subs can be moved, linear code normally can't

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^3: Section Dividers - What are your thoughts (POD antipattern)
by Anonymous Monk on Jun 08, 2020 at 09:34 UTC
    The documentation will show up in the same order like programmed and must stay at this chronological position.
    This might make a case for literal programming (write code and documentation in the order one would want to read it, but reorder the code chunks in the order it should run in), but that comes with its own bag of problems and requires trade-offs that one might consider unacceptable.
      You mean Literate Programming and for clarity POD isn't!

      It doesn't allow reordering of doc or code (tangle/weave)

      But Perl has the power of sub-modules* and one could "weave" .pod files instead.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

      *) to structure code

        You mean Literate Programming and for clarity POD isn't!
        Sorry, my mistake. Yes, POD is isn't NOWEB. (I think that you would agree that embedding a literate programming system in /usr/bin/perl would complicate things too much.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11117809]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-03-28 14:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found