News for hackers. Stuff that matters.
Re:Double-Entry Bookkeeping as a Directed Graph by nickpinkston on Wednesday April 10, 2024 @08:06AM (#39989772)
I think people underestimate the beauty and impact of accounting.

Just a tiny number of formulas (accounting identities [1]) and statements (P&L, balance sheet, etc.) can represent what's going on in any org in ways that can be roughly comparable. Reminds me of the "fundamental theorem of calculus" or "central dogma of biology".

Accounting is also where we get math and written language [2] as ancient Mesopotamian civilizations initially kept track of commodities using specific "accounting tokens" [3] shaped like the thing represented, and that evolved into written language, imagine: hieroglyphics.

Later, Al-Jajr [4] (aka algebra, literally "balancing") was invented by Al-Khwarizmi (origin of "algorithm") to solve Islamic inheritance law, whose rules of splitting up became a series of equations that led to the need to solve them quickly and correctly. Al-Khwarizmi's quadratic formula was the origin of why "algorithm" gets its name from him.

[1] https://en.wikipedia.org/wiki/Accounting_identity

[2] https://en.wikipedia.org/wiki/History_of_accounting

[3] https://en.wikipedia.org/wiki/History_of_ancient_numeral_sys...

[4] https://en.wikipedia.org/wiki/Al-Jabr

[5] https://en.wikipedia.org/wiki/Al-Khwarizmi

Re:Double-Entry Bookkeeping as a Directed Graph by wongarsu on Wednesday April 10, 2024 @08:51AM (#39990140)
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 definitions that seem a bit strange: that was the best way to make it work with only positive numbers.

Re:Double-Entry Bookkeeping as a Directed Graph by kinleyd on Wednesday April 10, 2024 @10:46AM (#39991283)
I'm not sure if that's the reason for it, but I'm pretty certain introducing negative numbers would confound the accounting process.
Re:Double-Entry Bookkeeping as a Directed Graph by omichowdhury on Saturday April 13, 2024 @04:33AM (#40021506)
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 by juped on Wednesday April 10, 2024 @11:50AM (#39992066)
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

Re:Double-Entry Bookkeeping as a Directed Graph by kinleyd on Wednesday April 10, 2024 @12:32PM (#39992625)
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.
Re:Double-Entry Bookkeeping as a Directed Graph by juped on Wednesday April 10, 2024 @04:55PM (#39995612)
Yeah, I had basically the same problem with it.
Re:Double-Entry Bookkeeping as a Directed Graph by barrucadu on Wednesday April 10, 2024 @06:11PM (#39996242)
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 by kinleyd on Thursday April 11, 2024 @05:16AM (#40000107)
I don't think that is the case. I think it would have to take a deeper understanding of double-entry accounting to really appreciate its genius. The key lies in the double entry that is made for each transaction. While each entry is simple, the beauty lies in how it provides the basis for detecting errors even in very large datasets simply by comparing totals - they must balance. In this context negative numbers do not provide any meaningful information at all.
Re:Double-Entry Bookkeeping as a Directed Graph by alexb_ on Wednesday April 10, 2024 @10:11AM (#39990946)
I wonder if this is why losses are written down with () instead of -.
Re:Double-Entry Bookkeeping as a Directed Graph by PopAlongKid on Wednesday April 10, 2024 @11:33AM (#39991885)
It's just to make it more visually apparent. A tiny preceding hyphen is easy to miss. Same reason why negatives are sometimes printed in red, leading to such phrases as "drowning in red ink".
Re:Double-Entry Bookkeeping as a Directed Graph by kqr on Wednesday April 10, 2024 @11:05AM (#39991521)
Yes, that's part of it. The lengths accountants will go to to avoid having to deal with negative numbers is a bit funny.
Re:Double-Entry Bookkeeping as a Directed Graph by inopinatus on Wednesday April 10, 2024 @12:09PM (#39992312)
it’s because they know it’s a slippery slope into allowing imaginary and irrational numbers, which is how accountants go to prison.
Re:Double-Entry Bookkeeping as a Directed Graph by jjeaff on Wednesday April 10, 2024 @01:10PM (#39993133)
Then this would be one of those cases where working around a problem (the lack of negative numbers) actually resulted in a superior product. You don't want negative numbers because that would require the description of a category to change based on whether it is positive or negative. You wouldn't want to be changing "Assets" to "Liabilities" every time the number goes below zero.

You don't need negatives in accounting, because anything that is affecting a number differently than the rest (reducing rather than increasing), needs to be accounted for separately. Imagine showing negative revenue. That would be mostly useless. You want to see how much revenue you had, and in a separate entry, how many expenses. Imagine how misleading it could be to show $0 in expenses last month, when in reality, you had $100 in expenses, but you subtracted $100 out because you returned some big purchase from last month and got a refund.

Re:Double-Entry Bookkeeping as a Directed Graph by ebolyen on Wednesday April 10, 2024 @03:02PM (#39994492)
> You don't want negative numbers because that would require the description of a category to change based on whether it is positive or negative

That's actually already how it works, the kind of inverse you use depends on if the account is credit-normal or debit-normal. You end up in the same place.

> Imagine showing negative revenue. That would be mostly useless.

Revenue is already credit instead of debit, which if you were consistent in using negative numbers, a negative revenue be completely correct (so you would want to sweat if revenue was a positive number). It's weird, but it lets your cash on hand be a positive number, which is just a necessary consequence of the system.

> Imagine how misleading it could be to show $0 in expenses last month, when in reality, you had $100 in expenses, but you subtracted $100 out because you returned some big purchase from last month and got a refund.

Wouldn't that be accurate? This would be a debit of 100 and a credit of 100 which nets a balance of 0. But individually you would see the transactions and could sum the credits and debits if you were so inclined.

Alternatively, contra-accounts exist if reporting these individually is material for some reason.

Re:Double-Entry Bookkeeping as a Directed Graph by soheilpro on Wednesday April 10, 2024 @01:29PM (#39993404)
Having separate debit and credit amounts (instead of a single positive/negative number) serves another purpose as well: To track the total amount added or deducted from each account.
Re:Double-Entry Bookkeeping as a Directed Graph by accrual on Wednesday April 10, 2024 @03:30PM (#39994826)
I also kind of like the double column approach with positive numbers, since neither party is exchanging "negative money", so it kind of underscores the balanced nature of the transaction.
Re:Double-Entry Bookkeeping as a Directed Graph by yread on Wednesday April 10, 2024 @09:30AM (#39990504)
> can represent what's going on in any org in ways that can be roughly comparable.

It can also obfuscate it pretty well!

Re:Double-Entry Bookkeeping as a Directed Graph by PopAlongKid on Wednesday April 10, 2024 @09:51AM (#39990743)
That's where statement of cash flows[0] comes in -- because over a long enough time frame, profit is just cash in minus cash out. Hard to obfuscate that. Companies usually go bankrupt not because of negative net worth, but because of insufficient cash flow.

[0]the third basic type of statement, in addition to balance sheet and profit & loss.

Re:Double-Entry Bookkeeping as a Directed Graph by Solvency on Wednesday April 10, 2024 @10:14AM (#39990965)
so why isn't there a single cash flow view/report that all businesses use rather than all of these bloated and apparently ineffective methods? PL etc..
Re:Double-Entry Bookkeeping as a Directed Graph by PopAlongKid on Wednesday April 10, 2024 @10:54AM (#39991376)
There is a cash flow report that all (public) businesses use -- as I said, it is one of 3 basic reports that capture different aspects of the companies financial performance. You need all 3 for a complete picture. The cash flow statement helps "unobfuscate" certain aspects of the other two reports (which I hope you agree are not pure obfuscation).

For example, see this Apple Corp. financial report[0] -- it includes a statement of cash flows. I think you'd find that all other companies required to publicly share their financials will include the same report.

[0]https://www.apple.com/newsroom/pdfs/FY22_Q4_Consolidated_Fin...

Re:Double-Entry Bookkeeping as a Directed Graph by joncrocks on Wednesday April 10, 2024 @10:51AM (#39991334)
Cash flow is not just what is happening, but what will happen. i.e. the difference between when money goes out vs. it coming in.

If you are selling widgets for $1.20 and buying them for $1, and they are delivered after you order them, you are limited on how many open orders you can have at any point in time even though you make money on each order.

A companies cash flow will be dependent on employees, capital expenditures, money for stock, returns rates, tax requirements etc. etc. So it's heavily dependent on what type of business is being run and the specifics of how the business is being run.

Re:Double-Entry Bookkeeping as a Directed Graph by actionfromafar on Wednesday April 10, 2024 @09:38AM (#39990598)
Obligatory "Seeing Like a State" reference.
Re:Double-Entry Bookkeeping as a Directed Graph by kqr on Wednesday April 10, 2024 @09:45AM (#39990679)
Yes, there's a neat simplicity in how everything in accounting must work out, but extrapolating from that into "P&L, balance sheet, etc. can represent what's going on in any org in ways that can be roughly comparable" sounds like a very financialised worldview.

There are many important aspects of organisational design that are only loosely correlated with financial statements.

Re:Double-Entry Bookkeeping as a Directed Graph by shiandow on Wednesday April 10, 2024 @11:20AM (#39991716)
I know people underestimate the impact. Before the 1800s or so Europe didn't have negative numbers, except for the odd mathematician who claimed you could calculate with them even if they were obviously meaningless.

It was only after bookkeeping became ingrained into all levels society that negative numbers were considered equally real as positive numbers.

Re:Double-Entry Bookkeeping as a Directed Graph by nyrikki on Wednesday April 10, 2024 @11:32AM (#39991865)
They didn't have modern notation, specifically the integers as a convention hadn't been adopted by primarily Greek mathematicians like Diophantus.

That is very different from understanding concepts like owing someone money, which is a form of negative.

Chinese and Indian mathematicians and accounting from Babylonian times didn't have the same mental blocks.

The Bakhshali manuscript is still the first known example of modernish notation I think, but used +