return to table of content

Double-entry bookkeeping as a directed graph

dkyc
56 replies
6h10m

I find it a strange choice to explain double-entry bookkeeping with the example of "one entry for Alice, one entry for Bob". That's really not what it's about. It's obvious that a transaction with two parties could be recorded in two places, but to me the crucial point of double-entry bookkeeping is that it requires two entries for each party of the transaction. So if Alice buys book from Bob, four entries are made.

I get that this is supposed to be a simplification for educational purposes, but I find this is simplification is an oversimplification, since it omits the key point.

Octokiddie
35 replies
4h32m

Every explanation of double entry accounting seems to do the same thing. If I'm trying to understand the double part of double-entry bookkeeping, what exactly does the "double" refer to? What's being "doubled"?

How would you salvage the article to actually explain the "double" part in detail? Could you do it purely from Bob's (or Alice's) perspective?

atomicfiredoll
13 replies
4h1m

Remember, this was all done on paper before software with tagging and such existed.

I'll give a description shot, since I've been doing finance work recently. Other people can feel free to correct.

A company using double entry (as opposed to single) has a "chart of accounts." This means they have a bunch of imaginary accounts for tracking everything, including:

- Assets (e.g. cash on hand.)

- Liabilities (e.g. loans)

- Equity (e.g. investments in the company from outside parties)

- Income/Revenue: (edit: as PopAlongKid kid mentioned, I forgot this one. This could include sales revenue, but also things like interest.)

- Expenses (e.g. team lunch or a flight cost)

Some of these "accounts" may map to actual bank accounts: there is likely a liability account for a credit card or an asset account for the company checking.

Knowing all that, every time money is deposited or withdrawn (a transaction) the "double" references the fact that it's recorded in the journal (a.k.a ledger) of two accounts. (Edit: As bregma mentioned, one records where money is coming from and the other where it's going.) Often, an expense is often recorded in the checking "account" and the and the corresponding expense "account." E.g. a flight may be recorded in a travel expense "account," but you also record that the money came from the checking account. Every transaction is recorded in two places.

Beyond just being more accurate than single entry, this helps with important finance reports like Profit & Loss, since you can now see how money is moving around.

Edit: Now that I'm back on my desktop, these are a couple of useful links for understanding basic double entry bookkeeping: Accounting for Computer Scientists [0] and Accounting for Developers, Part I | Modern Treasury Journal [1]. What is a Sample Chart of Accounts for SASS Companies [2] illustrates some charts, which may be helpful for some folks.

[0] https://martin.kleppmann.com/2011/03/07/accounting-for-compu...

[1] https://www.moderntreasury.com/journal/accounting-for-develo...

[2] https://kruzeconsulting.com/startup-chart-accounts/

Fire-Dragon-DoL
6 replies
3h47m

How do you determine which thing goes in which account, is it subjective or there is a formal way with a definition

zie
4 replies
3h4m

In a general sense, it really doesn't matter, as long as you are consistent.

That said, there are accounting standards that define the general set of accounts for a particular industry, etc.

But every person having a set of books will want to customize it to some degree.

For instance in a personal set of books, if you want to track every person you pay, you might have accounts, 1 for every single person you have ever paid, ever.

That obviously can get pretty big! Others might not care that their electricity provider changed from Tootie inc. to Turtle inc, so they just have Utilities:Electricity as their account name.

Others might not care at all, and just have a very general "Expenses" account for things like that.

Make sense?

The important part is consistency of using the same accounts for the same transactions.

Fire-Dragon-DoL
3 replies
2h13m

OK So it is somewhat open but you could use a set of standard accounts, I see.

Makes sense. Probably it's important to keep somewhat of a registers of accounts available to avoid making mistakes and to write directions on where things should go

tomnipotent
1 replies
51m

There's also GAAP in the US and IFRS in Europe, which are standards for how certain things need to be done to be compliant. It's not specific about things like account names or how your ledger should be structured, but outlines many expectations and rules/constraints that build confidence in the resulting numbers.

zie
0 replies
33m

Agreed, but every industry/sector might have their own set of standards that usually are overlays on top of GAAP/etc. For example in the US for state and local governments there is GASB: https://gasb.org

zie
0 replies
30m

Of course! There is a standard term for that: Chart of Accounts

If you search for example chart of accounts <INDUSTRY YOU CARE ABOUT> you can probably get a sample set to work from.

atomicfiredoll
0 replies
3h21m

The chart can differ in different companies or sectors. In my mind, it comes back to what you want to be able to report on.

