How I Judge the Quality of Documentation in 30 Seconds (2014)
ericholscher.com
ericholscher.com
1. Get a website: don't use a readme on GitHub.
2. Use Prose: don't generate from source, you need more.
3. Give permalinks for citation purposes
4. Your URL should acknowledge the documentation version and language, for future-proofing
And now for my own opinion:
1. No, not every project finds it rational to put time into creating a website. Especially if they're small. Sometimes, the time is better spent doing dev work than creating a pretty site to satisfy you.
2. Rails' documentation is generated from source, so is Node's. A lot of documentation is. They give accompanying guides, sure, but there's nothing wrong with generating the majority of your documentation from source.
3 & 4. These are nice to have, sure, but not requirements. If a project is small, I'd rather the solo dev spend their free time solving tough problems.
Essentially: if you're judging a whole project in 30 seconds, I think you're the problem and not the developer that spent all their time making a project for you to use. So, go ahead, "close the tab" as many times as you like there. But if you really want to help someone, open a pull request, or at least file an issue in a curteous time.
Short of deliberately not versioning your documentation, it's quite difficult to avoid producing working permalinks.
Generating reference from source is fine, but it's definitely insufficient. Trying to pick up a library or a framework from reference alone is like learning a language solely from a dictionary. Documentation should at least include some general design and architecture elements, and tutorials or commented examples.
Writing accurate documentation mostly requires a thorough understanding of the code, it's one of the least easy things to contribute productively as a newcomer.
I'd much rather the developer did not implement some features (which they took the time to list or maybe even sketch out their intentions for in the documentation), and documented what they did implement thoroughly. That's a much better starting point for contribution than a more or less feature-complete project that needs reverse engineering because there is no documentation at all.
Indeed! There's no better documentation than the code itself.
Godoc —the documentation tool for Go— also generates it from the source code.
Concise and clear, here is an example input [1] and its corresponding output [2].
Except for all the things you need to know in order to use the code. Which are why you still write actual real honest-to-God prose documentation. Or, if you don't, is why I don't bother trying to use your code.
This is not specific to godoc. Most, perhaps effectively all (certainly all the ones I've seen and used), automated code generation tools have a place to put arbitrary prose at the top. The fact that it is so often unused is a developer problem, not a tool problem.
I don't think that's the problem he is talking about. Whether you put your prose in a separate file or as a special comment in a source file is not a relevant difference. Having prose, and having a sensible TOC, is.
Broadly speaking, generated docs tend to be worthless for smaller, well-designed packages, i.e. those where you can browse and read the code+comments in your IDE comfortably. But large and poorly designed packages definitely need generated docs, because their code isn't easily traversed.
Basically I think generated references are a necessary evil. If your project needs them I think that's a wrinkle on the project.
- Most modules don't have intro sections to guide you to where you might want to start looking for the most common tasks. You have to guess the kinds of names they might have chosen for the given tasks. Turns out customizing syntax highlighting is mainly done with setMonarchTokensProvider and not setTokensProvider.
- Many methods or classes have redundant docstrings, like how setLanguageConfiguration[1] says "Set the editing configuration for a language" or setTheme() says "Switches to a theme."
- To find out what you can do with instances of a code editor, you don't click "monaco.editor" in the right sidebar like I kept thinking. Instead, you'd click the create() method on that page, and click through to its return type, which is actually IStandaloneCodeEditor.
- The search field only searches on exact prefixes of the basename. This isn't exactly a generate-from-code problem but a typedoc UI issue that led me to just download the code and use search-in-project instead (within VS Code ironically enough).
Fortunately, for the most common tasks, the Monaco playground[2] and Monarch playground[3] were helpful in pointing me to the right direction. So that offsets some of these annoyances. But I actually switched away from generating bland documentation via typeoc for my app, and started using a custom documentation generator that allows me to structure my app's docs in a way that is more human-friendly.
[0] https://microsoft.github.io/monaco-editor/api/index.html
[1] https://microsoft.github.io/monaco-editor/api/modules/monaco...
[2] https://microsoft.github.io/monaco-editor/playground.html
It's the best way to ensure that the documentation is in sync with the implementation: the developer is more likely to update the readme.md in the same pull request he/she changes the implementation.
On Github, I seldom read the market-y website. I click the "Fork me on Github" link and go to the documentation pages on the source itself. It's the most reliable, in my view.
I work on projects while I travel, and I always force my package manager to download the source (not dist) version of the package.
The readme files are now included in the project, and it's a lot easier to just read them. Add an MD viewer to the IDE to make things easier.
I think that “How I judge someone’s else hours of effort in 30 seconds” is a toxic attitude.
Hell, I've thrown some undocumented projects out there with the intention of cleaning them up later or if it gains traction. I have so many side projects that I couldn't possibly reasonably document them all.
If your idea of shopping for dependencies is looking at the amount of GitHub stars and the quality of the documentation: you are going to miss some real diamonds in the rough.
It's about how he should best spend his time, which is finite, after all. Paid time even more so.
I evaluate projects by (1) actually reading their source code, (2) looking up their frequency of updates and release packaging, (3) the community interaction of authors and contributors.
The total amount of effort it took to write that blog post could have been spent on submitting PRs to improve documentation of various projects.
Say some random project has 10 stars on github and no commits in the past 2 years. Good documentation and working examples could be the difference between using it and not using it. If you only have a single day to spike the feature, you need to efficiently explore possible solutions.
Obviously, this depends on many factors. How critical is the feature? What are the alternatives? How long would implementing it in house take? And so on.
Here's the documentation for the most recent thing I released:
https://django-registration.readthedocs.io/en/3.0/
And the one before that:
https://pwned-passwords-django.readthedocs.io/en/1.3.1/
Here's the next of my packages that I'm working on, not because the code needs work but because the documentation isn't up to my standards anymore (in fact, I'm doing a rolling refresh of all my personal packages right now):
https://webcolors.readthedocs.io/en/1.8.1/
I don't expect everyone else to match my output in documentation. I do expect people to write some type of prose documentation covering more than just "here's an auto-generated API reference, good luck", or "here's a README with a couple examples, good luck". And I absolutely treat quality of documentation as a predictor for quality of code, because it tends to be a pretty strong predictor.
Want to tell me how "entitled" I am?
Sorry I didn't notice the provocation until now! You are very entitled, and you overestimate how much time most people have to contribute to open source projects. I'm happy if a FLOSS project even provides moderately recent API docs, which apparently upset you.
For what it's worth, I attribute most of Django's success to its top-notch documentation. I've shipped large Django projects and think it's solid software, and I greatly appreciate your contributions. At the same time I recognize that Django won what is essentially a popularity contest. Web frameworks are a crowded space and beginner-friendly docs are required. If I'm open sourcing a library that is the only one of its kind, priorities differ. I don't think you recognize that difference, and you're judging other projects as you would a web framework. Some of the best libraries I've used came with little more than API docs. Selecting open source libraries by the quality of their documentation is a risky practice, to say the least.
So is Eric, who wrote the "entitled" post being complained about.
People who put in the effort to have good documentation are more likely to also be producing good software that's worth the time I'll put into trying to learn it.
And no matter how righteous you want to get here on HN in proclaiming that to be "toxic" and trying to read it uncharitably, I'd bet all the money in my wallet right now that you have 30-second heuristics you use to judge whether a piece of software is worth your time to explore.
> If your documentation is generated from source code, I am immediately skeptical
Looks like another self-important troll. Those statements are just lolwhut.
I'm not going to learn (or force others to learn) a tool to read documentation. Put a /docs folder in the appropriate project directories and have the team that handles it, decide what to put in that (even if it's a URL to somewhere else).
Disregarding existing documentation because you dislike the organization/formatting is such an act of blind ignorance, I'm surprised he thinks he knows anything about it. Documentation is not a solved problem (although it's easier than testing).
> If you included all of the things needed to document a project in source, your code would be unreadable.
That's only because modern IDEs haven't implemented inline-documentation methods yet. One day we'll get companion documents with every sourcefile that will allow developers to read notes and link to associated content from orthogonal comment files.
Doxygen and its ilk are overly focused on generated API documentation extracted from meta-comments and you rarely see them used with well organized manually written text.
I don't know about localization support, but it addresses most of the other issues outlined in the article.
If the project isn't worth the time to document properly, it's self-announcing that it isn't worth using that code. Why would anyone use throwaway code posted on GitHub? Even if it's been written by a "rock star," the risks are too high.
The philosophy of OpenBSD is the correct one, I think: incorrect documentation is a bug and should be fixed with the same energy that is directed toward bugs in code.
If it's only going to be used by you, great! Don't be offended if someone else looks at it and says, no thanks because of the lack of documentation.
Plus some guide to the overall architecture. Now... a pattern language was meant to provide this, but failed. Perhaps, since a program is a theory, to understand the structure of the code, you must understand the structure of the problem/domain... and there's no shortcut. But even if so, a helpful guide seems possible.
Autogenerated docs can help navigate the codebase, but tools can autonavigate just as well. They could show the overall code structure, but don't. They could be in sync, but aren't.
A minimal but complete (all-steps) example, partly to learn from. and build on, and also to assure me that it works.
Idea: I keep kinda expecting the text alongside each file/dir on github to be a comment on that file/dir (instead of its latest commit message). Could be incredibly valuable for navigating a codebase and grokking its architecture. (Though prone to desync.) I also like the format of a commit message for this: <50 char summary line, optional further lines.
code: electronic documentation: edoc
If your service targets non-English speaking countries, 100% you need your documentation translated.
Otherwise - why?
Also, if the project is a library or framework with a public interface, you need both API docs generated from source, and prose docs.
My conclusion was to always strive for brevity and clarity. Say it all, say no more, be clear, and be concise. I now consider a foreign audience that may take significantly longer to understand what I write, they may use translation tools, they may be confused by any "flowery language".
[1] http://slack.writethedocs.org/ [2] https://jobs.writethedocs.org/
However the attitude seems to be very much "learn Chinese/local language or gtfo" from the opposite end wrt localisation ie it is nonexistent. I think devs are really giving up something valuable by not pushing for a global standard language for development.
sure I shouldn't HAVE to learn English and Development at the same time BUT who is developing in my language anyways? no language support, no compiler support,no Unicode support and no readable font support. instead of bootstrapping all of that(an impossible task as there is no requirement and no funding from any sources,i've tried but the govt and general public ranges from apathetic to stubborn on this issue), it was easier for me to learn English. I could have theoretically learnt the language one level up on the linguistic chain but I would eventually hit the same issues as I tried to use the available tools.
Nothing about what to write and how to write it? This is the hard part.
Having it just in the repo as a set of Markdown docs or something is much better, and "the website" is just URLs to those files in GitHub. Same risk of becoming stale as anything else, but no overhead of documentation build and deployment.
Is the `accept-language` header basically dead, these days?
0: Explicitly stateful features such as API endpoints or "logged in as" fields aren't browser differences.
1: The resulting file, not necessarily the TCP stream used to transfer it.
2: Yes, there are exceptions (eg http://canhazip.com/more), but documentation is almost the diametric opposite of being one of them.
I mean, in theory it's great. In practice you always got cringeworthily bad translated versions of the Debian web site.
(A few years ago Debian's German pages got much better)