Live data from Hacker News

Double Entry Accounting for Developers

django-hordak.readthedocs.io

171–180 of 237 posts

Re: Double Entry Accounting for Developers

#171
post #22

Earlier quoted context omitted.

It is not incorrect. To make everything positive (and use the subtraction as you have) you need to have two different types of 'positivity' Credit and debit. And then you have to remember which things are subtracted and added so it gets back to balancing. That's why it gets so complicated. Money in your bank account is _negative_. It is a _debit_ in your accounts (this is not my invention this is true). Your bank acc…

Equity is similar to a liability. Ít is owed to the owners of the entity. Making assets positive in code is conventional.

> Equity is similar to a liability. Ít is owed to the owners of the entity.

You can kind of see the easy rationale there. I'm not sure it's very deep though. Revenue is in the same group (Credit). And the assets are like expenses (Debit). That is a bit more of a just-so-story in my mind.

> Making assets positive in code is conventional.

Are you sure? What code are you talking about?

Making everything positive in the UI is certainly common. And not showing whether a value is credit or debit. But I really hope my accountancy software isn't coded that way! It needs to track whether a number is a credit or a debit. It could do it with an unsigned value in a struct with a 'is_cr' Boolean and some custom operations to combine the money structs. But I've only ever seen code using signed values, because it is so much faster and less errorprone. Doing it manually is just reinventing the math of negative numbers. And then, the overwhelming convention is the former is positive, the latter negative, not the other way round.

Re: Double Entry Accounting for Developers

#172
post #149

Earlier quoted context omitted.