Some companies may have a larger and more detailed chart of accounts so that they can have very specific breakdowns of things. I've heard of big charts where each of a company's departments have specific accounts and all departmental transactions go there while the rest are lumped into a "Sales, General, and Admin" bucket. (Although I think it's more common to tag transactions with a department code these days?)

That said, categories can be broken down into sub-types beyond Assets/Liabilities/Equity/Income/Expenses. For example, assets are categorized based on how quickly they can be converted to liquid money and if they physically exist. So, under the assets account you may have accounts for current, fixed, and intangible (e.g. trademark or domain name) assets and you would record those appropriately.

Edit: To answer the question more directly, it depends on the company and how they've customized their accounts or guidelines. But, there are general accounting practices that mandate the need for specific things and common questions to be answered, so a lot similar structures and guidance emerge that a company's finance team could use to tell you where something belongs.

m3kw9
1 replies
2h56m

So double entry is defeated if you uses a computer to enter the entries. For example if you brought a laptop for 1000, but you accidently wrote 2000 AND the computer automatically entered 2000 in the asset account it would still balance even though it was a mistake to enter 2000.

In addition, you can still make the same mistake by hand for both entries. So I’m still not getting how double entries catch mistakes

jsty
0 replies
2h50m

When you reconciled the balance in your bank account / credit card statement against that in your set of accounts, you'd notice the error as the statement balance would be 1000 higher than reflected in your accounts.

kqr
1 replies
3h49m

this helps with important finance reports [...] since you can now see how money is moving around.

This is the real benefit I've encountered. Any time I try to "simplify" financial recording for someone else and avoid double-entry, I inevitably end up wanting to perform a query that would be easy in a double-entry system but is not in any other system.

atomicfiredoll
0 replies
3h34m

Right. I didn't mention that a chart of accounts can look different in different companies/sectors. Some accounts may be considered nested (software may even show them as nested.) Then you can roll the totals for all accounts of a type into a general category account like "Assets" or "Expenses." That makes it easier to answer questions like, "how much have we spent in total?"

PopAlongKid
1 replies
3h21m

A company using double entry (as opposed to single) has a "chart of accounts." This means they have a bunch of imaginary accounts for tracking everything, including:

   - Expenses (e.g. team lunch or a flight cost)
   - Liabilities (e.g. loans)
   - Equity (e.g. investments in the company from outside parties)
   - Assets (e.g. cash on hand.)
Not sure why you didn't complete your list by adding "Income".

atomicfiredoll
0 replies
3h16m

Thanks, I was sure I was missing something obvious like that when trying to simplify the explanation.

bregma
5 replies
3h29m

Every time money is exchanged, it has to come from somewhere and it has to go somewhere -- that's two places it need to be recorded (or "entered in the books").

Money can not be created out of thin air, and it can not be destroyed. Every movement of money has to be accounted for, which is why it's called "accounting". Double-entry accounting means you have to account for where the money comes from, and you have to account for where it goes, and each of those is a separate entry and it all has to add up to zero.

Where it can become confusing is when money leaves you or comes in from an external source. There are still two entries, but one entry is in one party's books and the other entry is the other's. For example, I get a paycheque and I enter my income in a little book with green paper and DB/CR columns. At the same time, my employer has entered an expense in their book. Double entries.

m3kw9
1 replies
2h54m

What if your company decides to be generous and just gave 1000 to random Joe, what is the double entry for that?

tromp
0 replies
2h37m

Cash account is credited $1000, and Gifted (or Cash_Gifted) account is debited $1000.

zie
0 replies
3h14m

Where it can become confusing is when money leaves you or comes in from an external source. There are still two entries, but one entry is in one party's books and the other entry is the other's. For example, I get a paycheque and I enter my income in a little book with green paper and DB/CR columns. At the same time, my employer has entered an expense in their book. Double entries.

NO.

I mean your employer probably has a set of books, but that's not true in your own local set of books.

In your local set of books you would have something like:

    ACME, inc Employment Income  $100 DEBIT
    Bank Account                 $100 CREDIT
You are accounting for ACME, Inc's Employment expense in your set of books too.

When you send a payment to your Power Company:

    Power Company Expense: $100 CREDIT
    Bank Account:          $100 DEBIT
I mean if you are categorizing expenses you might do something like that. If you aren't, you might title one account "Expenses" and spend it all there, it doesn't really matter what you call the accounts, just that you are consistent.

randomdata
0 replies
3h14m

> Money can not be created out of thin air, and it can not be destroyed.

Yet accounting is necessary because money is created out of thin air. Money is just the representation of debt, an IOU. There needs to be a record of it in order to know that a debt was created and that a debt was destroyed.

More practically, let's say you give me corn today, and I promise to deliver some of the chickens fed that corn to you after it is ready to for slaughter. Money keeps track of the promise outstanding. We record that promise, or account for it if you will, so that we remember that there is a promise and so that we can later ensure that the promise was delivered upon as agreed. Something that becomes especially important when you realize that promises can be traded on to other people who weren't party to the initial deal. Perhaps you don't really want chicken, but would prefer a watch instead. Luckily the watch maker would like to eat chicken for dinner down the line, so you give him the promise of chicken in exchange for the watch. So on, and so on.

Realistically, double-entry accounting is really quadruple-entry accounting. You record that something was received and you record that a promise was made, then, later on, you record that something was delivered as promised and also record that the promise is no longer outstanding (or in reverse if you are on the opposite end of the transaction). A profit indicates that people still owe you things that you haven't collected upon. A loss indicates that you still owe people things that you haven't yet delivered.

fauigerzigerk
0 replies
3h18m

>Where it can become confusing is when money leaves you or comes in from an external source. There are still two entries, but one entry is in one party's books and the other entry is the other's. For example, I get a paycheque and I enter my income in a little book with green paper and DB/CR columns. At the same time, my employer has entered an expense in their book. Double entries.

I agree with your first two paragraphs but not with this last one. When money leaves you or comes in from an external source, there is always some proxy account for that external party in your own books. And the whole situation is mirrored in the accounting system of the external party (unless they are a consumer). Each party records two entries.

theptip
3 replies
3h40m

It’s a checksum; by decomposing every transaction into a double of (credit A, debit B) that must sum to zero, you catch random arithmetic errors.

You can think of it as “conservation of value”, so you can’t just create money out of thin air in your payment service (credit), without tying it to some account with a corresponding debit.

This originally was intended to protect against typos; eg write a 10 instead of 100, at the end of the day your ledger needs to balance. In software typos are less likely bit it still provides auditability to prevent a large class of bugs from wiping you out.

dragonwriter
2 replies
3h15m

This originally was intended to protect against typos;

Double entry bookkeeping is much older than typing, but, yes, its a check against incorrect entries.

jacques_chester
0 replies
2h34m

Speaking of history, I learned that the word "control" comes from contra rotulus -- roughly "checking against the wheel", which was apparently from an early medieval device for keeping tallies. The second meaning of "domination" came later.

ectopasm83
0 replies
2h47m

Babylonian dogs walking on your clay tablet.

test6554
2 replies
40m

Bob and Alice each have a "money" account and a "books" account. Each money account tracks how much money they have on hand while each books account tracks the total value of their private libraries.

So to be clear, there are 4 accounts. Bob's Money, Bob's Books, Alice's Money, Alice's Books.

Because these two homeless librarians only have money and books, you can add the two balances together for each person to get their net worth.

If Alice owns 3 books worth $120, then the "Alice's Books" account would show a balance of $120. Meanwhile, Bob has 12 books worth $700.

When Alice buys the books, she -credits her bank account $20 and +debits her books account $20 (the value of the new book). Thus her net worth stays the same, but she has more books assets and fewer cash assets.

Similarly Bob -credits his books account $20 and +debits his bank account $20. His net worth also stays the same but he now has more cash than before.

On Alice's way back to the bridge she resides under, it starts to rain. Alice's new book is ruined. She -credit's her books account $20 and her net worth goes down by $20.

Life as a homeless librarian is harsh.

victor106
1 replies
19m

She -credit's her books account $20 and her net worth goes down by $20.

Stupid question maybe.

Is net worth an account too? Where does the debit side of Alice’s credit go?

kaynelynn
0 replies
14m

In a real world example you would be correct. This would fall under the “equity” of the accounting equation assets = liabilities + equity. The equity part can be confusing but is where many of the non obvious second entries end up.

alexambarch
2 replies
4h21m

From what I got out of the article and my own limited understanding of double entry bookkeeping, the "double" seems to be referring to the part where we split a transaction into credits and debits as opposed to a transaction with positive or negative balance. The doubling is happening with the labels we use to describe what's happening with the money.

From an individual account perspective, there's a doubling of the number of columns you could enter a transaction's amount into.

vpribish
0 replies
1h26m

this is probably not true, but I heard that this stuff predates the idea of negative numbers so you have db and cr accounts that offset each other without negatives.

gorjusborg
0 replies
4h5m

The core innovation of 'double entry' is that you can see the flow of money between accounts for every transaction.

This is possible because you (the accountant) are always adding a back-reference from the other account (hence the 'double' in 'double entry').

There's really not much to it. It throws people that are new to it for a loop, I think, because it is a strange way of behaving, and it isn't obvious why you're doing it until you have to track down something that doesn't balance. It's just a disciplined behavior that accountants started using because it allows one to track things that were difficult without it.

bluepencil123
1 replies
4h6m

The 'double' in double entry book-keeping is related only to the book keepers own records/books. It has nothing to do with counter party's record keeping.

If Alice purchases a house worth $100,000 in cash, then 2 (double) accounts will get effected. Her cash account will decrease (Credit) by $100,100 and simultaneously her House equity account (or any other appropriate name such as immovable asset etc) will increase by $100,000 (Debit).

This can be recorded in a 3 column table as

  Credit account -- value -- Debit account
  Cash -- $100,000 -- House equity
In the above transaction, two accounts were effected. Hence the name double entry. This gives a truer picture of ones assets and liabilities.

Note: 1. Debit and credit dont have much to do with increase decrease. 2. A transaction can be modelled to have affect more than 2 account. For example if Alice were to make the purchase with $80,000 loan, then the book keeping could go like

  Credit Lender $80,000
  Credit Cash $20,000
  Debit House Equity $100,000
For the sake of better understanding, if one is uncomfortable with having one record affecting 3 accounts, one can be more robust and split the loan and the purchase into 2 transactions. After all, taking a loan and purchasing a house are 2 different events(transactions).

  Transaction one ->
  Credit Lender $80,000
  Debit Cash $80,000

  Transaction two ->
  Credit Cash $100,000
  Debit House equity $100,000
edit 1: attempt at better formatting

datavirtue
0 replies
2h23m

Don't forget the depreciation, interest, maintenance, and tax accounts if you want to track those against the real estate cost basis for various purposes. You also need to figure out how to create and map accounts to IRS rules or you could put yourself in a real bind when it comes to figuring out tax liabilities or deductions.

insane_dreamer
0 replies
4h23m

Because double-entry accounting requires two (thus "double") entries for each transaction (i.e., Alice buys a book)

- one for the assets/liabilities account involved in sending or receiving the money ($30 credit, bank account) - one for the income/expense account to which the transaction corresponds ($30 debit, "education" expense account)

one of the two entries is a credit and the other a debit

ectopasm83
0 replies
2h49m

Think of a ledger as a list of transactions. Transactions are directed hyper-edges: they are composed of a set of credits and a set of debits. For each transaction, the sum of debits must be equal the sum of credits. "Double-sided" might be a better term. Also a DAG doesn't convey the historical aspect of a ledger, each ledger should be conceived as a sequence diagram lifeline. See temporal graphs: https://teneto.readthedocs.io/en/latest/what_is_tnt.html#add...

Going further with this model, you could introduce the notion of higher-order links between transactions to keep related entries together, for instance to link a correcting transaction to the corrected transaction, grouping recurring payments for a loan together and so on.

You could (should!) model this on top of a bitemporal database to overcome the painful limitation of the event sourcing model, namely that corrections aren't retroactive. Imagine you need to establish due taxes for the past year for certain ledgers in your database, and for some of them you performed corrections to transactions for that fiscal period after the fiscal period ended. With an event-sourced model (a single timestamp for each transaction), the corrections won't impact your tax calculations unless you explicilty track those corrections in your query. But with a bitemporal model (two time axis), you'll be able to record both the time when you made the correction and when it should apply in the past and you'll be able to query your database normally, without even thinking about it. This could also be used to perform corrections that remain invisible to your customers while being fully tracked in your db. Another case were this could prove to be useful is with transactions that are not immediate and can be rolled back. Typically in these situations, you move money from one ledger to a counterpart dedicated temporary outgoing ledger before the transaction is confirmed. This allows you to prevent double spending. Using a bitemporal model, you could get rid of these temporary counterpart ledgers provided you add a status field to your transactions.

Linosaurus
0 replies
3h47m

actually explain the "double" part in detail?

$100 appears in your account. That’s one part. The other part depends on why.

* you moved money from another account, the double is -100 in that account.

* you sold stuff, +100 in income.

* you borrowed some money, +100 in ‘debt’.

In a physical book each of these categories would have a left and right column, and each transaction has numbers in one left and one right column. Or in many columns but the sums of left vs right columns must be the same.

btown
9 replies
4h11m

In all fairness, if you're trying to understand a piece of software like Quickbooks and are not coming from an accounting background, anthropomorphizing each "account" at your company as an individual actor with their own ledger can actually be a helpful mental model. Everything needs to be a dance between actors, and, for instance, when you make a vendor payment in cash, you can only do so as a message sent simultaneously to the Accounts Payable actor and the Cash actor, and each actor must accumulate the effects of that message/event in the way that makes sense. (Namely, each one will translate the event into credits/debits based on the characteristics of who they are, and maintain a balance accordingly. Double-entry, I suppose, means each event must be ingested exactly once by an even number of actors.)

If you're building payment rails, that event might itself be one of a pair of events, sourced from a meta-event tracking the transaction intent. (As a meta-point, I find it much more useful to think of the "graph" in accounting as having edges not made of money, but of data in a derived-event hierarchy.)

And a first step towards being able to have that mental model is ensuring that you have a good mental model of multiple physical-human actors accumulating events in a structured and atomic way.

But the OP doesn't actually make it clear that this is what the analogy is in service of! And I fear that the OP article will cause more confusion than it solves.

Mister_Snuggles
4 replies
4h8m

if you're trying to understand a piece of software like Quickbooks and are not coming from an accounting background

Unfortunately, QuickBooks won't help you understand accounting. It's not a true double-entry accounting system, at least it wasn't the last time I touched it. That said, it still does its job and does it well enough, and real accountants are fine with dealing with it.

Simply Accounting is a better example of a true double-entry system.

chimeracoder
2 replies
2h37m

Unfortunately, QuickBooks won't help you understand accounting. It's not a true double-entry accounting system, at least it wasn't the last time I touched it.

QuickBooks absolutely is a double-entry accounting system. The "bookkeeper" mode abstracts away and hides what's going on under the hood, but if you enter "accountant" mode, you'll see the full ledger, and you can even make direct journal entries to modify it.

Mister_Snuggles
1 replies
1h30m

I must have only ever encountered it in "bookkeeper mode". That abstraction is likely what threw me off!

chimeracoder
0 replies
1h16m

I must have only ever encountered it in "bookkeeper mode". That abstraction is likely what threw me off!

I personally find the bookkeeper mode very confusing, and having observed others (non-accountants) using it to manage small businesses, I think that folks would be better off taking a one-day course in accounting and learning just enough to use it in accountant mode.

You don't have to be a CPA, just literally enough about A = L + E to follow the flow within Quickbooks and record one side of each entry.

PopAlongKid
0 replies
3h25m

It's not a true double-entry accounting system, at least it wasn't the last time I touched it.

Can you elaborate? I've used Quickbooks for over 15 years and it has always been a true double entry accounting system during that time.

fauigerzigerk
2 replies
3h31m

>Double-entry, I suppose, means each event must be ingested exactly once by an even number of actors.)

No, the number of accounts (actors) does not have to be even. The sum of debits and credits has to be equal (or zero if you like).

btown
1 replies
3h24m

You're right - it was a silly thing for me to write! Something more accurate would be that because debits and credits must balance, there is no way to send a message that would only be seen by a single account (other than a no-op); thus, any meaningful transaction will have an impact on at least two accounts.

fauigerzigerk
0 replies
2h0m

Agreed.

em-bee
0 replies
3h57m

anthropomorphizing the accounts is not the problem. the problem is that in the example the two parts of the double-entry are the two partners of the transaction. to anthropomorphize properly alice and bob would be two employees of the company buying a book from a bookstore.

em-bee
8 replies
5h56m

i was about to write the same thing. knowing that double-entry is meant to apply to myself only, i actually found the example confusing, because well, of course bob is going to have an entry in his accounting book, but i don't care about bobs accounts, i don't want to track that. i only care about mine. i buy a book. how do i record this transaction using double entry bookkeeping in my accounting book?

and bob is not even doing any bookkeeping. he is bookselling ;-)

toong
7 replies
4h33m

You gained $20 worth of assets, so the counterpart of the $20 leaving your bank account is countered by your assets-account gaining $20

Now each year your book loses 1/5th of its value, due to wear and tear (4$ disappearing from your assets-account), this is countered by your depreciation-account (4$ tax write off, every year!)

After 5 years, it is worth $0 according to your books, but you manage to sell it again for $10: your bank account gets debited for $10, while your capital-gains-account gets credited for $10

probably_wrong
5 replies
3h0m

And how about food? I can understand a book having a resale value I keep in my books, but once I've eaten the hot-dog I bought it is gone forever.

chimeracoder
4 replies
2h34m

And how about food? I can understand a book having a resale value I keep in my books, but once I've eaten the hot-dog I bought it is gone forever.

