3 ms·
That’s how it works in Python, too. You add text descriptions (docstrings), automatic documentation generated from function/class definitions (comments can add
by acdha 6y ago
That’s how it works in Python, too. You add text descriptions (docstrings), automatic documentation generated from function/class definitions (comments can add prose), and you can run doctests to test things like examples.
See e.g. https://www.sphinx-doc.org/en/master/index.html https://www.sphinx-doc.org/en/master/index.html and https://docs.python.org/3/library/doctest.html https://docs.python.org/3/library/doctest.html
- LeonenTheDK 6y agoVery nice, I'm glad to see it elsewhere. Maybe Elixir even took inspiration (or it's just a plain good idea). I'm really surprised that I had never heard of or encountered it, maybe it's just an accepted part of the ecosystem so no one talks about it and/or I assumed everything was written manually. Also haven't used Python professionally which doesn't help.
- acdha 6y agoYeah, I don't care who came up with it first as much as it spreading widely. We waste far too much time on bad documentation as a field.