Design patterns or idioms?

I've been tracking my expenses using plain-text accouting tools for about 10 years now (first Ledger, then Beancount). I mostly have things the way that I want them, but sometimes I encounter a situation where I don't know exactly what to do. Like it says in, you're designing a scheme for how money will flow between accounts, not to mention a scheme to record those flows in different files, and sometimes I can't figure out a design I like. Sometimes I get lucky and find a document online where someone has written up their solution to the same problem, but even when I do, I don't always understand why their solution works and how I could try to tweak it if I wanted to achieve something slightly different.

I feel like many of these resources tend to be "cookbooks", with complete solutions, and of course there are the manuals, which explain the basics of how the tool works. Are there resources that identify and explain the idioms and design patterns of plain-text accounting? I'm thinking of something that is a little bit more architectural-focused than the "this command does this" style of a manual, and also goes a little bit more into the thought process behind the arrangement of accounts than a typical cookbook recipe.

As an example of what I'm looking for. One technique that is sometimes useful is to duplicate money flows. For example, in the Beancount cookbook, Martin does this when tracking 401k contributions. I believe this is also what he is talking about when he makes a reference to "mirror accounting" in the cookbook article about medical expenses. I guess you use this technique when reporting an amount over time is not sufficient. For example, just doing a query to add up the increase in your 401k account over a year is incorrect because it includes gains and dividends as well as contributions, and it might not be feasible to add up the income from your employer's payroll if you have more than one employer in a year. The disadvantage of using a separate currency is that you have to manually ensure that the amount in both currencies matches (i.e. the amount of US401K is the same as the amount of USD you are contributing), since balancing happens only within a currency. I guess you can mitigate this using automation (a Beancount plugin, or Ledger's automated transaction rules) to ensure that the amounts are the same.

I feel like there are other patterns and principles like this that I kind of catch a glimpse of when I read cookbook entries, but often they are obscured by the overall complexity of a solution to a specific problem, or tied to the features of one specific piece of software rather than generalized to plain-text and double-entry accounting as a whole. Is there a good resource for these kinds of things?

submitted by /u/glasserc2
[link] [comments]
This is a companion discussion topic for the original entry at