Perishable and consumable food wouldn't be counted as an asset in the first place. You spend the money - it's credited to your asset account (reducing the value of your cash-in-hand) and then debited from your expense account (reducing the value of your equity - or, in more layperson's lingo, increasing the total sum of the expenses you incurred during that period).

eviks
3 replies
1h53m

Of course it would be, asset is anything of value, you're confusing with subtypes of assets. Just mujhe liability is anything you owe regardless of for how long

chimeracoder
2 replies
1h5m

Of course it would be, asset is anything of value, you're confusing with subtypes of assets. Just mujhe liability is anything you owe regardless of for how long

If an office buys snacks on Monday for the office party on Friday, they're not counting it as an asset and depreciating it on their books.

If food production or delivery were part of the core business, it would be one thing, but in the context that OP's talking about, it would be overkill at best (and fraudulent, in extreme cases) to try and count a transient consumable as an asset on their books.

eviks
1 replies
40m

Depreciation isn't relevant here, again, you're confused in the types of assets, not all of them are depreciated, only some with some specific properties like time of expected user. Just read the definition of assets in any (accounting) dictionary, or try to record your snack purchase in real accounts and see which side of the balance sheet this account end up in (hint: inventories, assets).

chimeracoder
0 replies
32m

or try to record your snack purchase in real accounts and see which side of the balance sheet this account end up in (hint: inventories, assets).

Yeah, and as I said, this makes sense for a company for which food is a relevant part of their business, but in the context OP is asking about, nobody is tracking it this way.

nolongerthere
0 replies
3h21m

This is the best explanation, everyone else is giving wrong explanations that appear to be at least partially sourced from some AI.

rjinman
53 replies
3h5m

Double-entry bookkeeping is very easy to understand once you ditch the ridiculous "credit" and "debit" terminology.

Essentially, the goal is to keep the accounting equation true at all times. The equation is: Equity = Assets - Liabilities. Eventually, earnings (Income - Expenses) will become part of equity, so splitting that out, you have: Equity + Income - Expenses = Assets - Liabilities. Rearranging to get rid of the minus signs you get: Equity + Income + Liabilities = Assets + Expenses. This equation must be true or something has gone wrong - like money appearing or disappearing out of nowhere. To keep it true at all times, it should be clear that any time you add money to an account on the left side of the equation (say, to an Income account), you must either add the same amount to an account on the other side or subtract the same amount from the same side.

For example, you sell a lemonade for $5. You add $5 to Sales (Income) and add $5 to Current Account (Assets).

The "credit" and "debit" terminology is ridiculous because their definitions swap around depending on which account you're talking about, which is an utterly absurd (mis)use of language and the main reason people find this confusing.

EvanAnderson
15 replies
2h31m

The accounting equation is the right thing to think about. People want debit and credit to mean something more than they need to.

My 100-level accounting instructor said it pretty succinctly: Debit means an entry in the left column. Credit means an entry in the right column. What a transaction means for the business depends on the accounts.

lisper
6 replies
2h5m

Debit means an entry in the left column. Credit means an entry in the right column

But that just shifts the arbitrariness of the whole thing from the words "debit" and "credit" to the words "left" and "right".

EvanAnderson
5 replies
1h59m

I think his intent was to prevent students from fixating on making the words debit and credit "mean" something by themselves. A debit doesn't have some intrinsic meaning about the "flow of money". It's just an entry in the left column. On the other hand, a debit to Accounts Receivable actually means something.

lisper
4 replies
1h51m

A debit doesn't have some intrinsic meaning about the "flow of money".

But it does. "Debit" is an English word with an established meaning in common usage. It means to take money out of an account. It is related to the word "debt" which is something that decreases the net worth of the debtor and increases the net worth of the creditor. If you overpay a bill, the (positive) difference between what you paid and what you owed is a credit on your account, and can be used just like money to pay your next bill.

pessimizer
1 replies
1h38m

If you overpay a bill, the (positive) difference between what you paid and what you owed is a credit on your account

Or it's a debit on the company's account. I think that's the point that was being made; not to confuse technical terms with English common usage, and not to go to the dictionary or etymology(!) as the arbiter. Debits are credits and credits are debits, but the real question is which column does it go into.

Same nature as discussions about clients/servers.

lisper
0 replies
1h8m

Or it's a debit on the company's account.

That's exactly right. They owe you money, so it is (or at least it should be) a credit on your account, and a debit on theirs. But that is not what the definition given in the article says. TFA's definition of "credit" was "An entry that represents money leaving an account" and likewise a debit is "An entry that represents money entering an account." So when you paid your bill, that was (by the articles definition) a credit to your checking account and a debit to your account with company whose bill you were paying, which is exactly backwards. According to the standard English definitions, a credit is something that makes your net worth go up, and a debit is something that makes your net worth go down. So when you pay your bill, that should be a debit to you (cash going out decreases your net worth) and a credit to the counterparty (cash coming in increases their net worth).

Same nature as discussions about clients/servers.

How so? It seems to me that distinction is clear: the client is the machine that initiated the connection, the one that did the DNS lookup.

mhink
1 replies
35m

That's not entirely correct- or at least, it's more complicated than that. The question of whether a debit/credit increases/decreases an account has to do with the kind of account you're talking about.

When I deposit money, it modifies two accounts at the bank:

- the account which represents how much money they owe me - and the account which represents how much money they have on hand.

The former is a liability, and the latter is an asset.

The meaning of debit/credit is reversed between these two types of account. So, when I deposit $100, the entries entered are:

    - CREDIT mhink's account $100 (increasing liability)
    - DEBIT cash account $100 (increasing asset)
Since we only see one side of this, we start to associate "debit" with "less money for me" and "credit" as "more money for me".

Oddly enough, another common financial situation reinforces this interpretation from the other direction: accounts with utility providers. Unlike the bank, your account at the utility company represents how much you owe them. So the meaning of debit/credit is reversed, but so is the direction of responsibility: your account at the utility provider is money you owe them, which is an asset. So when I pay them $100, the entries entered are:

    - CREDIT  mhink's account $100 (decreasing asset)
    - DEBIT   cash on hand $100 (increasing asset)

lisper
0 replies
3m

The problem is that whether something is an asset or a liability depends on your point of view. If I have $100 in cash, that is an asset to me and a liability to the rest of society. If I have a $100 loan, that is a liability to me and an asset to my creditor. So there is no way to say whether something is an asset or a liability in an absolute sense. Every debt is an asset to the creditor and a liability to the debtor.

This has nothing to do with labeling transactions so that the labels conform to the common meanings of English words. When an account representing assets has its balance go up, that is a credit. When an account representing liabilities has its balance go up, that's a debit. If I, say, draw down a line of credit for $100 and deposit the funds in my checking account, then from my point of view, my LoC should debited by $100 (available credit goes down) and my checking account should be credited for $100 (balance goes up).

CREDIT mhink's account $100 (increasing liability)

No. This transaction does not increase liability in any absolute sense. It increases liability only from the bank's perspective. From your perspective, it increases assets.

fauigerzigerk
3 replies
2h7m

And what if there are no columns? Google "journal entries for X" and you're going to find something like this:

  Dr accountX £100
  Cr accountY £90
  Cr accountZ £10
Left and right was fine when T accounts were universally used to record entries, but that's no longer the case.

freedomben
0 replies
1h40m

Yeah, GP really undermined their point with the whole "google x" and see.

For most people who aren't accountants though, the spreadsheet thing is correct.

mikeyouse
2 replies
2h9m

Right - the words themselves aren't as important as the concept. Any replacement word will suffer the same confusion. There's a reason that the language of debits and credits has largely remained the same for the past thousand years, and the language describing accounting is unlikely to be 'optimized' by first-principles CS concepts from people only loosely familiar with the field.

grantc
0 replies
1h9m

Well said. It's actually not complicated or arbitrary. It also works effectively in practice over the gdp of the known universe. If you are savvy enough to be interested in and understand the different computing approaches to double-entry bookkeeping, one can assume the whole DR/CR concept isn't beyond you.

eviks
0 replies
1h59m

There's a reason, but it's definitely not that any replacement is just as bad since that's close to an impossibly strong statement

rahimnathwani
0 replies
14m

It sounds like your accounting instructor may have focused too much on implementation details (left/right), and too little on accounting principles.

The terms debit and credit have meaning independent of their columnar position on a traditional ledger. I could create a ledger with the columns reverse or (shocking!) use a computer program with a data structure that doesn't encode the concept of left or right.

I think about it like this:

  CR / Credit / Creditors -> what the business owes
  DR / Debit / Debtors -> what the business owns
A CR entry is an increase is what the company owes (to creditors or shareholders), and a DR is an increase in what the company owns.

A common objection to this is 'what about income and expense accounts'? But those are just equity: https://news.ycombinator.com/item?id=39991837

I wrote more about this here: https://news.ycombinator.com/item?id=32498992

mijoharas
10 replies
2h39m

The "credit" and "debit" terminology is ridiculous because their definitions swap around depending on which account you're talking about, which is an utterly absurd (mis)use of language and the main reason people find this confusing

What would you suggest as an improvement? The article suggests "incoming" and "outgoing" which seems to have the same issue, as does everything I see in your comment (the person spending 5$ on lemonade sure as hell isn't putting 5$ in their accounts sales entry).

I'm not fully understanding the confusion both here and in the article.

lisper
4 replies
1h58m

What would you suggest as an improvement?

Use the intuitive meaning of the words: a credit means you have money coming in, a debit means you have money going out. An increase in assets, income, or equity is a credit, and an increase in expenses or liabilities is a debit, and vice versa.

Or, alternatively, just use "credit" for any increase, and "debit" for any decrease. But this:

"Definition 6: Credit - An entry that represents money leaving an account."

is just totally backwards.

fauigerzigerk
3 replies
1h6m

>Use the intuitive meaning of the words: a credit means you have money coming in, a debit means you have money going out. An increase in assets, income, or equity is a credit, and an increase in expenses or liabilities is a debit, and vice versa.

An increase in assets is a debit.

>Or, alternatively, just use "credit" for any increase, and "debit" for any decrease.

How is this consistent with the fact that an increase in my bank account balance is a debit?

lisper
2 replies
1h3m

You have completely missed the point, which is that the way in which accountants use these words is unnecessarily confusing because it does not align with the common English definitions of the words "credit" and "debit".

fauigerzigerk
1 replies
50m

Yes, sorry, I was defending the established terminology without making clear why.

My problem is that your alternatives don't just change the words, they change the logic. The invariant of debit/credit is that they need to balance out.

If you choose words that can occur on both sides of the equation then this is no longer true and you're throwing out a lot more than just the admittedly unintuitive meanings of these words.

lisper
0 replies
15m

My problem is that your alternatives don't just change the words, they change the logic.

No, they don't. They just change the words you need to express the logic.

The invariant of debit/credit is that they need to balance out.

Sure. So? If I give you a dollar, that's going to balance whether we call that a debit to me and a credit to you or a credit to me and a debit to you. The labels don't matter.

DwnVoteHoneyPot
2 replies
2h12m

When I talk to accountants, I get confused with debit/credit so I use "increase" and "decrease". Everyone seems to understand me fine. For example, "Decrease cash", to buy equipment "increases assets". "Increase cash" by borrowing money is "increasing liability".

freedomben
1 replies
1h31m

Indeed, the dirty secret is that many accountants think of debit and credit as decrease and increase as well. After using the terms for a little while they switch the symbol (word) they think of, but it still retains the same meaning. They are basically synonymous.

source: friends and family members who are accountants and have generously given free bookkeeping tutorials

fauigerzigerk
0 replies
1h24m

>Indeed, the dirty secret is that many accountants think of debit and credit as decrease and increase as well.

So how would you correctly express the parent's example in terms of debit/credit if debit/credit are synonymous with decrease/increase?:

>>"Increase cash" by borrowing money is "increasing liability".

"Crediting cash by borrowing money is crediting liability" would sound obviously incorrect to any accountant.

globular-toast
0 replies
2h13m

It doesn't matter about the person buying lemonade. Their accounts are theirs alone and don't affect your accounts.

braiamp
0 replies
2h2m

Because people don't understand that credit and debit only make sense in the context of the account being applied to. If you deposit money to your bank account, it's a credit in your <name of back account>. If you withdraw money from the ATM, you debit your bank account and credit your cash account. But globally you haven't gotten more money.

abtinf
5 replies
2h10m

The "credit" and "debit" terminology is ridiculous because their definitions swap around depending on which account

I find it easy to just think of debit as adding to the left and credit as adding to the right. Their definitions are always the same that way.

lisper
4 replies
2h7m

But that just begs the question because you have to remember the arbitrary assignments of what things go on the left and what things go on the right.

nuttingd
1 replies
1h33m

It's the accounting equation being represented in canonical form. A chart of accounts is visualized in the minds of an accountant as:

Assets | Liabilities + Equity

Accounts classified as assets are debit accounts (left side), and accounts classified as liabilities or equity are credit accounts (right side).

The theory discussed everywhere in this thread is sound. You really don't need to use terminology like debit/credit for accounting.

What the discussion misses is the application of this framework. It is useful for a human to be able to visualize a complex transaction and work through missing pieces with the hints this framework provides. I'm missing something on the left? Oh yeah, I missed the deferred revenue debit.

lisper
0 replies
1h5m

You really don't need to use terminology like debit/credit for accounting.

That's exactly right -- you don't need to. The problem is that people do use this terminology, and they use it in a way that conflicts with common usage, which makes a very simple concept vastly more confusing than it needs to be.

freedomben
1 replies
1h34m

It's easy! Debits add to the left, credits add to the right :-)

(to be clear, I'm backing up your point by giving the same circular explanation that I got constantly through Accounting 101 and 102, and then occasionally after that when dealing with the books)

lisper
0 replies
1h6m

Yeah, they should be called leftits and rightits. Or CARs and CDRs.

juped
4 replies
2h44m

Double entry bookkeeping is very easy to understand once you ditch the ridiculous "accounting equation".

"Credit" means "source", "debit" means "sink".

Suppose you invoice a customer 10,000 euros. You now have a promise for 10,000 euros, but you account in dollars so it's a promise for 11,000 dollars at current exchange rates. So you credit the source, your "Income: Customer A" account ("income" and "expense" accounts represent the external world) $11000, and debit "Assets: Accounts Receivable" (an account for trade-credit promises like this) $11000.

Later, the customer pays your invoice, which gets you $10,500 because exchange rates have moved around. How do you account for this?

Your promise, which you accounted as $11000, is the source, so you credit Accounts Receivable $11000. You debit cash $10500, because you got $10500 in cash. Finally, credits and debits have to balance, so you debit "Expenses: Loss on Foreign Exchange" $500. (recall that "expenses", like "income", represents the external world, and you lost the other $500 to forex traders or whatever.)

Since you don't liquidate the business on any typical day of its operation, why would you attempt to figure out how that $500 fits into a hypothetical instantaneous liquidation when you could just... account for it by balancing credits with debits? (You do sort of instantaneous-liquidate when preparing financial statements, an infrequent task which is very mechanical compared to ledger entry.)

bongodongobob
3 replies
2h11m

The only time I've ever seen source and sink used is in electronics. You may as well call it squeem and flurb, source and sink isn't helping anyone.

temporarely
2 replies
1h43m

Well, this is hacker news, so a generous reading of the comment is that it is being mapped to semantics most of us here fully grok, and not as a general audience rewording for accounting.

bongodongobob
1 replies
33m

Just because someone knows how to build a website doesn't mean they know anything about discrete electronics. I'd wager the majority of this audience doesn't. It's mostly software people.

mhink
0 replies
21m

I've seen it used frequently in the context of data pipelines and stream-processing applications, which is even more applicable to the subject.

jandrese
3 replies
3h1m

The one thing I remember most from my economics courses in college is that economists have highly idiosyncratic mathematical conventions and they don't care. So many graphs with the independent variable on the Y axis...

abtinf
2 replies
2h4m

So many graphs with the independent variable on the Y axis

I was perplexed by this as well and none of my profs could cogently explain it. The classic example are supply and demand curves, with price as the Y axis.

I finally realized they are actually trying to communicate that price is not under the control of the buyer or seller, but that the market dictates the price given a level of production. This kind of “spherical cow” thinking made me develop a healthy contempt for conventional economics.

abdullahkhalids
1 replies
1h46m

Indeed, one of the main problems with econ education is that at the most basic level they teach a model for the "spherical cow" free-market. Which is all that most people end up learning. And then those people try to apply this reasoning to real world markets - the vast majority of which do not satisfy the assumptions of the free-market model. So almost all public discussions of micro-economics is totally useless.

freedomben
0 replies
1h16m

I mostly agree, but I hardly think it's useless. Much like beginning your understanding of physics with Newtonian equations, it just needs to be qualified. But it's shocking how many people don't understand the basic idea of supply and demand and how the relate relative to some rationing system (usually price).

If you don't understand that foundational idea, then considering the effects of different rationing systems is utterly impossible. For example, that gets you a whole lot of people who make decisions that exacerbate housing crises by creating rent controls or building restrictions, and then being utterly perplexed when there isn't enough supply to go around (because they decoupled the signalling mechanism that the suppliers use (aka price) from what the buyers use (who got there first, or who is luckier with timing, or who is more politically connected). This is not to say that price controls are always bad, because real life is much more complicated than econ101 concepts lay out. But with nearly every other subject we expect people to have a basic level of understanding (like biology, history, english, etc) because we recognize it's importance for society and individuals to have at least a basic level of understanding in many different subjects. One that has as big an impact on life as economics seems like one of the worst to omit.

Just like we tell 8th grade physics students that "in the real world, cows aren't spherical so it's a little more complicated than this, but this gets you 80% to 90% of the way there" I don't see why we shouldn't do the same for economics.

mrkeen
2 replies
58m

Double-entry bookkeeping is very easy to understand once you ditch the ridiculous "credit" and "debit" terminology.

I'm with you so far.

the goal is to keep the accounting equation true at all times

Perfectly reasonable.

For example, you sell a lemonade for $5. You add $5 to Sales (Income) and add $5 to Current Account (Assets).

And now you've completely lost me. Money appeared. Lemonade disappeared. I want to see the corresponding +$5 and -$5.

Making it fit the equation (Equity + Income + Liabilities = Assets + Expenses) is not an intellectually satisfying reason for 'Assets' to go up by $5 when I just lost $5 of assets.

What if it worked this way in physics?

I could write

  Force * mass          = acceleration
     1N * 500g lemonade = 0.5 m/s/s
Then I could say: "If we halve the mass of lemonade, then we double the acceleration:"

     1N * 1000g lemonade = 1.0 m/s/s
And then you could say "But you didn't halve the mass, you doubled it!" and then I could say "Yes I did, look, the equation still holds."

thetwentyone
1 replies
47m

The -5 doesn't belong in your ledger, it belongs in the ledger of the person who bought the lemonade. As other commenters have pointed out, the "double entry" refers to multiple entries within your own ledger, it has nothing to do with someone else's ledger.

mrkeen
0 replies
9m

The -5 doesn't belong in your ledger, it belongs in the ledger of the person who bought the lemonade.

This is just prescriptive (do it because I say so). It doesn't explain anything.

As other commenters have pointed out, the "double entry" refers to multiple entries within your own ledger, it has nothing to do with someone else's ledger.

I didn't introduce the other guy's ledger, but since you did:

I lost lemonade (which is somehow an addition to my assets). So the "-5" which belongs in the buyer's lemonade - is the negative sign there to indicate that he gained an asset?

sudhirj
1 replies
2h13m

The way I understand debits and credits is to take the same equation and name the left and right side.

Assets + Expenses = Equity + Income + Liabilities

Sum of all debits = sum of all credits

These two equations have their sides associated.

Assets and equities increase with a debit and decrease with a credit, and vice versa.

epcoa
0 replies
1h9m

equities increase with a debit and decrease with a credit

That’s messed up.

omichowdhury
0 replies
3m

Yeah, I think a more intuitive way to replace credit and debit with State and Change as the pair of things in double-entry. It means that you don't have to swap meanings based on context and can use negative numbers intuitively.

State Accounts track your net worth

  Assets: what you own

  Liabilities: what you owe

Change Accounts track why your net worth changes

  Income: what you've earned

  Expense: what you've spent
The accounting equation that follows is ∆ State = ∆ Change:

  Assets - Liabilities = Income - Expense

Selling lemonade is +$5 Asset balanced by +$5 Income. If you substitute into the equation, its: $5 Asset = $5 Income

Taking out a loan is +$10 Asset balanced by +$10 Loan. In the equation: $10 Asset - $10 Liability = $0.

In general, say you have a +Asset action, to balance the equation you can do it 4 ways:

  +Asset -Asset aka swapped for equal value

  +Asset +Liability aka took out a loan

  +Asset +Income aka sold something

  +Asset -Expense aka got a refund
I've left out Equity as a separate account type since you can just treat it mathematically as a Liability account.

This is the system we've implemented in our ledger API (https://fragment.dev)

jncfhnb
0 replies
1h17m

Imo the only time the terms get confused is because there are classes of accounts where it was decided it was preferable to give it the opposite name rather than carry a negative balance. If we didn’t do that, the separation would be intuitive.

jancsika
0 replies
1h18m

The "credit" and "debit" terminology is ridiculous because their definitions swap around depending on which account you're talking about, which is an utterly absurd (mis)use of language and the main reason people find this confusing.

As a neophyte: "credit" and "debit" make me think I'd need both entries to do books at all.

The way you've written it makes me think: "Oh, this is just single-entry accounting for people who aren't careful like me!"

So perhaps historically there was value in misusing terminology sufficiently to cause people to people turn off the optimizing compiler in their brain so that they just learn and do it correctly from the beginning?

Edit: clarification

hencq
0 replies
13m

Totally agree. That's what I like about the way e.g. beancount does it [1]. Instead of using the debit/credit nomenclature, it just relies on positive and negative numbers. This way all the legs in a transaction just sum to zero, making it easy to spot if something is off. In the example, you'd have -5 Income (it's coming from income) and +5 Assets (it's going to Assets). The left side is typically negative and the right side positive.

[1] https://beancount.github.io/docs/the_double_entry_counting_m...

globular-toast
0 replies
1h49m

I find it more intuitive to use negatives. Then it's just equity + income + liabilities + assets + expenses = 0. In fact, every transaction and therefore the entire ledger sums to zero at all times.

So if you take out a loan to buy lemonade: +$5 to expenses, -$5 to liabilities. If you sell lemonade: -$5 to income, +$5 to assets. You just have to remember that equity, income and liabilities will be negative so flip them if you want to answer questions like "how much do I owe?"

balderdash
0 replies
9m

It think that’s right, but where people struggle so much is the splitting up transactions between these accounts the right way

nickpinkston
19 replies
6h46m

I think people underestimate the beauty and impact of accounting.

Just a tiny number of formulas (accounting identities [1]) and statements (P&L, balance sheet, etc.) can represent what's going on in any org in ways that can be roughly comparable. Reminds me of the "fundamental theorem of calculus" or "central dogma of biology".

Accounting is also where we get math and written language [2] as ancient Mesopotamian civilizations initially kept track of commodities using specific "accounting tokens" [3] shaped like the thing represented, and that evolved into written language, imagine: hieroglyphics.

Later, Al-Jajr [4] (aka algebra, literally "balancing") was invented by Al-Khwarizmi (origin of "algorithm") to solve Islamic inheritance law, whose rules of splitting up became a series of equations that led to the need to solve them quickly and correctly. Al-Khwarizmi's quadratic formula was the origin of why "algorithm" gets its name from him.

[1] https://en.wikipedia.org/wiki/Accounting_identity

[2] https://en.wikipedia.org/wiki/History_of_accounting

[3] https://en.wikipedia.org/wiki/History_of_ancient_numeral_sys...

[4] https://en.wikipedia.org/wiki/Al-Jabr

[5] https://en.wikipedia.org/wiki/Al-Khwarizmi

wongarsu
9 replies
6h0m

On the other hand some things in how accounting is traditionally done suffer from accounting predating a lot of "modern" math.

Negative numbers were first used around the 3rd century in China and took until the 16th century to be used in Europe. Modern double-entry bookkeeping was invented in the 14th century in Europe. So if you ever wonder why they traditionally use a column for debit and one for credit, with definitions that seem a bit strange: that was the best way to make it work with only positive numbers.

alexb_
3 replies
4h41m

I wonder if this is why losses are written down with () instead of -.

kqr
1 replies
3h47m

Yes, that's part of it. The lengths accountants will go to to avoid having to deal with negative numbers is a bit funny.

inopinatus
0 replies
2h43m

it’s because they know it’s a slippery slope into allowing imaginary and irrational numbers, which is how accountants go to prison.

PopAlongKid
0 replies
3h18m

It's just to make it more visually apparent. A tiny preceding hyphen is easy to miss. Same reason why negatives are sometimes printed in red, leading to such phrases as "drowning in red ink".

juped
1 replies
3h2m

Negative numbers have no place* in accounting, and people need to stop thinking "oh, credits are just negative numbers" and hopelessly confusing themselves and others by putting nonsensical signs on an unsigned magnitude of flux.

* you can actually think of oddball reasons you might consider a "negative credit/debit", but it's more akin to something like a negative mass in physics

kinleyd
0 replies
2h20m

I tried using John Wiegley's Ledger, which uses negative numbers. Everything was great about Ledger except for that part - I just couldn't wrap my head around it.

soheilpro
0 replies
1h23m

Having separate debit and credit amounts (instead of a single positive/negative number) serves another purpose as well: To track the total amount added or deducted from each account.

kinleyd
0 replies
4h6m

I'm not sure if that's the reason for it, but I'm pretty certain introducing negative numbers would confound the accounting process.

jjeaff
0 replies
1h42m

Then this would be one of those cases where working around a problem (the lack of negative numbers) actually resulted in a superior product. You don't want negative numbers because that would require the description of a category to change based on whether it is positive or negative. You wouldn't want to be changing "Assets" to "Liabilities" every time the number goes below zero.

You don't need negatives in accounting, because anything that is affecting a number differently than the rest (reducing rather than increasing), needs to be accounted for separately. Imagine showing negative revenue. That would be mostly useless. You want to see how much revenue you had, and in a separate entry, how many expenses. Imagine how misleading it could be to show $0 in expenses last month, when in reality, you had $100 in expenses, but you subtracted $100 out because you returned some big purchase from last month and got a refund.

yread
5 replies
5h22m

can represent what's going on in any org in ways that can be roughly comparable.

It can also obfuscate it pretty well!

PopAlongKid
3 replies
5h1m

That's where statement of cash flows[0] comes in -- because over a long enough time frame, profit is just cash in minus cash out. Hard to obfuscate that. Companies usually go bankrupt not because of negative net worth, but because of insufficient cash flow.

[0]the third basic type of statement, in addition to balance sheet and profit & loss.

Solvency
2 replies
4h38m

so why isn't there a single cash flow view/report that all businesses use rather than all of these bloated and apparently ineffective methods? PL etc..

joncrocks
0 replies
4h1m

Cash flow is not just what is happening, but what will happen. i.e. the difference between when money goes out vs. it coming in.

If you are selling widgets for $1.20 and buying them for $1, and they are delivered after you order them, you are limited on how many open orders you can have at any point in time even though you make money on each order.

A companies cash flow will be dependent on employees, capital expenditures, money for stock, returns rates, tax requirements etc. etc. So it's heavily dependent on what type of business is being run and the specifics of how the business is being run.

PopAlongKid
0 replies
3h58m

There is a cash flow report that all (public) businesses use -- as I said, it is one of 3 basic reports that capture different aspects of the companies financial performance. You need all 3 for a complete picture. The cash flow statement helps "unobfuscate" certain aspects of the other two reports (which I hope you agree are not pure obfuscation).

For example, see this Apple Corp. financial report[0] -- it includes a statement of cash flows. I think you'd find that all other companies required to publicly share their financials will include the same report.

[0]https://www.apple.com/newsroom/pdfs/FY22_Q4_Consolidated_Fin...

actionfromafar
0 replies
5h14m

Obligatory "Seeing Like a State" reference.

shiandow
1 replies
3h32m

I know people underestimate the impact. Before the 1800s or so Europe didn't have negative numbers, except for the odd mathematician who claimed you could calculate with them even if they were obviously meaningless.

It was only after bookkeeping became ingrained into all levels society that negative numbers were considered equally real as positive numbers.

nyrikki
0 replies
3h20m

They didn't have modern notation, specifically the integers as a convention hadn't been adopted by primarily Greek mathematicians like Diophantus.

That is very different from understanding concepts like owing someone money, which is a form of negative.

Chinese and Indian mathematicians and accounting from Babylonian times didn't have the same mental blocks.

The Bakhshali manuscript is still the first known example of modernish notation I think, but used +

kqr
0 replies
5h7m

Yes, there's a neat simplicity in how everything in accounting must work out, but extrapolating from that into "P&L, balance sheet, etc. can represent what's going on in any org in ways that can be roughly comparable" sounds like a very financialised worldview.

There are many important aspects of organisational design that are only loosely correlated with financial statements.

qznc
14 replies
6h11m

Still too complicated. It goes wrong with "Let’s add the Transaction column to our table."

Don't store the account data. Instead store the transactions. Compute the accounts from that. The table "Transactions" should have the fields: Date, Amount, SourceAccount, TargetAccount, Description.

That is how it becomes beautiful in my opinion. Unlearn this habit of thinking in accounts just because that is what you know from your bank statements. Think in cash flows.

(Ok, this is too simple for the tax use case. Sometimes transactions have multiple sources or targets. So my schema above needs to be adapted for that. My point is that the thinking should still be different.)

thfuran
8 replies
5h46m

Isn't having to replay every transaction in history to query current balance rather inefficient?

qznc
2 replies
5h8m

You can cache it. ;)

Solvency
1 replies
4h35m

technical speaking what does 10 years of transactions look like when it's "cached" with one current year still being raw text lines? how are the two reconciled?

airstrike
0 replies
1h52m

basically 9 years are cached and the last year is recalculated as needed. you have a source of truth for what the data looked like at moment T+9 years, you can just take as granted. and then process the transactions following that date "live" as needed

inopinatus
1 replies
2h38m

Computers are astonishingly fast at summing integers.

epcoa
0 replies
27m

They are not comparably astonishingly fast at retrieving that data.

rockostrich
0 replies
4h44m

Once a period of time is reconciled then you can pre-compute whatever information you need and then you're only computing the current balance for the current period of time that hasn't been reconciled.

globular-toast
0 replies
5h13m

It's a trade off. Immutability is a big enough win to pay the price of a few extra CPU cycles. In practice it's very quick anyway. Computers are very good at adding numbers together (it's almost like it's what they were made for!). I keep all my accounts for over 12 years in one file and I still don't notice any delay when calculating balances etc.

If it does become a problem then one solution is to take sums at some point in time and start the ledger again paying each account from a contra account containing the previous balance.

Mister_Snuggles
0 replies
4h18m

The act of "posting" a transaction updates the ledger to reflect the current balance. Think of the ledger as "Current state" and the transactions as "how we got there".

Mister_Snuggles
1 replies
4h20m

Don't store the account data. Instead store the transactions. Compute the accounts from that. The table "Transactions" should have the fields: Date, Amount, SourceAccount, TargetAccount, Description.

This is a bad design, please don't do this.

The better design is to have header and detail tables:

Header: TransactionID, Date, Description, (other fields as required, e.g., posting status, reconciliation status, etc) Detail: TransactionID, LineNumber, Account, Amount, Description, (other fields as required, e.g., reference numbers for subledgers, etc)

This allows a transaction to affect any number of accounts. In effect, the transaction ends up reflecting a business transaction which may affect many accounts.

EvanAnderson
0 replies
2h27m

I don't think you're saying anything different than the parent poster, fundamentally. You're both saying "event-source the totals".

You're adding an abstraction to enable more flexibility and functionality. That doesn't change the fundamental event-sourced nature of totals.

atemerev
0 replies
4h17m

And that is how people invented blockchain (it is slightly more complicated, particularly that each transfer should include the source address in the output, but the idea is the same). As mentioned elsewhere in the thread, we also need multiple inputs/multiple outputs for each transaction.

MgB2
0 replies
5h0m

That's basically what beancount does, isn't it? You basically have all the transactions in your plaintext files, and it generates the full ledgers from those on the fly once you want to do any evaluations.

EvanAnderson
0 replies
4h37m

Any time I've dealt with bookkeeping or accounting software where I find functionality like "Rebalance accounts" I become suspicious and wary. I know that the programmer has tried to be clever and keep running totals, versus calculating them the source transactions. There be dragons there.

jfengel
5 replies
4h26m

Every time I look at accounting, the different kinds of accounts baffle me. I can never keep straight what each kind of account is used for, or which ones have positive credits and which ones have negative credits.

As far as I can tell, the point is to double the amount of work in the hopes of catching certain kinds of errors. Which makes sense when you have humans making the entries and humans doing the arithmetic.

But I grew up in a world where computers do all of the math, and it always looks to me like it's violating the Don't Repeat Yourself principle. If you say the same thing in two different places, one of them is always going to be wrong.

I feel as if, had accounting been designed in the modern era, we wouldn't have done it that way.

I'm not an accountant and my failure to understand does not make the thing wrong. But my bafflement at "credits decrease an asset account" feels emblematic of something being genuinely off base.

t_mann
1 replies
3h38m

the point is to double the amount of work in the hopes of catching certain kinds of errors

That's also how I like to think about it, as a kind of checksum mechanism. Double-entry bookkeeping originated in medieval European markets, which were often open-air, noisy, dirty, full of thieves and other dangers. Keeping your records straight in that environment must be a challenge, and having a logic that allows you to catch some mistakes can be a powerful tool in that context.

But there's more to it, eg it allows you to make a distinction between expenses and investments, so it is actually a truly different way to think about your financial situation than eg looking at cash flows only. Spending X on a buying livestock has a different economic meaning than spending X to pay a security guard. There are economic historians who argue that this kind of perspective was an enabler of early capitalism, because it enables people to see that money spent on an investment isn't lost value.

jfengel
0 replies
55m

Thanks for that. Lemme probe a bit deeper.

If you spend $X on sheep, you credit $X where? Debit it from where? You put "$X worth of sheep" on what account? When the sheep die, do you credit some account with "$X worth of dead sheep?" (Where presumably they remain as dead-sheep forever.)

(I'm sorry, I know that sounds dumb.)

How is that "$X worth of dead sheep" different from "$X worth of security guarding" that you supposedly received?

velcrovan
0 replies
3h42m

But I grew up in a world where computers do all of the math, and it always looks to me like it's violating the Don't Repeat Yourself principle. If you say the same thing in two different places, one of them is always going to be wrong.

This is wrong on a couple of levels.

In your understanding do RAID disk arrays and backups violate “the Don’t Repeat Yourself principle”? Is one of the copies of the data guaranteed to be wrong? Do data backups duplicate data because of pre-modern thinking?

But on another level it’s irrelevant, because in double-entry bookkeeping, there is no duplication of information. If you buy an apple for a dollar, your journal entry will mark a dollar out of cash — which is true because you now have 1 less dollar — and a dollar against your “Food” expense account — which is true because the thing you just spent a dollar on was food. If you took away either entry, you would be losing information. The fact that both entries have to balance isn’t because of duplication, it’s because the same dollar can't exist in more than one place at a time, which is axiomatically true regardless of whether you use a computer.

kqr
0 replies
3h43m

The point is not to double the amount of work to reduce errors. The point is to record both where money came from and where it went to. This simplifies analysis, reporting, etc. down the line.

The fundamental unit of a double-entry system is the transaction, which records from where things came and to where they went. In software parlance, it's an event-sourced system rather than the stateful/interactive system of single-entry accounting.

jacques_chester
0 replies
2h30m

the Don't Repeat Yourself principle

I think this is meant mostly to apply to code. For data, redundancy is a very common strategy for assuring accuracy and durability.

If you say the same thing in two different places, one of them is always going to be wrong.

Yes! This is the exact point. The mismatch flags that there is an error that needs to be investigated and added to the ledger as a correcting transaction.

rahimnathwani
4 replies
4h36m

  Not really, the meaning of debit and credit depends on the type of account
That's how most accountants think about it. But I think there's something more fundamental: a CR entry is an increase is what the company owes (to creditors or shareholders), and a DR is an increase in what the company owns.

EDIT: see this link for how this relates to the accounting equation https://news.ycombinator.com/item?id=32501707

t_mann
1 replies
3h50m

That's (somewhat) true for accounts that represent stocks (assets, liabilities, not really for equity though), it's not true for accounts that represent flows (income, expenses). Income is recorded as a credit entry in an income account, eg (the corresponding debit entry would typically be on something like a current account or claims on customers).

rahimnathwani
0 replies
3h22m

Consider the positioning of income and expense accounts within the accounting equation. Essentially, they are components of equity. View equity as the company's obligation to its shareholders. A credit entry signifies an increase in what the company owes, whether to creditors or shareholders, while a debit entry reflects an increase in the company's assets.

jfengel
1 replies
4h24m

Isn't that exactly backwards to what most people think of credits and debits? If you credit me something, I now have something. I don't owe anything.

I can kinda squint and see "Oh, you want the universe to balance, so if I have something it is some kind of karmic debt". But it still feels like exactly the opposite of what I grew up thinking of these terms to mean.

rahimnathwani
0 replies
4h6m

It's the opposite because when a counterparty (like a bank or a store) says they're 'crediting your account', they're talking about the impact from their perspective, not your perspective.

kayo_20211030
7 replies
6h19m

Nice job on this. But, one has to be careful with redefining terms that have a generally accepted meaning. Changing Debit/Credit to Incoming/Outgoing smacks of jargon and will cause confusion. Any bookkeeper will understand what credit cash and debit expense means. Putting that in incoming and outgoing terms will not help the people who do the work, or have to explain the work. It's probably worth the effort of learning the nomenclature that's been useful for a few hundred years rather than falling back on what are metaphors.

MeetingsBrowser
2 replies
2h4m

It seems like the target audience of this is people not already familiar with accounting.

I don't understand how describing debit/credit (accounting jargon) in layman's terms smacks of jargon, but maybe that is because I am a layman =)

As someone with no accounting background, credit/debt described as "money go in, money go out" seems like a good enough explanation in the context of this post.

Do the "true" definitions of credit/debit differ from that in a meaningful way here?

mrkeen
1 replies
1h39m

I just Googled it, and picked the first two results:

A debit decreases assets or increases liabilities, while a credit increases assets or decreases liabilities. [1]

A debit is always used to increase the balance of an asset account, and the cash account is an asset account. [2]

[1] https://xendoo.com/blog/debits-and-credits/ [2] https://www.fool.com/the-ascent/small-business/accounting/ar...

It's not just that they're a bit confusing, it's that those words serve exactly one purpose, which is to disambiguate the exact thing that people find confusing about them.

The biggest indicator of their failure is that they are always explained in terms of something clearer, and the reverse it not true. No-one says: "I don't understand what 'we received $50' means, can you explain that in terms of credits and debits?"

wrycoder
0 replies
41m

The first definition is exactly backwards - ignore it!

mrkeen
1 replies
3h52m

Changing Debit/Credit to Incoming/Outgoing smacks of jargon and will cause confusion.

I disagree. Discussions like this on HN always invite someone to say "Look, it's super simple. Credits are just... and debits are just ...". Then a reply saying "You have it backwards. Look, it's simple! Credits are just..."

I would be perfectly happy to ditch those terms forever.

mrkeen
0 replies
1h34m

Plenty of downvotes, and yet, after writing this prediction, this thread is indeed filled with people all defining the terms 'Credit' and 'Debit' at one another. :D

UglyToad
0 replies
3h55m

But the problem is the accounting jargon is counter (contra?) to the layman's gut understanding.

If I get credited or I use a credit card money came from nowhere, woohoo. If I have a debit well that sounds like debt and my money decreased, boo.

I get that actually there's a good reason for the names but a field that doggedly sticks to non intuitive jargon that runs counter to every usage yet encountered for outsiders could do with some different non-overloaded terms.

EvanAnderson
0 replies
4h35m

I'll go further: Knowing basic accounting and bookkeeping jargon is a super power when it comes to dealing with finance people. Your credibility builds tremendously when you can engage with them using the proper jargon correctly.

mportela
5 replies
8h39m

Hi, all!

I'm not an accountant but decided to study double-entry bookkeeping and basic accounting a while ago. I learned a lot from many places, including great threads here on HN, and wanted to give back to the community. In this article, I explain the mechanics of double-entry bookkeeping and how I came to realize it's a directed graph.

I know there are many accounting nerds on HN so please feel free to criticize or suggest changes where I got things wrong!

wjnc
0 replies
6h37m

I’ve been in finance for nearly 20 years and okay, so, I’m kind of hesitant to admit… this is so great. Would love for my controllers to create such graphical flows of operating results. At some scale accounting gets pretty hard (hard as in at least one professor on the accounting policies team) and what I’ve learned from statistics is that graphics matter (Ross Ihaka, Andrew Gelman). With the appropriate abstraction any figure can get a graph of the constituting components. Moment of clarity here, thank you.

foobarian
0 replies
5h53m

Just wanted to say, I have been trying to understand double-entry bookkeeping for 30 years now and this is the first explanation that finally clicked for me so thank you!

anodari
0 replies
6h56m

Nice article, congratulations. I have worked with information systems all my life and one of the biggest insights I had was that the transaction, a purchase or a sale, which is the basis of the ERP system, is converted into 2 flows, the money that enters or leaves on one side and the product or service in another, this is accounting double entry. It may be obvious and simple, but I see that few people in my area have this understanding.

RcouF1uZ4gsC
0 replies
7h15m

and how I came to realize it's a directed graph.

One of the funnest things in computer science is realizing how some problem that you may not suspect initially turns out to be some type of graph.

pcrh
4 replies
6h34m

My understanding of double-entry bookkeeping is that it does not care who Alice bought the book from, nor what their accounts look like.

Instead, the "double entry" that complements the money leaving Alice's cash ledger is the entry of the value of the book into Alice's "book ledger", one decreases by $20, and the other increases by the same amount.

rco8786
1 replies
6h30m

You're right about the double-entry part, but bookkeeping more generally definitely cares about who Alice bought the book from.

grantc
0 replies
53m

Indeed. While dr==cr gets you far towards being able to calculate account balances and an entity's aggregate financial position, it's also fairly foundational that you are able calculate the company's position with different counterparties. So knowing that Alice purchased the book from Foo Booksellers, but maybe hasn't settled with FooBooks yet is super relevant.

The company's accountant may care about balances and reconciling them back to things like the existence of said book, a receipt for payment or a bank transaction indicating settlement happened. At a big enough company, the accounts payables nerds may come along and be focused on making sure the full process procuring and paying has happened correctly, including record-keeping, tax compliance, and the actual movement of funds.

When you start to scale how all of these processes are executed and recorded, it's dense enough that it still surprises me many years later.

kayo_20211030
0 replies
6h26m

Kinda yes and no on this. The journal entry capturing the transaction will be for the transaction of Alice buying the book from Bob. The debits and credits will be tied to that JE. Somebody is keeping book and the accounts are the accounts of that somebody. A fictional bookstore will have all the info, but Alice's and Bob's bank might not.

evrimoztamur
0 replies
6h19m

In real-life bookkeeping the journal entries contain a lot of metadata which link the individual entries to other objects such as invoices, fixed assets (computers, equipment, furniture, etc.), contacts.

In an organisation's accounting (Alice LLC), the basis entry would state a debit (increase of expense) in the book expenses account, credit (decrease of asset) in the cash balance. The complete entry would then make a reference to the invoice/receipt of the purchase and the contact details of the bookstore (address, chamber of commerce registration ID, tax number, etc.).

The exact level of detail is determined by how 'complete' your books are supposed to be. A book expense might not mean much to Alice LLC (which does not deal in book sales/purchases), but a laptop should (see more on the subject of fixed asset registries), or a large invoice from a business from a different country (which will require a lot more diligence with tax 'metadata').

On the other hand, the bookstore definitely cares more about books and will then consider the sale and replenishment of its book inventory, and once again introduce more meta-accounting data (see more on the subject of management/manufacturing accounting).

mo_42
3 replies
5h12m

I believe double-entry bookkeeping needs more attention.

I think double-entry bookkeeping is, at least to me, as fundamental to economics (and of course business) as logic to math. Even if some actors don't use it explicitly, it still holds. If I buy ten apples for 10 bucks, I have ten more apples in stock and ten bucks less.

Many economic discussions (not only on HN) get out of hands because people don't try to see the full picture or deliberately choose to see one side. I've even seen a professor of economics claim in public that the world is too much in debt. Well, double-entry bookkeeping tells you that there are always two sides to consider.

For example, in case of governmental debt they ignore the other side of that debt, which might be assets. Assets like airports, schools, bridges, etc. Usually, we call such things useful.

Another typical example is the central bank "prints money". Well, double-entry bookkeeping tells us that it's not possible. If they hand out currency, the counterpart needs to trade something in (typically repurchase agreements with commercial banks). (Leaving aside here the idea of helicopter money, which could even go into neg. equity or a loss.)

xphos
1 replies
3h44m

Economics is funny because its very anti complex math. For the local economics (household even company level) that makes total sense but for anyone doing research or systems modeling for things bigger than a company the total distain for calculus and non-equilibrium systems really prevents any discussion. I think its because if you remove stability most of supply and demand arguments fall apart. Its crazy because stable systems are extremely rare in natural complex systems its weird to apply it to large parts of economics as a given.

But here I'd caution against the idea that banks (not even central) cannot increase money supply because that's not really true. If a Bank is the backer of both sides of loans or engage in fractional reserve banks (i.e all banks), they can effectively increase money supply which in my opinion is equal to printing money. Especially since in the loan case, the loan is not necessarily a guaranteed asset (think cars in a crash). This effect is called the money multiplier effect via fractional reserve banking. https://www.youtube.com/watch?v=93_Va7I7Lgg

The multiplier is more of ceiling to the amplification rather than it actually happening on loans. None of this necessarily bad loans and investment are really important to other parts of economics but none of it is simple and non of it is stable in the traditional sense

jacques_chester
0 replies
2h25m

I find that economics is drenched in maths, depending on the school. Take Chicago's undergraduate program, for example[0]. It requires calculus classes before you even get to the starting line for the economics classes, and they encourage students to go further: "Students who have an interest in the major should take calculus at the highest level for which they qualify."

[0] http://collegecatalog.uchicago.edu/thecollege/economics/#Fun...

pcrh
0 replies
3h47m

Agreed. The "magic" of double entry bookkeeping is that it is a financial version of the Principal of the Conservation of Energy.

It isn't as strict in that it allows for assets to alter in value, for profits or losses to be made. But it does keep track of the way that money and "value" circulates in different forms, e.g. as cash, assets, debts, depreciation, etc.

The "double entry" keeps track of the transformation of the nature of "value". This is hard to do using a simple household-style "cash-in" and "cash-out" set of accounts.

btbuildem
3 replies
4h58m

I think I'm missing something here. How does looking at transaction history as a directed graph help anything? Is it an improvement on the centuries-old "double-entry" practice?

It seems to barely work with the toy example of couple transactions - imagine what the graph would look like with dozens or hundreds of edges between pairs of nodes. What use would there be for the typical algorithms that work with graphs?

This feels a bit like using pliers as a hammer. Sure, you can, I guess -- but why?

zamubafoo
0 replies
1h32m

I can see what you are saying, but I think it helps in two ways:

1. it is another way to conceptualize an idea. For most purposes this might not be relevant, but who knows where a hard accounting problem might be resolved through the application of graph theory (or the inverse!).

2. it is another way to visualize flows. Not everyone is financially literate or numerically inclined, so instead of handing them a table of columns of numbers and having them reason about the flows numerically, it lets you represent the flows spatially which maybe easier. After all, not all tools are for professionals.

Additionally, while the cumulative history in one graph might be much, simply adding filters based on transaction date might provide non-obvious insight that other visualizations miss. I can see this probably being even more helpful by cross referencing other information such as location.

weego
0 replies
2h38m

The article feels like a similar insight to the founding ideas of cryptocurrencies.

Engineers stumbling on foundational principles baked into other fields that software happens to be replicating.

inopinatus
0 replies
2h10m

It’s hare-brained. The article is over-egging the pudding. They haven’t established a justification, and the author’s claim that this visualisation helped them arrive at a clearer understanding is rather undermined by the category errors they make in the course of trying to geeksplain D.E. from first principles. What’s more they’ve represented only one very simple transaction. God knows how they’re going to gain from a graph-based visualisation of something more abstract e.g. dissimilar tax and book depreciation, adjustments for gains/losses on foreign exchange, allocation of franked dividends, PAYG, holding of amounts in trust for other parties, partial recognition of deferred revenue and so forth.

thinkxl
2 replies
3h48m

This is my mental model and how I built the backend of a budgeting web app.

Two types of accounts:

- assets (you want your balance to be more than 0)

- liabilities (you want your balance to be 0)

Two types of entries:

- debits (increase balances of assets, decrease balances of liabilities)

- credits (increase balances of liabilities, decreases balances of liabilities)

Rules:

- A transaction represents a transfer of value between accounts.

- Every transaction must have at least two entries. The balance of all entries the transaction holds should be 0, i.e., balance = debits - credits.

You don't think about money leaving or entering an account before you nail down those definitions. The account representations can be anything that holds a numeric value, not just money.

You can affect more than two accounts by adding additional entries with the condition of keeping the balance to 0.

kqr
1 replies
3h41m

Given just the two accounts you have, your goals are impossible to achieve, because Assets = Liabilities, so you cannot have one more than zero and the other zero.

I think in this problem hides two mistakes:

- Zero liabilities is not a reasonable goal for most people.

- There's an equity account type also. (Also income and expense accounts.)

thinkxl
0 replies
2h44m

I don't understand your point. But instead of rationalizing with words, let's put it into practice.

- I receive my paycheck in my bank account.

- I want to budget $800 for groceries every month.

- I have a credit card with a balance of $250.

- I want to know how much I have left; we will have an account named Left to Budget (LTB).

Let's outline them as accounts:

- Bank Account. It's an Asset and has a balance of $0.

- Groceries "category" Account. It's a Liability and has a balance of $0.

- AMEX Account. It's a Liability and has a balance of $250.

- LTB is my income account. It's a Liability (yeah, I know, but stay with me).

When I receive my $1,000.00 paycheck.

- Debits Bank (ASSET) for $1,000.00

- Credits LTB (LIABILITY) for $1,000.00

Balances:

- Bank (ASSET) $1,000.00

- Groceries (LIABILITY) $0.00

- AMEX (LIABILITY) $250.00

- LTB (LIABILITY) $1,000.00

I budget $800 for Groceries for this month.

- Debits LTB (LIABILITY) for $800.

- Credits Groceries (LIABILITY) for $800.

Balances:

- Bank (ASSET) $1,000.00

- Groceries (LIABILITY) $800.00

- AMEX (LIABILITY) $250.00

- LTB (LIABILITY) $200.00

I go to the grocery store and buy Milk for $50 and Bread for $10.

- Credits Bank (ASSET) for $60.00

- Debits Groceries (LIABILITY) for $60.00

Balances:

- Bank (ASSET) $940.00

- Groceries (LIABILITY) $740.00

- AMEX (LIABILITY) $250.00

- LTB (LIABILITY) $200.00

As of now, I effectively know that:

- I have $940 in my bank, but I only have $200 available to spend (LTB).

- I have $740.00 left to spend on Groceries in my Bank.

- If I wanted to pay my Credit Card (AMEX) in full, I couldn't. Even though I have enough money in my Bank, most of it is already allocated to Groceries. BUT I could adjust my budget, like so:

Adjust my Groceries budget by moving $50 back to my LTB, so I can pay my Credit Card in full this month.

- Debit Groceries (LIABILITY) for $50

- Credit LTB (LIABILITY) for $50

Balances:

- Bank (ASSET) $940.00

- Groceries (LIABILITY) $690.00

- AMEX (LIABILITY) $250.00

- LTB (LIABILITY) $250.00

OK, so now I know that:

- I still have $940.00 in my bank.

- If I wanted to pay my Credit Card I can because I have enough in my LTB category.

- I have $690.00 available to spend in Groceries, because I moved $50.00 away.

Now, let's pay my Credit Card.

- Credit Bank (ASSET) $250.00

- Debit AMEX (LIABILITY) $250.00

Balances:

- Bank (ASSET) $690

- Groceries (LIABILITY) $690.00

- AMEX (LIABILITY) $0.00

- LTB (LIABILITY) $0.00

Now the money I have left in the Bank is for Groceries only. If I wanted to spend on something else, I'd have to either:

- Create a new Category and transfer an amount from Groceries, or

- wait for my next paycheck.

--

We were able to manage all this information with only one bank account, but we successfully managed a small budget.

Double-entry is a concept that's not necessarily applied directly to "physical" accounts. We transfer values between accounts even when the money stays where it is.

- Zero liabilities is not a reasonable goal for most people.

Zero liabilities is not a goal; it's the direction on whether money balance increases or decreases; it's not tied to the money you have or owe. It's a concept or formula rather than a reality.

- There's an equity account type also. (Also income and expense accounts.)

Equity and expenses are Assets. Income can be an Asset or a Liability, depending on how you want to represent it. For me, it is a liability because I want it to be 0. Even tho, my income account will have money, its representation of Money Left to Budget will be zero because the accounts that transfer value from it will include savings or investing accounts.

globular-toast
2 replies
4h56m

Everyone should do their own accounts. I've been doing it for over 12 years and I'm so glad I've kept up with it.

I don't bother keeping my ledger immutable, though. The point about immutability is that whatever happened is immutable (because it's in the past; it already happened!) and the ledger should just reflect that. So if I somehow made a mistake in my ledger I just correct it. I keep my ledger in git so that does record changes to the ledger itself, but I rarely, if ever, need to access these.

brabarossa
1 replies
3h25m

What does that mean? Are you using cash? Are you copying bank transaction history to your git?

globular-toast
0 replies
2h21m

Yeah, I source my ledger from multiple places like bank transactions, investments accounts, cash transactions etc.

I can't really think of a case where I have made a mistake, but if, for example, I sold something to a friend I would debit (+) their "reimbursement" account with the amount they owe me. If I typoed that to 10x the amount, I would just go and correct the typo, I wouldn't make two new entries to revert then correct the mistake.

xg15
0 replies
56m

There is one limitation of the graph visualization that's worth paying attention to: If you add a larger number of transactions to it, the graph will become tangled up and difficult to make sense of: You see which accounts trade with each other, but the order of the trades got lost, because all transactions share the same "account" nodes.

Indeed, if you'd try to also track balances in the graph, you'd end up with the exact same limitations that the original, "mutable" account table had: You can only store a single "current" balance for each account and each time you add another transaction to the graph, the old balances of the accounts involved are lost.

You could fix this shortcoming by redefining the meaning of the "round" nodes in the graph and essentially treating the graph as a ledger: Instead of a round node representing an account, make it represents an account at a specific point in time, i.e. between two transactions. Then new transactions can be added as new nodes and edges to e.g. the right side of the graph and the graph will become a long chain that grows from left to right and represents the exchange of money over time.

(Another constraint has to be added that a transaction must never go "backwards in time", i.e. never go from a node to the right to one on the left and never have an "incoming" and "outgoing" edge pointing to the same round node)

With many accounts and transactions, it might still get difficult to keep track, which transactions are close together in time and which are far apart. This could be made easier by introducing another container, let's call it a block, that groups all transactions together which share at least one "round" node in their "incoming" or "outgoing" edge. Because of the "no going back in time" property, the blocks will be non-overlapping and they will also have at least a partial ordering to them that follows the chronologial ordering of the transactions.

If you want to make the graph extra pretty, pick one transaction in each block and use its timestamp to turn the partial into a total ordering.

If you zoom out, your graph indeed looks like a chain of blocks, going from left to right in the direction of time, with each block containing the transactions that belong to the same slice of time. A blockchain, if you will...

sgarland
0 replies
6h59m

Nothing of substance to add, I just wanted to say that I thoroughly enjoyed this post.

sandGorgon
0 replies
1h32m

I built a double-entry ledger for multiple different kinds of credit cards at redcarpetup. the way i like to primarily think of it technically is idempotency. Thinking of balances is the wrong way to model it :

1. since you want the capability to recompute all balances using ledger entries. 2. there are not two balances. There's usually a lot more. you want to update reward points, dues, late fees, partner share, etc etc etc. a 2 balance double entry ledger is a simplification.

once you set your mental model to think of it as a idempotency problem, there are multiple ways to model it. For e.g. a directed graph - traverse the entire subgraph to update balances. Or model it as a log database and re-run txns to arrive at balance computation.

phailhaus
0 replies
4h54m

I'm not sure that visualizing bookkeeping as a graph is helpful, it makes it really hard to tell what's going on and you lose the time dimension. What if you instead used a table to show movement of funds by transaction, and only used a graph to model the "aggregate result" of a set of transactions?

nyrikki
0 replies
3h15m

Personally I find the model of a collection of immutable events that preserve assets= liabilities+ equity easier.

Events being constrained to historical statements of fact.

nosmokewhereiam
0 replies
1h13m

This helped me. In class now and the first ever accounting course I've taken. It's hard to wrap your head around without any background.

Thank you!

m3kw9
0 replies
2h48m

Double entry can track networth better. Instead of a single entry of recording 500$ paid for laptop, which decreases your networth by 500, in reality you still have 500$ worth of a laptop in your hand. You would also record the asset increase as a +500$ from gaining a laptop. Which reflects reality of your situation better.

lmeyerov
0 replies
3h0m

Very cool! Well-written, and surprisingly real:

Somewhere VERY close to this modeling patterns has always been an interesting use case for us is large-scale visual analysis of crypto investigations, where the ledger gets shown quite similarly. The bit on taxes is funny too, as that's the first thing to get filtered out because it makes the graph messy :) Often, balances aren't initially known, so a post whole-graph-compute step is done to algorithmically enrich nodes after.

You can also do visual tricks here, like collapse 'multiedges' between the same accounts to get a summary of their p2p history. Analytically, this becomes an easy groupby on a ledger dataframe :)

To a lesser extent, we also see fiat $ investigations here too, imagine correspondent banking. I wish more bigco AML forensic accounting did this internally (erp, credit cards, ..), especially as so much is digital now, but we don't see that as much.

An interesting area becomes when you do things like add identity details to the graph, and can then start realizing the "A" and "Alice" and contra XYZ are all the same person. Another, which helps once you have a lot of data, is to start to be able to decloak transaction $1 "food" is a Costco hotdog, or funny buying patterns. Both are where "graph neural networks" come in, which have really advanced over the last few years. We see this kind of things in finance, like risk analysis. We find most folks are at the viz stage vs AI stage, and it's a multi-year relationship to get them from one to another, but a fun one!

---

Edit: Another practical modeling aha here is that a transaction can involve multiple entities. Formally, that is a hyperedge: it's fine for edges to connect more than 2 nodes. (And why languages like datalog are neat here, even if rare.) Visually that's confusing, so a trick is to make the transaction a node and connect it to all the involved accounts. Keeping transactions as event edges between entities can be nicer when zoomed out as fewer nodes, but having the transaction node is nice when zoomed in, and in the limit, there are asymptomatically fewer nodes+edges when doing the transaction node as you replace strongly connected components (quadtratic in edges) with a hub&spoke, which is linear.

jacques_chester
0 replies
2h39m

Interestingly I sort of went in the other direction at one point -- converting what was obviously a graph (build pipelines) into a from-to / credit-debit representation. On reflection it's just an edge list.

My main problem with adapting the representation was in the incommensurability of different kinds of asset moving through the pipeline. How does one credit source code and debit a blob store? I thought about learning more about multi-currency accounting as a source for ideas but never followed it up.

That effort inspired my thinking about a "Universal Asset Graph" for software[0] -- keeping track of not just containment but also movement and transformation of software. It's a partial but not complete inspiration for GUAC, which aims to capture software part relations for easy querying.

[0] https://theoryof.predictable.software/articles/some-requirem...

[1] https://guac.sh

gibsonf1
0 replies
5h23m

A better way to do this would be to more closely model what is really happening, that is the transaction events which change state. The states being changed would be the account balance amounts input to and output from the transaction event. With the event, you can also track the system performing the function in the event. (All with rdf) https://graphmetrix.com/trinpod-server

ggrothendieck
0 replies
1h25m

David P. Ellerman has a mathematical approach to accounting based on what he refers to as the Pacioli group. A provisional element of the Pacioli group looks like x//y where x and y are non-negative integers and we form equivalence classes based on x//y and u//v being equivalent if the cross sums x+v and y+u are equal. The group operation is x//y + u//v = (x+u)//(y+v) and the inverse of x//y is y//x . The identity element is 0//0. For more info see, for example, https://ellerman.org/wp-content/uploads/2012/12/DEB-Math-Mag...

elijahbenizzy
0 replies
3h35m

This is a great write up, thank you! One thing I’m curious about is what properties/metrics of the graph mean for accounting. Spectral properties (eigenvalues, etc…) might have some insightful meaning for the financial system.

Also I’m sure this is extremely well studied but I’m not super familiar — ML on accounting graphs could identify shapes that indicate illegal transactions, etc… Will dig for reading :)

