Live data from Hacker News

Double-entry bookkeeping as a directed graph

matheusportela.com

191–200 of 388 posts

Re: Double-entry bookkeeping as a directed graph

#191
post #158

Earlier quoted context omitted.

> 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 m…

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

> 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.

Re: Double-entry bookkeeping as a directed graph

#192
post #157

Earlier quoted context omitted.

> 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 th…

>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…

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".

Re: Double-entry bookkeeping as a directed graph

#193

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 t…

> 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."

Re: Double-entry bookkeeping as a directed graph

#194
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...

Re: Double-entry bookkeeping as a directed graph

#195
post #83
post #48

Earlier quoted context omitted.

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.…

> 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 c…

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?

Re: Double-entry bookkeeping as a directed graph

#196
post #10
post #9

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.

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

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.

Re: Double-entry bookkeeping as a directed graph

#197
post #105

Earlier quoted context omitted.

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…

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

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.

Re: Double-entry bookkeeping as a directed graph

#198
post #192

Earlier quoted context omitted.

>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…

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".

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.

Re: Double-entry bookkeeping as a directed graph

#200
post #193

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 t…

> 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…

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.
Post reply on HN