Live data from Hacker News

Accounting for Computer Scientists (2011)

martin.kleppmann.com

41–50 of 76 posts

Re: Accounting for Computer Scientists (2011)

#41
post #37

Earlier quoted context omitted.

This website that you call nonsensical was a huge help to me when starting to learn about accounting systems. And I have spent several years of my life working on a (special purpose, non-generalist) accounting system. The important thing is just a shift of perspective. It is just a different way of viewing the same system. The website doesn't contradict the things you write about at all. Saying "double entry book-kee…

> I feel certain that if negative numbers where around when double entry book-keeping was first done They were; one of negative numbers first documented uses in Europe after the Classical period was by Fibonacci in the specific context of financial calculations, around the turn of the 13th Century; the first evidence of the double entry bookkeeping is also in Italy, around the turn of the 14th Century.

Thanks for correcting me!

But probably they were not as widespread and natural to people as today?

Perhaps though things like income account balance being a negative number would have made credit/debit invented anyway.

Re: Accounting for Computer Scientists (2011)

#42

Earlier quoted context omitted.

Money must flow from a source to potentially multiple destination. Because of that previous fact, you must have at least two postings per transaction (the double in double entry). If you manage to move money correctly without any errors, those postings in that transaction will add up to zero, making it trivial to verify you've done everything correctly without any errors.

can't two errors cancel each other out and you still wind up at zero?

> can't two errors cancel each other out and you still wind up at zero?

They can, but the probability of two opposite errors of exactly the same magnitude is much lower than of any individual random error.

It's the same as with any other error-correction encoding. You don't have a guarantee that all errors will be caught by it, but most of them can be, so it's useful overall.

https://en.wikipedia.org/wiki/Error_correction_code

Re: Accounting for Computer Scientists (2011)

#43

I never understood double entry bookkeeping and that's where the author immediately loses me again: Early on after 4th diagram, author includes sentence : "Because every transaction appears twice, once positive and once negative" There is something so obvious about this to accounting folks that they always make the massive jump without any explanation. The previous diagram absolutely does not have positive and negati…

What made a lot of Econ and related stuff click for me is the idea that there is no such thing as a sale, only a purchase. When you buy a tv for $200, the electronics store buys $200 dollars of cash for $200 of TV.

So the electronic store hasn’t made any money on the transaction. They lost $200 dollars of tv and received $200 of cash. So the tv account got deducted 200 and the cash account got increased 200.

Re: Accounting for Computer Scientists (2011)

#44
post #17

I never understood double entry bookkeeping and that's where the author immediately loses me again: Early on after 4th diagram, author includes sentence : "Because every transaction appears twice, once positive and once negative" There is something so obvious about this to accounting folks that they always make the massive jump without any explanation. The previous diagram absolutely does not have positive and negati…

>I never understood double entry bookkeeping It only makes sense in the context of a company. Yes you can shoehorn it into a personal context and/or treating it like some sort of database like hn's accounting posts love to do but that's not what the real accounting world looks like at all. An accountant armed with a low/no code solution isn't going to write great code. That I think is obvious to every hn reader. But…

> I know a decent bit of both worlds so that disconnect in perceptions always amuses me.

Double-entry bookkeeping was from its inception an error-correction code that could be calculated by hand.

Modern databases contain much more powerful error correction methods in the form of transactional commits, so from a pure technical point, double-entry bookkeeping is no longer needed at all; that's why programmers have a hard time understanding why it's there: for us, when we store a value in the DB, we can trust that it's been recorded correctly and forever as soon as the transaction ends.

The thing is, cultural accounting still relies on the concepts derived from double entry bookkeeping as described in the article; all those assets and debts and equity are still used by the finances people to make sense of the corporate world, so there's no chance that they'll fall out of use anytime, at least 'in the context of a company' as you out it.

Now would it be possible to create a new accounting system from scratch that relied on DB transactions and didn't depend on double entry? Sure it can, in fact crypto coins is exactly what happens when computer engineers design a money system unrestricted from tradition. But in practical terms it still needs to relate to the traditional categories in order to be understood and used.

Re: Accounting for Computer Scientists (2011)

#46

I never understood double entry bookkeeping and that's where the author immediately loses me again: Early on after 4th diagram, author includes sentence : "Because every transaction appears twice, once positive and once negative" There is something so obvious about this to accounting folks that they always make the massive jump without any explanation. The previous diagram absolutely does not have positive and negati…

What made a lot of Econ and related stuff click for me is the idea that there is no such thing as a sale, only a purchase. When you buy a tv for $200, the electronics store buys $200 dollars of cash for $200 of TV. So the electronic store hasn’t made any money on the transaction. They lost $200 dollars of tv and received $200 of cash. So the tv account got deducted 200 and the cash account got increased 200.

That is a bit of a over-simplification. Its true that there would be corresponding $200 entries that balance. But the store did make money on the transaction, and the journal entries would show it in a manner as shown below (assumption 50% margin on sales). (COGS is Cost of goods sold).

    Cash $200 - Debit

    COGS $100 - Debit

         Inventory $100 - Credit

         Revenue   $200 - Credit