ebolyen
0 replies
6m

I see a lot of consternation about credits and debits and the nomenclature.

Something that makes this simpler to think about from a modern perspective is that accounting is older than the popular use of negative numbers. By a lot. If we were to invent accounting today, we'd probably use positive and negative accounts instead of debit and credit accounts.

Algebra over addition is second nature to us at this point, but it would not have been obvious to the average merchant in 1604, and even then, negative numbers were viewed quite poorly.

What is important is that there are always two sides to a transaction and that they are inverses of each other. This is all a credit and debit are. Inverse operations on a number.

Therefore, we can make a rule that a transaction balances when credit = debit. (aka we didn't invent money as debit + credit = 0, but remember that we didn't like negative numbers when this system was invented, so this last fact is more of a happy coincidence that happens to ALWAYS WORK, for some reason, rather than the goal).

What is then reasonable is to consider literal cash on hand to be the most positive (debit) kind of account there can be, and work backwards from there. If I want to handle an expense, then I need to invert the cash account somehow (credit it) and therefore have the opposite kind of entry for where the money went (debit it). So an expense account must have a generally debit (or positive) balance.

But where did the cash come from? Well that comes from income and I want the cash to be debit-ey so the place it came from must be credit-ey otherwise I risk writing a transaction that doesn't balance (equal zero). So then income accounts must generally be credit accounts rather than debit account (aka they hold a typically negative balance or are "credit normal").

