Live data from Hacker News

Double-entry bookkeeping as a directed graph

matheusportela.com

371–380 of 388 posts

Re: Double-entry bookkeeping as a directed graph

#371
post #362

Earlier quoted context omitted.

>That depends on what you mean by "expenses". If you give someone an expense account, that is a commitment to make payments for expenses, i.e. debt, so it's a liability. This is not what expense account means in accounting. An expense account is an account that records expenses incurred such as your AWS bill, rent payments or salaries paid. These are not liabilities and labelling them as such is more than confusing.…

> An expense account is an account that records expenses incurred such as your AWS bill, rent payments or salaries paid. Ah. > These are not liabilities Well, that depends. Every expense that involves an invoice or purchase order that is not paid immediately in cash must be recorded as two transactions. The first transaction is the issuing of the invoice or the PO. That transaction is a liability to the buyer, an ass…

I think you’re missing the balancing that needs to happen that’s internal to each party’s books. That’s where an expense account would come in, using the accounting equation:

               ∆ State = ∆ Change
                       ↓ 
  Assets - Liabilities = Income - Expense
For example you had:

> 3. The employee submitting their expense report (invoice) to the company for reimbursement (liability to the company, asset to the employee)

So looking just at the company’s books:

  $0 Asset - $100 Liability = $0 Income - $100 Expense
                -$100 State = -$100 Change
Then in step 4: > The employee getting paid by the company for the incurred expense (company converts asset into a discharge of liability, employee converting receivable into cash)

The company’s books would be:

  -$100 Asset + $100 Liability = $0 Income - $0 Expense
                      $0 State = $0 Change
So the net impact on the ledger would be (putting these entries together):

  -$100 Asset - $100 Liability + $100 Liability = $0 Income - $100 Expense
                     -$100 Asset - $0 Liability = $0 Income - $100 Expense
                                    -$100 State = -$100 Change
Which is exactly what the company’s books would have recorded if they were using cash accounting instead of accrual. They spent $100 on an Expense.

So I think it’s super important to make a distinction between Liability and Expense Accounts because they’re on different sides of the accounting equation - State and Change. The same distinction applies to Asset and Income Accounts. [1]

[1] https://fragment.dev/docs#design-your-ledger-ledger-accounts

Re: Double-entry bookkeeping as a directed graph

#372
post #61

Earlier quoted context omitted.

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

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

We implemented negative numbers in our ledger API (https://fragment.dev) and don’t use credits and debits at all. A bunch of engineers who didn’t know double-entry found it a lot easier to pick up. I think the key is to update the accounting equation to:

  (A)ssets - (L)iabilities = (I)ncome - (E)xpense
So if you have more (+100) Assets, then to balance it out, you either need to have:

  +100 Liabilities (100 A - 100 L = 0) → You took out a loan and increased your liabilities

  -100 Assets (100 A - 100 A = 0) → You sold an asset for what it was worth

  +100 Income (100 A = 100 I) → You provided a service and earned income

  -100 Expense (100 A = 0 I - -100 E) → You got a refund for a previous expense
I think that’s much more intuitive. You can think always think in terms of more or less Assets, Liabilities, Income or Expenses, then use the Accounting equation to check your reasoning.

Here’s a deeper explanation: https://fragment.dev/docs#design-your-ledger-ledger-accounts

Disclaimer: I’m CTO at Fragment

Re: Double-entry bookkeeping as a directed graph

#373
post #331

Earlier quoted context omitted.

Yeah, I think a more intuitive way is 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 Th…

> +Asset +Income aka sold something Don't you mean -Asset here?

Nope, in these examples the +Asset on the left means you received say cash. The right side shows various ways to balance that out based on the accounting equation

I did an explanation with numbers here: https://news.ycombinator.com/item?id=40021506

Re: Double-entry bookkeeping as a directed graph

#374

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…

I don't think it really helps to use negative numbers (e.g. thinking of income as negative is very confusing). I started a discussion [1] on the PTA subreddit about a month ago about how to make PTA syntax more intuitive, and someone suggested using arrows to mark the "from" (aka credit, or negative) and "to" (aka debit, or positive) accounts. The numbers are unsigned and the terms "credit" and "debit" aren't used, a…

I don’t think you need to think of income accounts as negative if the ledger you use enforces an updated accounting equation that also uses negative numbers, See https://news.ycombinator.com/item?id=40021506

Re: Double-entry bookkeeping as a directed graph

#375
post #170
post #70

Earlier quoted context omitted.

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

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

Yup I think it’s best to leave credits and debits behind. We can use more than 2 bits these days.

I think a far more intuitive system is use negative numbers with a symmetrical accounting equation:

  Assets - Liabilities = Income - Expense
Then you always think in terms of:

- Do I have more or less assets?

- Do I owe more or less liabilities?

- Did I make more of less profits?

- Did I make more or less losses?

You can then use the accounting equation to check your reasoning. I go more into it here: https://news.ycombinator.com/item?id=40021375

Re: Double-entry bookkeeping as a directed graph

#376
post #278

Earlier quoted context omitted.

Thank you. I really appreciate that. It still feels exactly the opposite of what I thought a credit and debit were. Surely when you add sheep, you credit the sheep account and debit the cash. I get it. It's just a shift.

Yeah, best not to think of any semantics wrt to the words debit and credit. Debit is left-hand side, credit is right-hand side, and just remember the rules how they work :)

