Lurker News
Successful companies institutionalize the knowledge of their employees; this leads to better continuity and faster on-boarding. Things like huge monorepos of useful code, internal tools, process manuals, etc. are example products of this. Young companies tend to depend on the dedication and talent of key individuals, and in maturation, must somehow make the jump to institutionalized knowledge (so that "if someone got hit by a bus" things are ok). What are some successful methods you have used or seen used to accomplish this transition? What are problems you faced (skeptics, opponents, etc.)? I am involved with an organization that is slowly growing, is about to lose key personnel, and is looking to prepare.

Comments (213) 95 threads

Show all comments

Showing thread 1 of 95

mattlondon4 replies#
Store readme markdown files in the sourcerepo along with the code itself. Make sure during review that changes to code are reflected in the markdown.

Doesn't need to be exhaustive docs - usually just a high- to medium-level explanation of what why and how goes a long way.
Controversial/surprising/confusing choices should be documented in several places - e.g. in the readme, in a bug/ticket, in the check-in comments and also a comment in the code referencing the readme/bug/ticket for more info.
Over-communicating the confusing/surprising stuff helps a lot and helps to prevent the "what the hell is this crap? Let's rewrite it" issues since there is a long paper-trail explaining why things were done that way. Putting code comments referencing bugs/tickets etc (ideally with clickable links direct to Jira or whatever - e.g. "// This does - see the discussion in http://bug tracker/12345678" ) means that the trail starts right there in the code, and people have not had to trawl through some nonsense wiki to find the hidden nugget of info (let's face it - we'll read code but hardly ever go out of our way to find and read wikis etc first)

m0zg2 replies#
This is what I do. And if the Markdown file is not near the code in question, it's a 100% guarantee you've wasted time writing it because nobody is going to read it.

I also write comments first when writing complex code and then fill in the code in between. More than once this helped more than any documentation could, because people do not read documentation if they can avoid it, and avoid it they'll try.

AmericanChopper3 replies#
I’m also a big markdown-in-source advocate. However it’s major shortcoming is that it’s not accessible enough for non-technical teams to maintain.
fsloth10 replies#
I don't know what the infatuation with markdown is beyond web publishing. Wysiwyg documents have been a solved problem for decades. Use what works on your platform.

Markdown is fine until you realize you would like to have figures, images and tables.
I don't want to spend my time over trite details of a text based markup when I could spend it actually productively.
At that point it's way over easier to use a text processing document of choice (word or open office). I say this as a enthusiast of text based markups over decades from Latex to Markdown.

Continue this thread — 10 replies

MaxBarraclough4 replies#
> major shortcoming is that it’s not accessible enough for non-technical teams to maintain

At the risk of just mirroring my comment above:
Low-level nuts-and-bolts documentation can't be accessible to non-technical people, by nature. Documentation of high-level designs are another matter. Why not use a wiki for the documentation of high-level decision-decisions? A wiki can be accessible to non-technical staff, and it's trivial to link to a wiki page from a comment in source.
It also keeps the source tighter. It negatively impacts readability if the source is full of non-vital comments.

Continue this thread — 4 replies

prepend#
I like processing the markdown through Jekyll to create a web site that is used by both tech and non-tech. So the site is auto generated from the last change by an engineer.
MaxBarraclough2 replies#
> if the Markdown file is not near the code in question, it's a 100% guarantee you've wasted time writing it because nobody is going to read it.

This ignores hyperlinks. Why not use in-code comments for explaining nuts-and-bolts matters (for example, to explain strange-looking platform-sensitive code using #ifdef), and use links to wiki pages for descriptions of high-level design decisions?

dharmab1 reply#
This isn't for comments directly on the source code, it's for higher level stuff like "These are the three services that interact to provide such-and-such functionality. Here's their basic architecture, their dependencies and some basic troubleshooting knowledge/tips."
MaxBarraclough#
Right, but isn't that what I said?
m0zg#
I meant that I do documentation on the side, not in code. In code, I do human readable comments (using a restricted subset of markdown) where things would otherwise be very difficult to understand.

All of this applies uniformly for the code I write for others, as well as code I write for myself.

nelsonic1 reply#
We use the Markdown file method extensively at our company. see: https://github.com/dwyl?&q=learn But just asking/reminding people to capture learning/knowledge in Markdown is not enough to ensure that it actually happens. If the organisation does not have a learning and sharing culture at all levels having markdown files falls apart quite fast! see: https://en.wikipedia.org/wiki/Learning_organization People first need to unlearn what they were taught in formal education. In school we are told not to share our homework with others and the mindset of individualism persists in most workplaces. We need a way to measure and reward people for their contribution to the collective knowledge.
pmontra1 reply#
Doing homeworks together was ok, sharing answers to tests was not. Anyway, the goal there was to score individual students, the goal here is to build something together. Of course some people want to outshine coworkers or try to become not replaceable, so they won't share anything unless forced. This is probably your point.

A way to measure people's contributions could be counting how many times those lines in the wiki were copy pasted to solve problems, but in general it's not easy. We could count commits to markdown but as in code, two lines could be worth more than one hundred.

nelsonic#
Yeah, agreed. But sharing the answers is exactly what is needed in companies/organisations. I've worked in companies where people hoard data and solutions to problems because it gives them power/influence/job-security.

As for tracking commits, if the metric becomes a goal it becomes useless. People will game the system to have more commits, or worse, write a bot to break up their contributions into as many commits as they can get away with.
One line can indeed be worth more than 100 if the line fixes helps fix some production bug. The biggest issue I have is people fixing things and not documenting the fix.
Our metric of "success" for our shared knowledge is how many people outside of our company/org find our stuff useful. But this is not always possible in secretive or highly competitive industries.
Kathy Sierra said "out teach your competitors". https://youtu.be/Dsryx3Ra5pU I totally agree with this mindset. https://headrush.typepad.com/creating_passionate_users/2005/...

Izkata1 reply#
> with clickable links direct to Jira or whatever - e.g. "// This does - see the discussion in http://bug tracker/12345678" )

That does tend to be a great help if people follow it. One problem though: We're on our 3rd tracker since I started at my job. Lots of knowledge in those old cases disappeared because of it.

fsloth1 reply#
I think it's most important that every line changed in production code can be backtracked to a ticket in the "feature management database" whether it's Jira or whatever. This simple rule helps immensely in keeping codebases in good shape.

This is the only clearcut rule that I can think of that is obvious and non-negotiable.
Other things of course make sense (document something in code, other things somewhere else) but are more matters of taste and culture.

oneplane#
We split it out: non-ticketed changes are recorded by forcing commits with specific commit formatting that puts out a changelog at intervals. That gets you a log of changes that can be either tracked back to a ticket or are self-describing.

(public examples are the Angular Commit Message Conventions or the way saltstack uses that stuff https://github.com/saltstack-formulas/.github/blob/master/CO... - you basically enforce some rules using commitlint and record logs using semver, even if you end up not using the versioning for your software)