News for hackers. Stuff that matters.
Re:Writing docs well: why should a software engineer care? by ilyt on Friday November 25, 2022 @06:20AM (#33741349)
I do despise how little there is of examples in most of the docs. Go had a right idea of integrating example code into tests so not only there is one way to add example code, it is also guaranteed to be runnable.

It also have side effect of forcing developer to use their own interface they gave to users so they might notice it is shit before people start to complain (or leave defeated and search for different lib)

Re:Writing docs well: why should a software engineer care? by wbeckler on Friday November 25, 2022 @10:13AM (#33743065)
There's a framework to do this in most major languages. I think python started this with TestDoc.