Yes, the journal entries don't immediatly show the profit as an explicit line item. But once closing entries are done, an income statement can be created that essentially shows the change in value of all your accounts for a certain period. In the income statement, profits would be calculated.

Re: Accounting for Computer Scientists (2011)

#47

I never understood double entry bookkeeping and that's where the author immediately loses me again: Early on after 4th diagram, author includes sentence : "Because every transaction appears twice, once positive and once negative" There is something so obvious about this to accounting folks that they always make the massive jump without any explanation. The previous diagram absolutely does not have positive and negati…

> the sum of the left two balances is minus five, and the sum of right three balances is 505.

Recheck your math the left two balances is actually 505.

5,000

-4,495

=====

  0505
its (4,495) not (4,995)

So it all balances out, which is what accountant actually do but intstead of choosing any two disjoint sets. Specific nodes are grouped into either Assets or Liablities+Equity. Essentially group all the accounts with negative balances and all the accounts with positive balances into another set. Which in this case is 5008 and -5008.

Re: Accounting for Computer Scientists (2011)

#48

Earlier quoted context omitted.

Accounting generally wouldn't depict it this way, and it's quite confusing with the bubble diagram. I always found it easier when looking at things called "t accounts" [1] Anyway, for the example you mention, it's supposed to mean that it takes 5k from the bubble on the left (founder) and gives to next bubble (bank) Then each line again takes from left and gives to the new bubble on right. So each line is a transacti…

Thanks, I appreciate your answer, though sadly it does not move the needle much for me. * the article still loses me because it defines transactions one way (the edges) and then seems to make this big switch that each edge/transaction is really two transactions suddenly (one on each side of the edge) . Similarly the explanation In Wikipedia is completely contrary to my mental framework: "tenant who writes a rent cheq…

>* the article still loses me because it defines transactions one way (the edges) and then seems to make this big switch that each edge/transaction is really two transactions suddenly (one on each side of the edge)

The author messed up by charactizing edges as one way transactions because in that moment he is only looking at the movement of cash. When he switches to edges being two transactions, he is now recognizing that the exchange of cash leads to the recognition of equities and liablities.

If you give your startup $5000 in cash, you expect to have $5000 in equity on the company books. When you charge to a credit card to buy food, you spend $13 buying food and paid $5 to your creditor so you still owe $-8 in liablities.

>Paying my landlord is "obviously" a transaction from my banking account (negative) into their banking account (positive). How it becomes four transaction is,the magic bit glossed over.

The magic of double entry is that you are only taking into account how your transaction affect your own balances. Thats why you need two entries, If you only debit your own account for rent, you would have a non-balanced set of books which would indicate that something is really wrong. So that why you have to credit Rent expense which is an account that doesnt track an actual balance in your bank account but a running total of all your rent expense for the year.

In the wikipedia example, you have your own set of accounting books and the landlord has his own set of books. That is how there are four entries, but you as an indivdual would only see and deal with your own double-entry.

Re: Accounting for Computer Scientists (2011)

#49
post #36

Earlier quoted context omitted.

Thanks, I appreciate your answer, though sadly it does not move the needle much for me. * the article still loses me because it defines transactions one way (the edges) and then seems to make this big switch that each edge/transaction is really two transactions suddenly (one on each side of the edge) . Similarly the explanation In Wikipedia is completely contrary to my mental framework: "tenant who writes a rent cheq…

"the article still loses me because it defines transactions one way (the edges) and then seems to make this big switch that each edge/transaction is really two transactions suddenly (one on each side of the edge)" Perhaps the word "transaction" should have been explained better. It doesn't mean an entry/record/action. It means a collection of several actions, all happening at the same time. Several actions that are i…

>An edge of 100 from X to Y means "move 100 from X to Y", which is the same as "subtract 100 from X and add 100 to Y"

I think this is a perfectly succint explanation for people who have trouble grasping the double entry system. Because they are usually stuck thinking in terms of "move 100 from X to Y". And its hard to get them to think in terms of "subtract 100 from X and add 100 to Y".

Re: Accounting for Computer Scientists (2011)

#50

I never understood double entry bookkeeping and that's where the author immediately loses me again: Early on after 4th diagram, author includes sentence : "Because every transaction appears twice, once positive and once negative" There is something so obvious about this to accounting folks that they always make the massive jump without any explanation. The previous diagram absolutely does not have positive and negati…

The "double entry" stems from the fundamental accounting equation: assets = liabilities + equity. Whatever you have is either yours or borrowed. Change in one must have an equal change in the other to keep the equation balanced, otherwise you would lose track of how much you own and how much you owe.

For example, you have £200 in cash. £100 was your own earnings, £100 your mum gave you to pass on to someone. In pure single entry system, Cash account would have £200, with no distinction between the two. Double entry tracks ownership explicitly: £100 would be recorded in Equity and £100 in Payables.

Post reply on HN