What is really killer about this system, is it just so happens that every mundane transaction you could ever write will end up as balanced transactions and each of these possible transaction accounts end up having the same usual balance of credit or debit (negative or positive). I think that is just so elegant.

doodlebugging
0 replies
4h52m

Nice graphical breakdown.

I think the real winner isn't Bob or Alice though they each benefited from the exchange. The real winner is the credit card company that banked 10% of the transaction on Alice's side and 5% on Bob's side. Sounds like they both chose the least sensible option to handle payment.

Maybe Bob should've made it clear that he accepted cash, money orders, cashier's checks, or personal checks, or even cryptocurrency so that Alice would not need to suffer a foreign currency conversion fee especially when you consider that they live in the same small town.

Just kidding. I realize that the example transaction needed some massaging on the path to the end graph to illustrate handling of more complex, real-world transactions.

Great job producing this intuitive break-down.

There is one thing that I found interesting near the top of the tutorial. You make the statement "But money is meant to be spent." If money exists to be spent then why do so many people accumulate such vast sums that they could never spend all that they have managed to accumulate? Dumb question, I know. Money in the hand has indeterminate or no value until the bearer needs to acquire a product or service and then the value of the money in hand is set by the seller of the product or service they require. The global economy functions because at some point in time a traditional barter system where useful physical items were exchanged was replaced by the current system involving exchange of special artisan linen papers or conveniently portable metallic disks emblazoned with cartoon images celebrating historical events or personalities.

