Live data from Hacker News

Double-entry bookkeeping as a directed graph

matheusportela.com

291–300 of 388 posts

Re: Double-entry bookkeeping as a directed graph

#291
post #286
post #46

Earlier quoted context omitted.

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…

It’s been 15 years since I took an accounting course. Why would my bank account be debited when the balance went up? Is a debit not negative? Is the cash balance presented as a negative?

Your bank account is an asset for you, so debits increase the balance while credits decrease it. This is also called a "debit normal" account.

Liability accounts are tracked in reverse and are "credit normal". You increase the value (how much you owe) with a credit to the account and decrease the value (payments you receive) with a debit.

Re: Double-entry bookkeeping as a directed graph

#292
post #107

Earlier quoted context omitted.

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

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.

Maybe this is one of those things that's harder to understand if you have an accounting background. As someone without an accounting background, I found it incredibly intuitive: if money moves out of an account, that's a posting with a negative number; if money moves into an account, that's a posting with a positive number; a transaction is a set of postings that together sum to zero, indicating that no money has been created or destroyed out of thin air.

There's no need to learn any confusing "credit" or "debit" jargon, you just need to think about the movement of money (which you had to do already).

Re: Double-entry bookkeeping as a directed graph

#293
post #18
post #16

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

In a nutshell, double-entry bookkeeping is tracking all your money in two ways:

- where has it come from/has it forever gone? - where is it now?

So, you start a simple ledger of having $100 in cash with a transaction like this:

    Dr "cash" Cr "original funds" $100
Then you spend some of it on food and loan some to Bob:

    Dr "food expenses" Cr "cash" $25
    Dr "loan to Bob" Cr "cash" $20
Bob pays you back $22:

   Dr "cash" Cr "loan to Bob" $20
   Dr "cash" Cr "interest income" $2
You can't write 'Cr "Bob" $22', because... I don't want to get into the principles of accounting, but basically all asset accounts only go one way. You can't have minus two dollars in your pocket, and Bob can't owe you minus two dollars either.

Some of the accounts, like "original funds", aren't very useful by themselves, but they are the only way to make sure "money I literally have in my account/pocket", "money I owe people" and "money that people owe me" can all be counted together: if you tally up both kinds of the accounts, the total sum should be the same, just with the opposite "sign".

Re: Double-entry bookkeeping as a directed graph

#294
post #16

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 think the key point is that not only is double entry accounting a directed graph, so is single entry accounting.

Therefore (and to your point) the observation is of limited usefulness.

Re: Double-entry bookkeeping as a directed graph

#295
post #205

Earlier quoted context omitted.

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

Do you actually do that? When people are working late at the office and you order pizzas you put that into your inventory and then remove it as people consume the pizzas? I record that into a separate operating expenses account meant for this kind of fringe benefit, not into inventory. Pretty small so I do the accounting as well, but I think I'd lose my mind if I had to record them into inventory. Then when they leav…

> Do you actually do that?

No, nobody does this. GP is engaging in an exercise in pedantry, under the guise that it serves some pedagogical purpose. Personally, I don't think it's particularly useful to teach people about how things could theoretically be done, when it's much easier to show then how things actually are, but I'm sure there is some accountant nerd out there who is extremely meticulously tracking the total value of the gumballs on the secretary's desk as they are consumed.

Re: Double-entry bookkeeping as a directed graph

#296

Earlier quoted context omitted.

Cash went out. One half of the double entry is correct. But nothing came back in return. There is no corresponding element of trade to account for. The transaction doesn't balance. Which is obvious in human terms. That's the point of a gift – the transaction isn't supposed to balance! But formal accounting methods are not as fluid as people are. So, of course, in reality money was created (and then destroyed, it bein…

You're misunderstanding double-entry bookkeeping. Something does not have to come into the company got every transaction moving something out of the company. If your company gives $1000 to Billy, you document a $1000 debit from your gift account and a $1000 to Billy's account payable. The goal isn't to get any one account to zero but to get a source and destination recorded separately for every movement of funds. Len…

> The goal isn't to get any one account to zero but to get a source and destination recorded separately

Right, because transactions are actually two-sided. I give you something, you give me something in return. That's how people work with each other. And, as such, we account for a source and destination because that matches what actually happens.

But often times you only offer a promise. For example, I write some software for you, and in return you offer me food. But I'm not hungry right now, and I certainly don't want food that is going to spoil before I get around to eating it, so instead you promise to give me fresh food sometime in the future when I am hungry.

How do you account for that? You received software services, but gave nothing back in return other than a promise. Well, what if you recorded the promise? Software services in, promise out. You got your software, I get my food, the credit and debit accounts match. Everyone is happy.

Congratulations, you just created money out of thin air! -- And now, later on, I am feeling hungry and am ready to take you up on your food offer. You give me the food, I give back the promise, food out, promise in, I'm fed, debits match credits, and the money is destroyed.

That's exactly why we invented accounting: To keep track of the money being created and destroyed. You wouldn't need accounting if promises never needed to be made. Without promises, you'd have the software services, I'd have the food, and we'd have no reason to think about the transaction ever again. It is the promise that has us wanting to look back to make sure that promises outstanding are made good.

Re: Double-entry bookkeeping as a directed graph

#297
post #211

Earlier quoted context omitted.

Computers are astonishingly fast at summing integers.

They are not comparably astonishingly fast at retrieving that data.

Accounting data is so compact that the word “comparably” is doing all the heavy lifting in that statement. A large accounting system certainly prefers to have large main memory, but even in the worst case scenario, we read from persistent storage at GB/sec and the processor has no trouble keeping up. You don’t have to get particularly smart to operate a billion-row ledger; only beyond that does it start to be interesting.

Re: Double-entry bookkeeping as a directed graph

#298

Earlier quoted context omitted.

Computers are astonishingly fast at summing integers.

They're pretty fast, but if everyone writes software that does 10,000x more computation than necessary on that basis, suddenly they're slow.

“If everyone is incompetent, all software will be bad”. Got it, thanks.

Re: Double-entry bookkeeping as a directed graph

#299

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's good to read there is consternation about the debits/credits nomenclature because I am definitely confused.

Interesting context on negative numbers, thanks for that!

Re: Double-entry bookkeeping as a directed graph

#300
post #28

Earlier quoted context omitted.

You can cache it. ;)

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?

Table rotation on a periodic (e.g. annual or financial year) basis is a common strategy, with carried-over opening balance records at the top coded to a dummy account. So the journal for the last ten years may actually be in tables journal_2013 through journal_2023. You can also then move these quiescent partitions to cheaper storage. After a few years, even to read-only archival medium. It’s not completely unknown for financial institutions to have to refer back to a paper form to audit or restate older accounts from inception.
Post reply on HN