Only want to say

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Jan 12 17:04:14 UTC 2021


On Tue, Jan 12, 2021 at 02:33:23PM +0000, Adam D. Ruppe via Digitalmars-d wrote:
> On Tuesday, 12 January 2021 at 14:02:02 UTC, Jacob Carlborg wrote:
> > * in-contracts are not included in the generated documentation
> 
> I actually tried to solve this in adrdox. It is simple enough to print
> them, but the Phobos contracts tend to be hideous and completely
> unhelpful for understanding the function. So I disabled the feature.
> 
> Some libs, especially those written with the simpler new syntax, are
> much nicer though, so I might try enabling that again.

IMNSHO, if contracts are hideous and unhelpful, then they're not being
used properly.  Contracts are supposed to document (and enforce) what
the caller must fulfill when calling the function; they should be in a
form that's readable and understandable to the user.  Any other
conditions that don't fall in that category belong as asserts in the
function body, not in the contract.


T

-- 
Don't modify spaghetti code unless you can eat the consequences.


More information about the Digitalmars-d mailing list