Re: Code examples - Mailing list pgsql-docs

From Tom Lane
Subject Re: Code examples
Date
Msg-id 6062.1188866394@sss.pgh.pa.us
Whole thread Raw
In response to Re: Code examples  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Code examples  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-docs
Peter Eisentraut <peter_e@gmx.net> writes:
> Decibel! wrote:
>> Couldn't we come up with some method of specifying code examples in
>> the docs and then having the doc build process actually run those
>> examples and put that into the doc build?

> While that seems very tempting, I think you need manual review to check
> whether the examples make didactic sense.  For example, I seem to
> recall that we had to change some examples about how operator
> precendence or type casting gives unexpected results several times over
> the years because the unexpected results had turned into expected
> results in response to new features.  If you'd just produce the
> documentation examples automatically, you'd be left with quite
> embarrassing nonsense in there.

Well, both my point and Jim's was that trying to compile and run the
code would help to expose such silliness.

In the case at hand, there's another consideration: the examples are
large and are (I believe) intended as working skeletons for real code
development.  They'd be a lot more useful for that purpose if they were
available as actual contrib modules.  C code that's been hacked until
it passes for SGML isn't compilable.

            regards, tom lane

pgsql-docs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Code examples
Next
From: Peter Eisentraut
Date:
Subject: Re: Code examples