If your banana is for consumption and you pay cash: Then debit Food Expenses (decrease equity) and credit Cash (decrease assets). Accounting equation is balanced. If your banana is for resale and you pay cash: Credit Cash (decrease assets) and Debit Trading Stock (increase assets). Accounting equation is balanced. If your banana is for consumption and you buy it on credit from your supplier: Credit Loan account (incr…

It doesn’t quite. You’ll also need to consider allocations and accounting for tax (sales and income), depreciation, transaction fees, warehousing, shipping revenue and expenses, revenue and expense recognition, discounts, returns, overpayments, prepayments, futures, chargebacks, refunds, credit notes, invoicing, subscriptions, subsidies, tariffs, reconciliation, adjustments in the current financial year, adjustments…

I specifically stated it was an unsophisticated example. GP wanted to know what happens with the "simplest transaction" when he buys a banana.

Re: Double Entry Accounting for Developers

#173

Note to people looking for job security: there is a HUGE need for developers who understand finance. The fundamental problem is that most finance people can't speak the language of software development (the biggest problem I've seen is that finance people tend to be very poor at writing out a spec of what the software should do - they're much better at looking at a set of examples and then telling you if the calculat…

Yup. I just commented above to someone, saying their accounting BA before switching to CS was a waste of time. Too bad they feel that way. Opportunities for that combination have never been brighter. Enormous niches in debt and banking are in the midst of a wholesale tech transformation.

That is great to hear! Would there be any particular tools or stacks to focus on? You mentioned tokenization -- is that related to blockchain?

Re: Double Entry Accounting for Developers

#174
post #128
post #121

Earlier quoted context omitted.

Not only is Martin Blais' explanation very helpful, his software, Beancount, is also very suitable for any personal finance projects, especially if you have a background as Developer. Personally, I combine beancount with fava and find it much better than e.g. GnuCash.

Is beancount the kind of tool that's mostly useful if you put a lot of time into it, like Emacs? Or is it immediately useful with even small investments of time?

If you're familiar with double-entry bookkeeping, I found it very easy to get started. If you're not, it will take some time to familiarize yourself with that concept.

Re: Double Entry Accounting for Developers

#175

Earlier quoted context omitted.

Depreciation is also neither a credit nor a debit. Doesn't one normally handle depreciation by creating an expense account called "depreciation", and recording the depreciation as a debit in the asset account and a credit in the depreciation account? And couldn't one just as easily word that as, "We track the depreciation by creating an account for it, and recording a flow of money into it from the asset's account?"

Yes, but the other way around: you debit the "Depreciation" expense account (since it is the sink, it increases) and credit the asset account (it is the source, it decreases).

I rest my case.

Re: Double Entry Accounting for Developers

#176
post #121

Please take a look at document [1] by author of beancount regarding how to do double entry accounting, including introduction to single entry bookkeeping. So far I find this is the best resource for developers to learn about accounting along with illustrations. Debit and Credits are introduced later once the basics are explained in details grounded in accounting principles in play for thousands of years. [1] https://…

Not only is Martin Blais' explanation very helpful, his software, Beancount, is also very suitable for any personal finance projects, especially if you have a background as Developer. Personally, I combine beancount with fava and find it much better than e.g. GnuCash.

Beancount+Fava is awesome if you're a developer who understands double-entry accounting.

Re: Double Entry Accounting for Developers

#177
post #149
post #143

Earlier quoted context omitted.

The stumbling block for me learning it was understanding how to record the simplest and most common transactions like buying a banana. Surprisingly many explanations only use examples like paying your home mortgage where the credit and debit side of things are clear. But then they never tell me about where on earth does my banana go as a credit since I'm not stockpiling bananas to later sell. Even though that use cas…

If your banana is for consumption and you pay cash: Then debit Food Expenses (decrease equity) and credit Cash (decrease assets). Accounting equation is balanced. If your banana is for resale and you pay cash: Credit Cash (decrease assets) and Debit Trading Stock (increase assets). Accounting equation is balanced. If your banana is for consumption and you buy it on credit from your supplier: Credit Loan account (incr…

I'm glad you guys understand it in South Africa, and if I ever wanna open an accounting start-up, I'll be sure to source talent from there, but you lost me:

> Then debit Food Expenses (decrease equity) and credit Cash (decrease assets)

Why are you decreasing the number in two columns?

I don't really need to know personally, but I hope this gives you an idea of what kind of things confuses people.

I don't think the basis of double accounting in the sense that "every thing in and out must end up equalling zero" is super sophisticated concept to grasp, at least superficially.

But once it is applied to situations where things intuitively are just going out of your budget (like buying and eating something: you're left with no money and no banana) and on top of that use counter-intuitive words, I hope you can appreciate that people get confused.

Re: Double Entry Accounting for Developers

#178
Modeling the problem for devs is actually not the hard part, the math is somewhat simple for the accounting part (time value of money gets more fun, but I digress). The hard part for me still is undoing years of language baggage associated with words like Debit and Credit, which Increase and Decrease things that are treated as negative or positive depending on pov. In almost every case, I interpret the meaning wrong, and have to reparse.

Look at this sentence from another comment: "If your banana is for consumption and you pay cash: Then debit Food Expenses (decrease equity) and credit Cash (decrease assets)."

It flies in the face of our habitual, naive, and common use: "I'm crediting cash? But I spent it! Shouldn't I debit cash, debit is lowering? No? But if I have credit, I have more! No? Is that Comparative Literature class still available to switch into? No?"

The categorization are not always based on logic that is commonplace, and has legacy trappings. The terminology is different from what a naive reader might expect.

To be fair, many sciences have evolved this way. But like the French phrase "false friends", words that sound like one thing in another language but have a total different meaning in their own tongue, I think the struggle is to adjust mindset to the new meanings of words we use frequently, more so than the concepts of balance and systems of equations.

Re: Double Entry Accounting for Developers

#179
post #164
post #163

Earlier quoted context omitted.

If the things you're doing are so simple that you don't have to worry about credit or debit, you are free to show it that way. But if you are doing accounting, debits and credits and balancing is important. So yes, if you are happy to ignore debit/credit/balanced books, you are welcome to view asset as $2m. And lots of the simple accounting software will show it that way. But by the time you are having to understand…

Yes, balancing is important. That’s why I’d prefer to end with assets that make sense in the balance sheet (or maybe you're happy to ignore balance sheets and don't want meaningful numbers?). I don’t see what do you gain by making the assets negative. Believe it or not, I’ve seen financial accounts quite more complex than two lines (and they never included those CR/DB annotations in the balance sheets or income state…

This has been an interesting conversation with several people. I am really surprised how much negative numbers are confusing or interpreted as my idiosyncrasy.

> I’ve seen financial accounts quite more complex than two lines

Definitely.

For hundreds of years the convention has been columns. Credit values in the right-hand column, debit values in a left-hand column. The column is the label of which type of money it is. Most accountancy software (other than very simple personal tracking apps) use this when displaying.

Your printed bank statement probably does (and it may label the columns credit and debit as well, though never line by line, iirc). Mine did back when paper was the thing.

Digital bank statements usually do use negative numbers (DB being negative, as I've been saying). You are used to seeing this, but not used to thinking in your own accounting terms rather than theres. Which is fine. But there is a reason that accountancy education has to undo that assumption.

Re: Double Entry Accounting for Developers

#180

Earlier quoted context omitted.

I’ve found the best way is to remember the phrase, “Debits come in and credits go out.” Let’s say you have a bank account. Your view of that account is opposite from the bank’s view. You have $100 cash. That’s an asset from your POV, and it carries a debit balance on your books - when you received it, the cash “came in”. You walk into the bank and deposit it. The cash goes out of your books, but an asset (the increas…

>It’s conventional to make assets positive (hey, having lots of assets is good, right?). OP gains nothing but confusion by turning everything upside down. I agree. However, the problem is that you can either make the vocabulary consistent or you can make the math simple, never both. Making the math simple means you have to make a decision to always treat debits as positive and credits as negative or the other way aro…

Not inconsistent. It’s a matter of POV. Your mortgage is an asset from the bank’s POV, but a liability from your POV.

Expenses come in and cash goes out. Debit expense, credit cash.

From an accountancy POV, the debits of a transaction equal the credits. From a software POV, the account changes total zero. There is a difference in what the word “balance” means.

Post reply on HN