6 ms·
Making world-class docs takes effort
- z3t4 5y agoDocumentation is underrated. If the documentation is bad I know it will cost 3x or more to implement. Most of the time I do look at the source code, aka "the source code is the documentation", but if the "source code" is 10000 modules with glue code, and there is no documentation - I will not even bother.
- mukundesh 5y agoI hate viewing documentation in a browser, too many distractions. Everyone should distribute docs in a dockset format (https://kapeli.com/docsets https://kapeli.com/docsets).
- nzmsv 5y agoHuh, looks like a modern-day WinHelp. That looks like it's moving in the wrong direction though. I doubt many people want a big completely offline doc blob in this day and age.
- mdaniel 5y agoIn my experience, local copies load appreciably faster and more consistently than CDN-ed, Google Analytics-ed hosted copies I'm beyond livid that Firefox Developer Edition stopped allowing me to paste "jar:" protocol URLs even though it still loads the existing ones I bookmarked just fine
- eddieh 5y agoActually, I wish more projects had installable documentation. Obviously, I don't want WinHelp, but man pages, HTML, and PDFs easily installed to a discoverable place, yes please.
- ofrzeta 5y agoThat's a good opportunity to mention Zeal, an open source Dash alternative: https://github.com/zealdocs/zeal https://github.com/zealdocs/zeal
- kaycebasques 5y agoWholeheartedly agree with the "your docs features examples" principle. For code/APIs there's really two categories of examples: A) minimal, viable, complete snippets that capture a use case [1] and B) end-to-end working example of core use cases tied together. The tricky thing about A is actually figuring out the common use cases and then finding the phrasing that your users would say. I was lucky when I worked on the Chrome DevTools docs because I had a huge record of the problems that people actually faced and how they described them: all the google-chrome-devtools questions [2] on Stack Overflow. For smaller products where obviously you won't have an active Stack Oveflow community, a good source of insight is support tickets. [1] https://stackoverflow.com/help/minimal-reproducible-example https://stackoverflow.com/help/minimal-reproducible-example [2]: https://stackoverflow.com/questions/tagged/google-chrome-devtools https://stackoverflow.com/questions/tagged/google-chrome-dev...
- eddieh 5y ago> Your docs belong in the code repository This is essential. If developers have to hunt down the documentation it will never be updated. It needs to be generated from plain text files in the same repository. Way to many times have I encountered documentation fragmented and outdated split between Confluence, Google Docs, Google Sites, GitHub wikis, network shares, Dropbox, Google Drive, separate git repositories, and other such abominations (MS SharePoint). Treat you docs like code, treat it like it's important, it is the least you can do to even have a chance of producing marginally acceptable documentation, let alone good documentation.
- simonw 5y agoAbsolutely agree. The documentation relating to the code needs to live with that code. The single biggest problem I see with documentation is lack of trust: if people in an organization learn that the documentation is often out-of-date they will stop consulting it, which means the will also stop writing it. The fix for this is for the documentation to live alongside the code, and for code reviews to take that into account: if an implementation change leaves the documentation out-of-date, point that out in the code review and refuse to merge it until the documentation has been updated as part of the same change!
- sokoloff 5y agoTwice in my career I’ve implemented a system to generate “good docs” from source. Twice I’ve failed. I’ve seen several other such initiatives which also failed. In every case, a more friendly editing experience won over the “check it in and type ‘make doc’” experience. That could have been MediaWiki, Confluence, Box notes. People even preferred the abomination that is Sharepoint over a source-based system. If your docs are only written by developers, you might have a chance to make it work. If you need docs to be also written/edited by non-devs, I think you’re looking at an uphill path to get everyone into source control-based docs.
- simonw 5y agoThat's absolutely true: the golden rule of keeping docs with code assumes that the documentation is /about/ the code - class and function descriptions or web API documentation for example. For product-level user-facing documentation written by non-engineers I think it's entirely appropriate to use a different tool.
- simonw 5y agoI love the description here of the "scanner" scripts that run to ensure that everything is documented, and each documentation section includes an example. I've been using a similar approach for my projects for a few years now and it's worked really well: I call it "Documentation unit tests": https://simonwillison.net/2018/Jul/28/documentation-unit-tests/ https://simonwillison.net/2018/Jul/28/documentation-unit-tes...
- ghoward 5y agoOnce again, Daniel has great points. I would just like to add a few: * When documenting API’s, make sure to document preconditions and postconditions, as well an invariants. * Make sure to document guarantees and non-guarantees. Guarantees are things the code must or must not do, where non-guarantees are things that give the code wiggle room and which users cannot rely on, even if they begin to, a la https://xkcd.com/1172/ https://xkcd.com/1172/. * Make sure docs can be tested, just like code. Daniel actually does this for curl docs (later in the post), but he does not list it as a standard. I think it’s a great way to help keep docs up to a high standard.
- kottaram 5y agoMaking anything world class takes effort. /s
- karanssh 5y agoI don't want to be "that" guy, but godoc in Go and how it works forces devs to write docs just beside code, which is one of my favourite things about the language
- blueyes 5y agoDocs are like travel guides. When the underlying reality changes, they need to be rewritten. But most organizations barely make the effort for one good guide, let alone a guide that is rewritten as the code changes. So what happens is, they write a guide, go back to their business, and when a traveler says "hotel X doesn't exist anymore", they delete reference to hotel X. Not a great strategy! What's worse, it's a travel guide written by a real-estate developer. That is, the very people writing the guides are making their own guides outdated.
- fogof 5y ago> Your docs is not extracted from code I don't really understand this. If the documentation doesn't exist next to the code it documents, isn't there a risk that someone will change the code without updating the docs, leading to confusing or wrong docs?