emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tomas@tuxteam.de
To: Marcin Borkowski <mbork@mbork.pl>
Cc: emacs-orgmode@gnu.org
Subject: Re: Docstrings and literate programming (good practices?)
Date: Fri, 4 Nov 2022 09:06:40 +0100	[thread overview]
Message-ID: <Y2TIELOw5c9Vr7+L@tuxteam.de> (raw)
In-Reply-To: <87mt976x6f.fsf@mbork.pl>

[-- Attachment #1: Type: text/plain, Size: 1628 bytes --]

On Fri, Nov 04, 2022 at 07:39:04AM +0100, Marcin Borkowski wrote:
> 
> On 2022-11-04, at 06:45, tomas@tuxteam.de wrote:

[...]

> > Ah. Javadoc and their descendants. I tend to call that "illiterate
> > programming"...
> 
> I spat my tea. :-)  Thanks, that's a nice one!

Sorry to hear that ;-P

> Though this _may_ work in some cases.  For example, imagine you divide
> your package into two files – one with user-facing commands and another
> one with internal functions.  If you order the former one carefully, the
> "extract docstrings" might actually work as a documentation.

Yes, of course it's just a tool; but that kind of tool all too often
seduces people to switch to auto-pilot.

How many Doxygen docs have I had which tell me that function so-and-
so takes an int as third argument? I can see that by inspecting the
source! As a bonus, I don't get that much optical fluff and don't
have to go to the browser to look at it.

> Still, a "normal" documentation seems a better (even if more
> time-consuming) options.

Yes, it takes work.

> Also, such docstring-based documentation is still better than none.

That depends on how much work goes into the docstring. This:

  /* add 2 to x */
  x += 2;

is the typical quality you get when you're writing the docs while
waist-deep in the code. If you want good docs, you have to take a
step back and try to put yourself into the mind of someone else
(i.e. "forget" for a moment all the implicit knowledge you have
about that code you've been intimate with for weeks, perhaps for
years). That's not easy :)

Cheers
-- 
t

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  parent reply	other threads:[~2022-11-04  8:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-01 14:07 Docstrings and literate programming (good practices?) Juan Manuel Macías
2022-11-02  7:13 ` Ihor Radchenko
2022-11-02  7:53   ` Dr. Arne Babenhauserheide
2022-11-02 10:43     ` Ihor Radchenko
2022-11-02 12:49   ` Juan Manuel Macías
2022-11-02 13:05     ` Ihor Radchenko
2022-11-02 15:20       ` Juan Manuel Macías
2022-11-03  7:38         ` Ihor Radchenko
2022-11-03 20:54 ` Rudolf Adamkovič
2022-11-04  3:03   ` Samuel Wales
2022-11-04  5:45     ` tomas
2022-11-04  6:39       ` Marcin Borkowski
2022-11-04  7:13         ` Samuel Wales
2022-11-04  8:08           ` tomas
2022-11-04  8:06         ` tomas [this message]
2022-11-04  8:49     ` Ihor Radchenko
2022-11-05  2:07       ` Samuel Wales
2022-11-08  4:10         ` Samuel Wales
2022-11-04 11:45     ` Max Nikulin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y2TIELOw5c9Vr7+L@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=mbork@mbork.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).