Anyway, this was a good read and I enjoyed watching the transaction ledger complexity increase to account for real-world situations where there are more than two parties involved in a single transaction. Years ago when I was in high school we had a class that introduced us to checking and saving accounts and the goal of the class was to teach us how money moves through the system so that we could manage our own assets once we had real jobs and incomes. We had the introduction to the ledger book with one side handling credits and the other handling debits. It was all confusing at first but ended up being very useful.

A long time after this class I found myself working as an independent consultant paid a negotiable hourly rate. All of that earlier instruction came in very handy when I needed to split project time and classify and categorize all the transactions that helped me understand where all that cartoon cash came from and where it all went. My spouse is a CPA/Auditor so having her level of knowledge and experience close to hand was also enormously useful in splitting everything so that the charts and graphs I assembled were most intuitive.

Thanks! I enjoyed reading this.

brvsft
0 replies
4h17m

It was 'cute' the first time it was posted (in this form: https://martin.kleppmann.com/2011/03/07/accounting-for-compu...), but I find pointless musing like this to be counterproductive sometimes. While I understand the tendency to fixate on 'nerdy' topics like, "How can I take <thing> people think about as <X> and shove it into math or computer science idea <Y>?" this (a) doesn't introduce any substantive ideas (in this particular instance) and (b) would completely fuck up your bookkeeping and result in you failing an audit if you completely ditched double-entry bookkeeping in place of a directed graph.

Use the appropriate structure for the data. A graph is not appropriate as you lose information about time, which is important to the ledger. No, you can't add time as a value on your edges. If you did, you'd either have several dozen graphs, or they would look absurd.

balderdash
0 replies
2h41m

My personal observation is that where many people struggle the most mentally is across the three statements (balance sheet, income statement, and cash flows), 1) that that balance sheet is point in time and the other two are over some period, but 2) how a record entry effects each of the statements…e.g. if you sell an asset for a gain causing a change in the composition of the balance sheet (asset > cash, reversals of accumulated depreciation etc.) income statement (income in excess of basis) and cash flow (actual cash received)

