Live data from Hacker News

Why Write ADRs

github.blog

61–64 of 64 posts

Re: Why Write ADRs

#61
post #12

So this is somewhere between code comments and Confluence pages. Seeing as even comments can get stale, how accurate do these docs stay? The added focus on "why" instead of "what" seems more resistant to cruft.

If comments on the same line (or an adjacent line, such that it shows up in `git diff` output and the default code review display) get stale then that is a pretty bad failure of both the programmer and the reviewer(s); in my experience that doesn't happen very often.

A much bigger issue is comments that are a few lines (or a few tens of lines) away from some piece of what they're talking about. Then, they suffer from exactly the same issue as documentation anywhere, inside the repo or out: something drew the developers attention to the code that needed to be changed, but then there was no reason they should have known to look in this particular other location for text talking about what they changed. That's not the programmer's fault, unless we want our programmers to take the time to review every piece of documentation for anything that might need to be changed. I'd guess there are some contexts where that's appropriate, but I haven't ever worked in one.

Alternatively, we could have it be someone's job to own the docs, continually run over them and make sure they still apply, and stay abreast of PRs as they merge. I haven't seen that tried - it might be valuable if it was a role someone wanted.

What I've been trying is adding cross-references to my code, so that something can always be visible on the line or a neighboring line that notes that there's something relevant in another place. This is then checked in CI for integrity, and references that appear in the diff have their referents surfaced on the PR for the benefit of the reviewer. So far the links are pretty sparse, but have already been somewhat valuable. I intend to piggyback on the same system as I introduce ADRs.

I'd like to release the above tooling as F/OSS but really the trickiest parts are CI integration. The check is literally piping git diff to grep, looking for things of the form ^^{some label} and finding the associated @@{some label}. I decorate the PR on github with annotations through the Git Checks API.

Re: Why Write ADRs

#62
post #57

We use Kanban in my organisation and tickets go through a Analysis phase where the dev spells out the technical details of what they're going to do and then an Analysis review where two other devs will validate the analysis. Then the ticket can move to the implementation phase itself. It may seem a lot of overhead at first but the team is small and tickets go through these two phases fast. The analysis can be conside…

It's related, but I think it's not quite the same thing. It sounds like you are describing the intended design of the feature you're implementing. As I understand it, an ADR may also set policy regarding future features, where they touch an architectural concern.

Re: Why Write ADRs

#63
post #21

I think the fundamental idea behind this is that "every decision must be rationalized", which is fine, but in reality it's difficult to pull off in my opinion. Because people (including myself) are so easily fooled, I'm afraid that it's often the case that we deliberately ignore certain (inconvenient) facts or unconsciously distort things. If we are really trying to rationalize ourselves, the decisions have to be rev…

Not sure about that. Writing software requires heavy rationalization just to get a minimally working system. This is one reason some people aren't cut out to be programmers—they just don't have to patience to deal with the pedantic requirements of implementing cold, hard, unambiguous system logic. I think it's more about documentation of that rationalization, and I wouldn't want to raise the bar on this by requiring…

Rationalization or reasoning? I'm not sure which you're talking about, and the meaning of your text winds up being pretty different in each case. I'm not sure I disagree with either.

Re: Why Write ADRs

#64
post #44

Earlier quoted context omitted.

In that situation, I think the best layout is: - your centralised wiki lists all the repositories and explains what they’re for; - each repository has a detailed commit history, allowing you to understand the thinking behind each line of code. Edit to add: you can search across multiple repos with Github’s “search in organization” feature, and it actually works very well. I usually find that much more useful than sea…

> each repository has a detailed commit history, allowing you to understand the thinking behind each line of code. Ch ch ch changes

"Turn and face the strange" describes the git history of more than one project I've worked on...
Post reply on HN