6 ms·
Accounting for Computer Scientists (2011)
- rahimnathwani 11mo agoThe last time this was posted on HN (October 2023), I posted this comment which I think makes it easy to understand the fundamentals of accounting: https://news.ycombinator.com/item?id=37951781 https://news.ycombinator.com/item?id=37951781
- kjshsh123 11mo agoIt's a good comment but I think to make something intuitive you really need to understand why something exists and I think for most people there just isn't in fact a good reason. If you know it, it's easy to use, so why not? But if you don't, whatever method you come up with to track account balances and revenues vs. expenses is going to be useful enough. For individuals not accounting for receivables, debts, depreciation properly isn't likely to make a big difference.
- rahimnathwani 11mo agoThis is a great point. I take it for granted that people want to be able to read a balance sheet and an income statement. But most people don't.
- ghaff 10mo agoThat was my thinking reading this. You need the basics but I would assume the main motivation is to look at a company's financial statement and at least recognize a lot of the language and the significance of the relationships. Of course there are going to be a lot of subtleties but the statement shouldn't be seen as being written in an ancient language.
- tomhow 11mo agoPreviously: Accounting for computer scientists (2011) - https://news.ycombinator.com/item?id=37940973 https://news.ycombinator.com/item?id=37940973 - Oct 2023 (50 comments) Accounting for Computer Scientists - https://news.ycombinator.com/item?id=15446202 https://news.ycombinator.com/item?id=15446202 - Oct 2017 (1 comment) Accounting for Computer Scientists - https://news.ycombinator.com/item?id=2298471 https://news.ycombinator.com/item?id=2298471 - March 2011 (75 comments)
- jimbokun 11mo agoThis is so nicely presented it’s tempting me to have Claude whip up an implementation. Just need aome form of graphic persistence then ways of summing across partitions of nodes to generate reports. And some convenience methods for adding transactions. Final step would be to slap a CLI or UI on top of everything.
- kogasa240p 11mo agoAs someone who failed an accounting class I will definitely read this.
- NikolaNovak 10mo agoI 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 negative for each transaction! In fact, there is 5000 going into banking account and 500+5 coming out of it. Nothing in 4th diagram is obviously the negative of that 5k transaction, to me. Similarly next sentence is "obviously" false: "If you partition the set of nodes into any two disjoint sets, and add up all of the balances in each set, then the sum for the one set is always the negative sum of the other set" -- the sum of the left two balances is minus five, and the sum of right three balances is 505. And just like that, I'm completely lost and booted out of yet another accounting lesson without passing the introduction :-( (fwiw, my experience of reading accounting is broadly the same as reading Plato: "it is obviously true that..." What, no, stop, that's not obvious at all, you gotta do better than that! :-)
- throwaway74848 10mo agoAccounting 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 transaction that balances out by adjusting both sides. [1] https://en.wikipedia.org/wiki/Debits_and_credits https://en.wikipedia.org/wiki/Debits_and_credits
- NikolaNovak 10mo agoThanks, 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 cheque to a landlord would enter a credit for the bank account on which the cheque is drawn, and a debit in a rent expense account. Similarly, the landlord would enter a credit in the rent income account associated with the tenant and a debit for the bank account where the cheque is deposited." I cannot even begin to parse that, and I'm honestly reasonably bright :-). Paying my landlord is "obviously" a transaction from my banking account (negative) into their banking account (positive). How it becomes four transaction is, as ever, the magic bit glossed over. That landlord is entering "debit for the bank account where the cheque is deposited" just feels like someone is yanking my chain. Anyvoo! Like with French language, I'll try again one day :-). Merci!
- arn3n 10mo agoDouble entry account is, in fact, what gave “transactional” databases their name: They were meant for financial transactions! Nowadays TigerBeetle is a custom built financial database just for double entry accounting. The implementation is fascinating.
- amelius 10mo agoThose graphs look cool, but I'd prefer a growing log of entries, so you can see what happens over time and more easily roll back or fix things. That's actually what's missing in this presentation: how do you deal with time?
- KolenCh 10mo agoA.k.a. How do you deal with a time dependent network?
- sakesun 10mo agoDouble-entry accounting was invented at the time we tracked things with paper and pencil.
- Animats 10mo agoThat's cash bookkeeping, which is well defined. The hard problems in accounting revolve around the time value of money and risk. Those are not as well defined. At best they are probability distributions.
- zzo38computer 10mo agoI had independently invented diagrams like that many decades ago. I had also made up a "matrix accounting", which uses a new accounting equation: <BAL|FSV> = 0 (It is assumed that <BAL| remains constant but |FSV> changes over time.) However, I think that both the diagrams and the matrix accounting are not really practical compared with the double entry accounting, but that does not mean that they are not worth anything.
- dagss 10mo agoI read this article on HN ten years ago and it has been very important to me in a career working on a special purpose accounting (for automated reconciliation of bank accounts of a payments processor). The biggest shift from conventional accounting is the use of negative numbers instead of debit/credit. I believe that accounting would have been a lot more accessible to professionals from science/math backgrounds if negative numbers had been used instead of debit/credit. I think biggest challenge to introducing negative numbers in accounting now is that people don't like the look of an income account accumulating a negative balance and the expense account accumulating a positive balance. But once you bend your mind around that it makes perfect sense...expense is where the money "went" (positive), income is where the money "came from" (negative). (The alternative sign convention would make cash on hand negative.) That said: Credit/debit does carry an extra bit of information, because you can put negative numbers as credit/debit to convey flow going the opposite direction of the usual one. (This can also be inferred from the accounts being credit-normal or debit-normal, just wanted to note it is not 100% the same model.) My Norwegian small business accounting system vendor (Fiken) has started to present data using +/- in addition to debit/credit columns, perhaps there is some adaption of signed numbers accounting happening..
- jltsiren 10mo agoI think the biggest challenge is that negative numbers are fundamentally a hack in this context. You don't have negative $100 in your bank account, and you don't pay negative $100 for something. Instead, you are $100 in debt or you receive $100, which is qualitatively different. Such qualitative differences should be represented using the type system.
- dagss 10mo agoOverdrafting accounts or negative balance in a bank account has nothing to do with what I was talking about. A negative number in my comment is just the "from" part of a flow. Just like in engineering, if you consider a dam, you can talk about the outflow as "-100 L/min" to indicate that the dam looses 100 litres per minute, for instance. That does not mean that the litres of water anywhere ever becomes negative. You do not say using negative numbers in engineering is a hack just because some numbers (like volume of water in the dam) is constrained to be positive. In accounting one instead talks about the dam being debited 100 L and the electric plant being credited 100 L. That is basically just a different way of spelling "minus". It is the same thing just using different words. And it is of course entirely possible to overdraft an account by debiting too much and get an invalid state entirely without negative numbers. Negative numbers are actually a "hack" (or useful invention) in engineering and everywhere else too. They don't actually "exist", it is an abstraction similar to imaginary numbers and real numbers. But all of these are useful.
- tnn000 10mo agoCan I replace Credit = From and Debit = To?
- memset 10mo agoIt depends on the “normal balance” of the account. For Asset and Expense accounts, yes. For Liabilities, Equity, and Revenue it is the opposite.
- memset 10mo agoI wrote an article on how to model a ledger with a DB. https://www.jaygoel.com/posts/building-a-scalable-accounting-ledger/ https://www.jaygoel.com/posts/building-a-scalable-accounting... It addresses how to model dr/cr in a DB with positive and negative numbers, but still produce reports with positive numbers as expected
- poslathian 10mo agoThis is the freshest take I have ever seen. Kudos, so cool. My professional career has been 20 years of physical ai research and now industry. My dad insisted I take corporate accounting in undergrad. It’s a skill I use every single day, double entry bookkeeping is one humanities great inventions and deeply related to conservation laws utility in various other areas. Could not have built my business without having gotten so into this Topic.
- kittikitti 10mo agoAccounting is just learning tax breaks, loopholes, and evasion. This article is weirdly written, as it claims accounting is just graph theory, and then provides the most convoluted way of calculating basic things like profit and loss. I recommend not reading this article at all.