aquir
0 replies
2h59m

Double-Entry Bookkeeping is great - I have learned it when started implementing ERP systems. This article is a bit overcomplicated and also, where is the Balancing Entry for the Opening Balances? It should be balanced against some Technical Account...

andrewfowl
0 replies
4h22m

I think it is a great article and graph representation would be very useful to have in accounting. There are a few things I would add:

1. It may be beneficial to segregate ledgers (used to record transactions with customer accounts, i.e. with assets you do not own) vs. books (transactions recorded to present own assets and liabilities). Books are used to account for all possible types of assets and liabilities, while ledgers are usually strictly limited to reflection of cash movements. I think the article is about ledgers.

2. Regarding the state of each account at each period in time, I think there is a lot of confusion between reflecting activity / transactions in the period and adjustments related to how prior transactions were recorded. I personally thought that adjustments could be better accounted for using something like a model with slowly changing dimensions where you can see history of each change. So it is not something you want to see on the directed graph by default, but something you want to be able to trace.

3. There was one idea that I really don’t like because although it make sense on surface, it has really bad implications for accounting and analytics. The idea I am talking about is that you don’t need to have one debit and credit for transaction, rather you just need to make sure that total debits equal total credits. say, Bob has several types of accounts and multiple customer. Now Bob asks you to tell him, how much of the current balance of a specific account was generated from proceeds by customer. To answer it, you now have to solve many-to-many relationships between customers and Bob’s accounts. And sometimes it has no deterministic answer because we balanced multiple accounts in one entry. And accountant now have to use imagination and excel to prepare a manual report that uses multiple assumptions to answer this question.

amelius
0 replies
42m

Can one do accounting using Git commits, and would it be practical?

BoppreH
0 replies
6h29m

I always enjoy these explainers that use computer science terms.

In this case, you can be more precise about the type of graph: double-entry accounting creates a Directed[0] Bipartite Graph[1] with Labelled Edges[2]. Every edge is between a Transaction and an Account nodes, which makes it bipartite, and the amounts are edge labels.

[0] https://en.m.wikipedia.org/wiki/Directed_graph

[1] https://en.m.wikipedia.org/wiki/Bipartite_graph

[2] https://en.m.wikipedia.org/wiki/Graph_labeling

2Gkashmiri
0 replies
5h35m

Is there any person who wants to test an old but currently in-development agpl licensed accounting software? Your help would be regarding testing the software, reporting bugs and maybe submit PRs to fix issues

https://gnukhata.org/install/

29athrowaway
0 replies
5h9m

Well, in this case

- balance = states

- transactions = state transitions

It is simply the representation of state transitions as a diagram, similar but not equivalent to that of a state machine.