Haha that sounds like shut-up-and-calculate to me. The alternative is to update the rules to use our intuition on whether the action we’re tracking is good or bad for us and map that to increasing or decreasing balances that represent what we own, owe, earn and spend.

More deets here: https://news.ycombinator.com/item?id=40021506

Re: Double-entry bookkeeping as a directed graph

#377
post #331

Earlier quoted context omitted.

> +Asset +Income aka sold something Don't you mean -Asset here?

Nope, in these examples the +Asset on the left means you received say cash. The right side shows various ways to balance that out based on the accounting equation I did an explanation with numbers here: https://news.ycombinator.com/item?id=40021506

> in these examples the +Asset on the left means you received say cash.

Ah. So... where is the value of the lemonade before you sold it? Wasn't that an asset before you sold it?

Re: Double-entry bookkeeping as a directed graph

#378

Earlier quoted context omitted.

Are you, perhaps, confusing money with currency? Money is just a promise. Anyone can create those. Which should be quite obvious. When you go to work to, as we literally say, make money , your employer is making a promise that in exchange for you work you can take something of some defined value later. Later, you will take that promise and turn it into something of value, such as food. Once spent, the money is destro…

I think you’re right that currency is technically what I meant by money in that sentence. Like you said most people equate the two, which is why I prefer to use the word “value” for the various promises we track in accounting. It just has less baggage with most people since it’s more abstract. Value can definitely be created or destroyed from the perspective of the entity whose net value we’re tracking. AR and AP acc…

> I prefer to use the word “value” for the various promises we track in accounting.

Value is the opposite side of the transaction, though. Money is the promise of value, not value itself.

> Which is basically bartering.

Yes, it most definitely is, but the difference with bartering, by definition, is that the value is always delivered immediately. As in, you give me grain and I give you sheep at the same time. We both have what we want, the deal is done, and there is no need for accounting as there is no reason to ever think about it again.

But if, instead, you give me grain and I give you nothing but agree to later give you sheep after they have been fed the grain and are ready for slaughter, then we have an unbalanced transaction. You gave me value, but I gave you nothing – just a promise.

Enter accounting. I record that you gave me grain and I record that I made you a promise (money created). You record that I gave you a promise and that you gave me grain. My books will show a loss (promises outstanding) and you will show a profit (promises yet to be delivered). This gives us both a reminder that the deal isn't yet done, which is useful because people are prone to forgetfulness. Also, perhaps even more significantly, you can pass on the promise. The person who finally receives the value in the future may not be the person who made the deal originally, so accounting is critical to settling the promises across a chain of trades.

Re: Double-entry bookkeeping as a directed graph

#379
post #362

Earlier quoted context omitted.

> An expense account is an account that records expenses incurred such as your AWS bill, rent payments or salaries paid. Ah. > These are not liabilities Well, that depends. Every expense that involves an invoice or purchase order that is not paid immediately in cash must be recorded as two transactions. The first transaction is the issuing of the invoice or the PO. That transaction is a liability to the buyer, an ass…

I think you’re missing the balancing that needs to happen that’s internal to each party’s books. That’s where an expense account would come in, using the accounting equation: ∆ State = ∆ Change ↓ Assets - Liabilities = Income - Expense For example you had: > 3. The employee submitting their expense report (invoice) to the company for reimbursement (liability to the company, asset to the employee) So looking just at t…

You're right, I did leave that out. But you also left something out: equity. The real equation is that ∆ State = ∆ Change = ∆ Equity. So there are really three things that need to balance (or four or six if you consider the counterparty's books and depending on how you count). But the income/expense really has nothing to do with the actual transactions, they have to do with the arcane rules around paying your taxes as a business entity, where you can be taxed on income you haven't actually received yet, and deduct expenses you haven't actually paid yet, or not be allowed to deduct expenses you have paid until long after you've actually paid them (depreciation). This is generally not applicable to individuals running lemonade stands. This is (and I know you know this) the difference between cash and accrual accounting. Those terms hide the fact that the difference between these two is mostly a reflection of tax law.

Accrual is also a way of doing implicit projections into the future, which made sense back when accounting was done with pen and paper, and payments could not be initiated by the payee. In that world, there was no such thing as (for example) an automatically renewable subscription. Today there is. How would you account for signing up for such a subscription? Theoretically, an open-ended automtically renewable subscription is an infinite liability (unless you start taking interest rates into account, but of course no one does that because no one knows what interest rates are going to be in the future). The Right Way to do this is to keep track of it as an infinite series of transactions with time stamps, which would be impossible to do with pen and ink, but is trivial for a computer.

Re: Double-entry bookkeeping as a directed graph

#380
post #367
post #103

Earlier quoted context omitted.

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

Might be the slight fever talking, but wouldn't the debit and credit be exactly the other way around? When you get paid by your employer, in your books the money enters your bank account ("debit") and is coming from an (abstract) employment income account ("credit"). When you pay your power company, the money leaves your bank account ("credit") and enters the (abstract) power company expenses, utilities expenses, or…

Just depends on which perspective you are looking at the books from.

From my perspective as the bank account holder and the person managing my own books, no.

Post reply on HN