Live data from Hacker News

Accounting for developers part III – building a lending marketplace

moderntreasury.com

1–10 of 18 posts

Re: Accounting for developers part III – building a lending marketplace

#5
Having contributed to a project that needed to apply these principles in a previous role, it can’t be understated how important it is to understand these concepts.

One thing I found interesting though is that one feature of double entry accounting is creating a paper trail where some lost data can be reconstructed if necessary with redundancies. For example if you lose the physical pages detailing a transaction, you can figure out what happened based on data contained in another page. A problem we ran into was how to reconcile that methodology with how this would be solved in code (e.g. DB backups).

Re: Accounting for developers part III – building a lending marketplace

#6
I still don't understand why they encourage double-entry accounting for tech. In my experience entries like:

| amount | payer_id | payee_id |

| 100 | 1 | 2 |

are more than sufficient. He uses Square, Uber, and Airbnb as examples in https://www.moderntreasury.com/journal/accounting-for-develo... but, as far as I can tell, only Square uses double-entry.

Double entry accounting was for when people were hand-writing a ledger and it helped avoid mistakes. It makes no sense in code and it just makes your DB queries more complicated.

Re: Accounting for developers part III – building a lending marketplace

#7
post #6

I still don't understand why they encourage double-entry accounting for tech. In my experience entries like: | amount | payer_id | payee_id | | 100 | 1 | 2 | are more than sufficient. He uses Square, Uber, and Airbnb as examples in https://www.moderntreasury.com/journal/accounting-for-develo... but, as far as I can tell, only Square uses double-entry. Double entry accounting was for when people were hand-writing a le…

Isn't your example double entry? It shows both accounts involved in the transaction and the direction of the transaction.

Re: Accounting for developers part III – building a lending marketplace

#8
post #6

I still don't understand why they encourage double-entry accounting for tech. In my experience entries like: | amount | payer_id | payee_id | | 100 | 1 | 2 | are more than sufficient. He uses Square, Uber, and Airbnb as examples in https://www.moderntreasury.com/journal/accounting-for-develo... but, as far as I can tell, only Square uses double-entry. Double entry accounting was for when people were hand-writing a le…

what do you mean dont use double entry and use a DB query instead?

if your customer is paying you, how will you record that transaction?

Re: Accounting for developers part III – building a lending marketplace

#9
post #6

I still don't understand why they encourage double-entry accounting for tech. In my experience entries like: | amount | payer_id | payee_id | | 100 | 1 | 2 | are more than sufficient. He uses Square, Uber, and Airbnb as examples in https://www.moderntreasury.com/journal/accounting-for-develo... but, as far as I can tell, only Square uses double-entry. Double entry accounting was for when people were hand-writing a le…

What happens if you need to split that $100 from payer_id 1 into 2 payer_id 2's?

I.e. that $100 is actually:

$99 from 1 to 2 and $1(let's say in taxes) to payer_id 3.

The easy answer is, make it 2 transaction, $99 to 2 and $1 to 3, but then you can't tell that the $1 in taxes is from the $99 transaction. That leads to headaches when you need to balance your taxes.

Re: Accounting for developers part III – building a lending marketplace

#10
post #6

I still don't understand why they encourage double-entry accounting for tech. In my experience entries like: | amount | payer_id | payee_id | | 100 | 1 | 2 | are more than sufficient. He uses Square, Uber, and Airbnb as examples in https://www.moderntreasury.com/journal/accounting-for-develo... but, as far as I can tell, only Square uses double-entry. Double entry accounting was for when people were hand-writing a le…

One good technical reason to prefer double entry and relating to the "it helped avoid mistakes [in hand-writing ledgers]" is that double entry patterns encourage better database transaction discipline and provide helpful debugging clues when database transactions half-finish and accidentally commit rather than rollback. Atomic database transactions with single row inserts of accounting transactions are obviously simpler to build, but it also means you are less likely to test multi-row database transactions such as scenarios where you need to make sure an accounting transaction lands in an atomic commit with say a purchasing invoice row. Double entry accounting, especially when different types of accounts may be in different tables forces your codebase to use good database transactions and sometimes more thorough testing of your commit versus rollback code paths.

Also, in my experience double-entry tables are often much easier to DB query because the tables "naturally" look exactly like the ledgers accountants expect to see in reports. The math in aggregate queries is often just SUM and nothing else, no complicated case logic for "different transaction types" or complicated pivots from transactions to account views and back.

Post reply on HN