News for hackers. Stuff that matters.
Re:FDIC Takes over Silicon Valley Bank by jfengel on Friday March 10, 2023 @02:36PM (#35099685)
I think programmers find double-entry bookkeeping counterintuitive. It feels error-prone. In programming, you keep a single source of truth. Any time you copy the same data to two different places, one of them is always wrong.

Double-entry bookkeeping makes sense once you understand the the invariants you have to keep, and why you need to track 5 different types of books. Some of those accounts work in opposite ways, such that credit to one is a debit to another.

It all works out and is essential for "debugging" problems (when money appears to go missing -- or worse, materializes and you don't know why). But there's some counterintuitive language and it'll mess you up until you accept it.

Re:FDIC Takes over Silicon Valley Bank by ghaff on Friday March 10, 2023 @02:52PM (#35099945)
The other thing you get into as scenarios get complex is that there's a tendency to ask questions like "Why are you recording it this way rather than that way? The second way seems more logical to me."

The answer using being some variation of "Because that's the way the Financial Accounting Standards Board says to do it."

Re:FDIC Takes over Silicon Valley Bank by btilly on Friday March 10, 2023 @02:59PM (#35100046)
Double entry bookkeeping IS error prone - you have 2 opportunities to make each mistake.

However single entry bookkeeping is FRAUD prone. Just change one number and your theft is hard to track down!

That is why the adoption of double entry bookkeeping was critical for allowing commercial institutions to outgrow a size where owners could individually trust all who were working for them with access to money.

Re:FDIC Takes over Silicon Valley Bank by crdrost on Friday March 10, 2023 @03:39PM (#35100655)
Yes, and once you get the programmer to realize this, it all makes sense.

The ledgers are not the source of truth. No: this is a journaled filesystem; the transaction log is the ultimate source of truth. When you detect faults you recover from the journal, if something isn't completely written into the journal then it does not exist. The zero-sum property exists on every individual transaction and each transaction has an ID and the ledgers point at these IDs for auditing purposes.

So why have the zero sum property? Well, for one thing, it creates a uniform access model, I can't just credit my account, I have to debit someone else's account and they can have rules that might prohibit me from doing so. By carefully setting up these accounts you can also do what's sometimes called "behavior anomaly detection."

So for instance normal financial cards kind of work by opening up your entire wallet to a cash register and asking the cash register to pull out exactly the amount that you owe, understandably this might not be desirable if you are tracking some in-game-gold transactions in an internet game. You can get as elaborate as you want but think for example of a quick-consistency-check rule saying that “accounts starting 4xxx (player balances) never transfer directly to each other, instead users are expected to put the exact sum of money plus a little 5% padding into one of their 5xxx accounts and then give someone else a token permitting them to withdraw from that account." Stuff like that. A developer tries to code something up that doesn't go through this process and runs into errors in testing and has to conform their code’s behavior to the less risky process so that nobody is ever opening their entire wallet to a griefer.

Re:FDIC Takes over Silicon Valley Bank by sScTE9qEMCxEk34 on Saturday March 11, 2023 @12:34AM (#35105754)
The zero sum property also makes it really easy to just add up along (any subset of) each column and find most errors. Not so important now when everything's stored in a computerized database anyway, but a lot more relevant to actual books with actual writing in them.
Re:FDIC Takes over Silicon Valley Bank by rkhacker on Friday March 10, 2023 @04:05PM (#35101061)
So, in essence, the single entry bookkeeping will be sound if the change is not allowed?
Re:FDIC Takes over Silicon Valley Bank by moate on Friday March 10, 2023 @05:13PM (#35101929)
This sounds like "0 code". No code is the best code because it never breaks, has 0 serve space requirements, will never need to be reformatted, etc.
Re:FDIC Takes over Silicon Valley Bank by jjeaff on Friday March 10, 2023 @06:24PM (#35102736)
Single entry bookkeeping isn't really a thing and isn't really keeping books. It's just an account register or account statement with no totals or anything to check against.

Double entry basically just means that for every transaction on your books, you are showing where the money/asset/liability came from and/or where it's going. If you enter that you paid $100 for the AWS bill, you need to indicate from what account that money came from. So you would debit AWS Expense and you would credit your Wells Fargo Checking Account. With modern software, this basically just amounts to entering the expense and specifying which account it came from.

Re:FDIC Takes over Silicon Valley Bank by OJFord on Friday March 10, 2023 @09:14PM (#35104408)
In my mind it would be more like only a total - 'single entry' is how most people manage their wallets: '£5 change, put that in there, oh I have £15 now'. No record of where anything came from or where anything's gone.
Re:FDIC Takes over Silicon Valley Bank by osculum on Friday March 10, 2023 @04:38PM (#35101465)
That’s an oversimplification. Saying that it’s error prone because you have to write in two places is akin to saying that using a checksum is error prone: you have to write now the vale AND the checksum! More opportunities to make an error!

Doble entry accounting is very similar to a checksum in that sense. It provides error detection. If you make a mistake in one of those two places you will now immediately. As opposed to single entry, where you can carry that error indefinitely until somehow you catch it.

Re:FDIC Takes over Silicon Valley Bank by thaumasiotes on Friday March 10, 2023 @07:56PM (#35103735)
> That is why the adoption of double entry bookkeeping was critical for allowing commercial institutions to outgrow a size where owners could individually trust all who were working for them with access to money.

Wikipedia tells us that double-entry bookkeeping is first attested in the late 13th century.

But commercial institutions larger than the personal-trust threshold are attested as far back as written history goes.

Re:FDIC Takes over Silicon Valley Bank by sScTE9qEMCxEk34 on Saturday March 11, 2023 @12:38AM (#35105775)
> commercial institutions larger than the personal-trust threshold are attested as far back as written history goes

[citation needed]? I don't necessarily doubt you but I'd like to see an example. The only thing I can really think of would be governments, but that was definitely personal trust (mixed with a little bit of threat of summary execution if the king didn't like you).

Re:FDIC Takes over Silicon Valley Bank by thaumasiotes on Saturday March 11, 2023 @06:28AM (#35107377)
I guess I'm confused. If you're willing to consider governments (makes sense to me!), we are informed that the Achaemenid Empire (roughly 2 million square miles, mid-6th-century to mid-4th-century BC) was divided into 20 "tribute" districts: https://en.wikipedia.org/wiki/Taxation_districts_of_the_Acha...

The smallest amount of tribute listed there is more than five and a half tons of silver. If we make the assumption that each of these districts was handled by a different person, we already have a staff of 20 people plus the king.

(Not to mention, the large majority of Achaemenid taxation was not collected in this form. It was collected in kind and stored in an empire-wide system of distributed warehouses. I assume metal tribute was centralized. If you think the warehouse administrators - who inventory the goods and are responsible for making payments out of them - are "responsible for money", you're probably adding at least a couple dozen more people.)

By contrast, https://www.theofficialboard.com/org-chart/exxonmobil suggests that the top two levels (including the board) of Exxon total 26 people, or (excluding the board as a level, but still including the CEO) 24 people. The CEO has 13 direct reports.

So if the argument is that ancient kingdoms were below the personal trust threshold because the king had a low - and therefore manageably trustworthy - number of direct reports, it appears to be the case that our largest corporations today are also comfortably below the personal trust threshold, so there was never any need to exceed the threshold and in fact we never have.

On the other hand, if we think Exxon is beyond the personal trust threshold by virtue of its geographic extent (huge!), or its total number of employees (huge!), or its total number of employees touching money with the potential opportunity to steal that money (still huge!)... I think we have to say the same thing about ancient palaces, and really about ancient temples. A temple might "only" employ a few hundred people, but that's more people than you can personally trust. An important temple employed a few thousand people.

Re:FDIC Takes over Silicon Valley Bank by btilly on Sunday March 12, 2023 @10:18PM (#35130005)
Governments operated differently than businesses.

In a business I hand you my money and trust that you will hand me back my profits.

A ancient government put someone in charge and demanded tribute. Failure to produce tribute resulted in an army showing up to collect tribute. It was so common as to be expected that the administrator, called a satrap, would collect excess tribute and live a lavish lifestyle. The king sent spies to root out the worst of the abuse, but it was an uphill battle.

Governments can be run this way because efficiency is not particularly essential to their profitability. But efficiency is required for commercial enterprises. It is not enough to collect money and let your subordinates enrich themselves. You want to track all the money and not let your subordinates cheat the enterprise to their personal profit.

Re:FDIC Takes over Silicon Valley Bank by thaumasiotes on Monday March 13, 2023 @03:55AM (#35132483)
The claim above is that empires are below the threshold where everything runs on personal trust, not that governmental administration is fundamentally different from other kinds of administration.

> But efficiency is required for commercial enterprises. It is not enough to collect money and let your subordinates enrich themselves. You want to track all the money and not let your subordinates cheat the enterprise to their personal profit.

The first two sentences are obviously false; you want to track all the money, but you have no particular need to do so as long as some of the money is making its way to you.

Re:FDIC Takes over Silicon Valley Bank by spicybright on Friday March 10, 2023 @03:00PM (#35100055)
I have a friend that's an accountant that tried to explain how it worked. I thought it was more or less being responsible for counting money, but I think my eyes glazed over a bit trying to understand it.

But to be fair he did pretty much the same when I tried to explain programming.

Always important to step outside your software bubble once and a while.

Re:FDIC Takes over Silicon Valley Bank by lamontcg on Friday March 10, 2023 @03:12PM (#35100237)
I'm trying to understand how to read older 10-Ks and apply the capitalization of operating leases to those reports (converting property that is leased into capital to get an accurate estimate of the capital employed at the business) and with my background in IT and physics it is still a bit hard to follow (what I'm slow at is language, and really this is just learning a foreign language).
Re:FDIC Takes over Silicon Valley Bank by hathawsh on Friday March 10, 2023 @03:00PM (#35100067)
You'd think that the solution to that confusion would be database transactions (commit everything or nothing), but there are exceptions. In ACH, sometimes you have to send out a lone credit or debit with no matching entry. It feels very wrong, but it's necessary because it balances out some other entry in another file (that you might not have access to.)

OTOH, once you have double-entry bookkeeping in your brain, you won't want to go back. I now feel that, from the perspective of a business or consumer, money is never created or destroyed, it only moves between accounts.

Re:FDIC Takes over Silicon Valley Bank by matteotom on Friday March 10, 2023 @03:05PM (#35100127)
I've been running my own finances with double entry bookkeeping (via beancount) for about 4 years now, and it's ended up being super useful. As long as I'm 90% sure I got all the income, expenses, investment buys and sells, and transfers between accounts, I can add "balance" statements for a date and easily work backwards to find if I missed anything.
Re:FDIC Takes over Silicon Valley Bank by dragonwriter on Friday March 10, 2023 @03:13PM (#35100249)
> I think programmers find double-entry bookkeeping counterintuitive. It feels error-prone. In programming, you keep a single source of truth. Any time you copy the same data to two different places, one of them is always wrong.

Double-entry bookkeeping is creating of an audit-trail/error-evident data store; which is the purpose of the apparent duplication. But it can be viewed as a view of dataset reflecting a single source of truth, that documents value flows; every movement of value has a source and a sink, and the amount that moves from the source must equal the amount that moves to the sink. Losing the redundancy that allows error-checking of records, you could view each accounting transaction as a triple of (source, sink, amount).

Re:FDIC Takes over Silicon Valley Bank by jfengel on Friday March 10, 2023 @03:41PM (#35100687)
I think if a programmer were designing accounting, they'd put the flows in the database, and build views out of that. They might materialize the views for performance reasons, but they'd treat those views as suspect and the first response to any bug would be "blow away the accounts and recreate them".

You couldn't do bookkeping with actual books that way, and historically this way makes sense. Nor is it likely that the accountants are going to rethink their field from the ground up for the convenience of programmers.

Re:FDIC Takes over Silicon Valley Bank by CPLX on Friday March 10, 2023 @04:11PM (#35101126)
I mean, this is kind of how accounting does work. To a basic approximation a reconciliation is a line by line review of each of the flows, and an audit is "blow away the accounts and recreate them" and both happen all the time.
Re:FDIC Takes over Silicon Valley Bank by melenaboija on Friday March 10, 2023 @06:10PM (#35102589)
> I think if a programmer were designing accounting, they'd put the flows in the database, and build views out of that. They might materialize the views for performance reasons, but they'd treat those views as suspect and the first response to any bug would be "blow away the accounts and recreate them".

That is actually how it works, if you don't have "flows" you don't have accounting postings and if you have to fix an error you redo the postings from the flows. In this sense I would say that the "flows" are the source of truth.

Re:FDIC Takes over Silicon Valley Bank by jkhdigital on Friday March 10, 2023 @10:56PM (#35105108)
Right. The only actual raw data is transactions. Account balances are just filtered rollups. Double entry bookkeeping is just how you manually accumulate a set of account balances from transaction data, and a set of conventions for consistently labeling and grouping the transaction sources and destinations.
Re:FDIC Takes over Silicon Valley Bank by mytailorisrich on Friday March 10, 2023 @03:23PM (#35100402)
If by 'error' you means the amount of a transaction then yes you enter it twice but that should not really increase errors.

Now, on the other hand, it is especially designed to account correctly for that amount in order to keep your accounts correct and balanced. It is be much easier to lose track of things with single-entry accounting.

Re:FDIC Takes over Silicon Valley Bank by WalterBright on Friday March 10, 2023 @03:55PM (#35100879)
The reason for the invention of double entry bookkeeping was to detect arithmetic errors in summing the ledgers.
Re:FDIC Takes over Silicon Valley Bank by zestyping on Friday March 10, 2023 @05:06PM (#35101855)
The name "double-entry" is a little bit misleading. The "double" part makes it sound like you are duplicating work, but that's not really what's happening.

If you were accounting with pen and paper, you would write the transaction amount twice — positive in one column and negative in another. This maintains the invariant that money cannot be created or destroyed.

In terms of an abstract data model, though, each transaction is best thought of as a flow, or a weighted arrow. It has one amount and two ends: a source and a destination. The "double" in "double-entry" really just means that the arrow has two ends. Obviously every arrow has to have a head and a tail — it doesn't make sense for there to be no source or no destination.

The credit vs. debit thing confuses people a lot, and in my opinion is a red herring. If I could wave a magic wand, I would delete the words "credit" and "debit" from accounting because they are hopelessly inconsistent.

All you have to do is think of the conservation of money like the conservation of mass — when it moves, it leaves one place and arrives at another. The moment I stopped using the words "credit" and "debit", my understanding of accounting went from "I have no idea what I'm doing" to "Everything is intuitively obvious."

Re:FDIC Takes over Silicon Valley Bank by sapling-ginger on Friday March 10, 2023 @08:37PM (#35104135)
> This maintains the invariant that money cannot be created or destroyed.

And if you wonder, if money cannot be created or destroyed, how does a monetary system handle the population tripling over the past 50 years?

The answer is national debt. The US national debt is just an artifact of this double entry bookkeeping. In order for there to be +money in the economy for the ever-growing number of citizens to do commerce with, the treasury incurs on itself -money. That's national debt.

The corollary then, if the US ever pays back all of its national debt, the economy will crash because there just aren't cash available for people to do commerce with. A +90trillion on the government balance sheet equals a -90trillion on the private sector balance sheet.

Re:FDIC Takes over Silicon Valley Bank by youainti on Friday March 10, 2023 @09:11PM (#35104392)
Not really. Money is created but it is created by the fractional reserve baking model where banks borrow from people who are willing to lend for short periods of time (depositors) and lend to those who are looking to borrow in the long term. The fact that you tend to deposit in checking accounts is what creates the money.
Re:FDIC Takes over Silicon Valley Bank by sapling-ginger on Friday March 10, 2023 @10:57PM (#35105118)
The private banking system can only multiply off of the monetary base up to a certain multiplier, it cannot expand that base. Only the government treasury can expand that monetary base.

If the private banks have conjured up 100x the monetary base in 1970, then when the population doubles by 2020, the banks cannot multiply further up to 200x. The treasury has to expand the base while the banks keep their multiplier fairly constant.

Re:FDIC Takes over Silicon Valley Bank by cyberax on Friday March 10, 2023 @11:03PM (#35105165)
> And if you wonder, if money cannot be created or destroyed, how does a monetary system handle the population tripling over the past 50 years?

There is ONE special actor (in the US) that can create money out of the thin air: the Federal Reserve.

It alone can "buy" securities by crediting banks with money created out of nothing. Banks simply see a transaction with a dollar amount on their accounts within the Federal Reserve, and that's it. The money just appears.

The invariant "money can't be created or destroyed" holds for everybody else, including individual banks.

> The answer is national debt.

That's completely incorrect. The Federal Reserve can arbitrarily create (or destroy) money even if the national debt goes away entirely.

Re:FDIC Takes over Silicon Valley Bank by sapling-ginger on Saturday March 11, 2023 @12:02AM (#35105540)
Most of the Federal Reserve's balance sheet is Treasury securities. If the Treasury stops issuing those securities, then the Federal Reserve don't have anything to buy.

Saying that the Fed can arbitrarily create and destroy money misses the point, that they then have to buy SOMETHING with those money, and there are strict rules about what they can buy, and it just happens that the Treasury controls the supply of the primary asset class that the Fed is allowed to buy. Once you clear out all the dance and ceremony, you arrive at the conclusion that the Treasury issues new money by issuing new securities.

Re:FDIC Takes over Silicon Valley Bank by cyberax on Saturday March 11, 2023 @04:45AM (#35106905)
> Most of the Federal Reserve's balance sheet is Treasury securities.

That's true, simply because they're the most convenient way to manipulate the monetary supply. Not much else is readily available in the volumes needed.

But they are not _essential_.

> Saying that the Fed can arbitrarily create and destroy money misses the point, that they then have to buy SOMETHING with those money, and there are strict rules about what they can buy

Sure, the invariant: "money goes out, asset goes in" holds.

But they can buy quite a lot of different securities if needed. E.g. the Fed directly bought about $3T of MBS: https://www.newyorkfed.org/markets/programs-archive/large-sc...

Re:FDIC Takes over Silicon Valley Bank by jkhdigital on Friday March 10, 2023 @10:48PM (#35105047)
Yeah I agree. I aced my MBA accounting class but it makes a hell of a lot more sense to conceptualize everything as “stocks and flows”.

Also, I would say transactions are actually “multi-arrows” since there can be multiple sources and/or multiple destinations. A Bitcoin transaction captures this structure more or less perfectly.

Re:FDIC Takes over Silicon Valley Bank by sScTE9qEMCxEk34 on Saturday March 11, 2023 @12:27AM (#35105721)
Yeah, I just treat credit and debit as opaque blobs. They're words, I don't really know what they mean, but I know one means "side A" and one means "side B" ;)
Re:FDIC Takes over Silicon Valley Bank by mcsoft on Friday March 10, 2023 @05:41PM (#35102280)
Double-entry bookkeeping is essentially the law of conservation of energy applied to balance sheets. It's much more deep as it was invented some 5 centuries earlier than programming.
Re:FDIC Takes over Silicon Valley Bank by Aeolun on Friday March 10, 2023 @06:22PM (#35102715)
Conservation of money in that case. Money doesn’t just disappear. What goes away somewhere has to appear somewhere else.
Re:FDIC Takes over Silicon Valley Bank by mcsoft on Friday March 10, 2023 @07:56PM (#35103740)
exactly
Re:FDIC Takes over Silicon Valley Bank by tylerhou on Friday March 10, 2023 @05:56PM (#35102425)
Programmers like a single source of truth — until duplicating data is necessary for reliability (redundancy) or performance (replication).

There is a reason why planes use 3+ CPUs running the same code, or why Google runs more than just one cluster of search.

Re:FDIC Takes over Silicon Valley Bank by danbruc on Friday March 10, 2023 @07:18PM (#35103325)
I think programmers find double-entry bookkeeping counterintuitive. It feels error-prone. In programming, you keep a single source of truth. Any time you copy the same data to two different places, one of them is always wrong.

In essence you are just recording transactions with source and destination accounts and the amount. And at least in principle you could just log all transactions in this way without any redundant information. If you insist on making the change to each account more obvious, then you will have to record the amount twice, once for each account, but if you are doing the accounting with a computer, then I would guess that you always just record the transaction and only show the amount twice with different signs for the two involved accounts. Or does bookkeeping for some weird reasons really record each amount twice?

Re:FDIC Takes over Silicon Valley Bank by nulbyte on Friday March 10, 2023 @07:48PM (#35103657)
> Or does bookkeeping for some weird reasons really record each amount twice?

There is a surprisingly common reason, but it isn't weird. Consider a paycheck. You have income, but then you split that up. Some pays for insurance premiums, some is withheld for taxes, some may be contributed to a retirement account, and some is deposited into a bank account. Earnings is a credit to an income account, but everything else is a debit to some other account. The total debits equal the total credits, but each credit and debit must necessarily be a separate entry, because they all affect different accounts.

Re:FDIC Takes over Silicon Valley Bank by sScTE9qEMCxEk34 on Saturday March 11, 2023 @12:23AM (#35105690)
> It all works out and is essential for "debugging" problems (when money appears to go missing -- or worse, materializes and you don't know why).

That's equally true in programming. The problem is that it only helps you debug problems that it created or participated in...

The difference in accounting is that it's not "two entries for the same thing". It's a credit and debit entry. It's a source and a target entry. It's two different entries for two different things, even though some of the details (like the transaction that they actually relate to) will be shared.

(And they're treated as separate "rows", rather than as additional columns on a single row, because it's a many-to-many relationship. Very database-designy!)