9 ms·
From the site: "I found the core explanation of double entry accounting to be confusing. After some time I distilled it down to the following: "Debits decreas
by goat_whisperer 6y ago
From the site:
"I found the core explanation of double entry accounting to be confusing. After some time I distilled it down to the following:
"Debits decrease the value of an account. Always. [1]
Credits increase the value of an account. Always. [1]
"[1] (1, 2) This is absolutely not what accountancy teaches. You’ll quickly see that there is a lot of wrangling over what account types get increased/decreased with a debit/credit. I’ve simplified this on the backend as I strongly feel this is a presentational issue, and not a business logic issue."
I mean, this is just....wrong. Maybe I'm not smart enough to see why this isn't completely incorrect? I mean I feel mathematically this will work but goes against so many core accounting principles it won't have much use except in the simplest of cases.
- akgoel 6y agoEven bullet 4 has assets and expenses multiplied by -1. Completely .... wrong. Maybe this might work for a bank where assets and liabilities are sort of flipped from a non-bank business?
- sago 6y agoI agree. Except I think you're being generous :) It would not work for a bank. The only reason they 'sort of flip' is that they give your account from their perspective. Your statement is a slice of their accounting.
- patmcc 6y agoBanks and non-banks don't treat assets/liabilities in different ways in accounting - banks just engage in transactions most other businesses don't, as a normal matter of business. For example - if you're holding someone's money for them, that's a liability - you have to pay it back some time. If someone owes you money, that's an asset - it's worth something. Banks use the cash from liabilities (people's savings accounts) to pay for assets (mortgages) and make money on the spread.
- navaati 6y agoExcept Fractionnal Reserve. It kinda throws off the idea, how do they do then ? Let's see, when they lend money they don't have (which is what it is) they increase the number on your account, that is they create a big liability for themselve. On the other hand they create an asset wich is your debt to them. So accounting-wise, it works out, like theorically I could do that (lending) even if I have €0, it's all paper. But then you're gonna go and empty that account to buy your house, reducing their liability and taking (reducing) their cash instead... that they don't have ! So how does it work ? Does it just work because you don't actually buy houses with bills and coins but with bank transfers, then just shifting the paper magic to another bank ? To be honest I know they can do something my broke self can't, and it has to du with central banks, but what is it exactly ? Something like "if everybody happens to empty their account to cash at the same time, don't worry mate we'll print them bills and give them to you, pinky promise" ?
- inopinatus 6y agoThey’re not flipped. From a bank’s point of view, any money they hold on your behalf is a liability. Your bank statement is an extract from their books. When they take a fee, it’s a debit on your statement, because it’s a credit to revenue on theirs.
- deleted 6y ago[deleted]
- watsocd 6y agoThat was the first thing I saw that was wrong. All account balances should normally be positive. Depending on what side of the balance sheet they are, a debit or credit could increase or decrease an accounts balance.
- bdowling 6y ago> I mean, this is just....wrong. It's beyond wrong. The developer here is redefining established accounting terms because he doesn't like their inconsistencies.
- gowld 6y ago> It's beyond wrong. How so? > The developer here is redefining established accounting terms because he doesn't like their inconsistencies. Yes. What's wrong with fixing inconsistencies? Established accounting terms are from 500 years ago when people had trouble with subtraction.
- mariomariomario 6y agoGenerally Accepted Accounting Principles
- bdowling 6y ago> What's wrong with fixing inconsistencies? In general, nothing. It's just not the software developer's job. If the accounting profession decided to change certain terms to fix inconsistencies, that would be fine.
- fauigerzigerk 6y agoI think that's missing the point of the original article. Of course you have to present a view of the accounts that is consistent with accounting rules and conventions. But that doesn't necessarily mean you have to adopt that external view as an internal model for any software you're writing.
- inopinatus 6y agoAt audit time the world of “holy shit what were these people thinking?” will be colossal, because we do not get to pretend that a system is a black box at audit time. If those records don’t make sense to an accounting professional, then they’re fucked up, and that’s all she wrote. The world of audit has seen a million shysters try to falsify their books under the guise of alternative methods, and they are not interested in some self-serving hubris from programmers about re-inventing their own profession. So this guide isn’t just philosophically off beam. It could get someone fired or sued. Probably not prosecuted though. Probably.
- neffy 6y agoThe operation performed by debit/credit depends on the classification of the accounts. Accounts are listed traditionally with Assets on the left, and Liabilities and Equity on the right. A debit to a Liability account is a minus, and a credit is a plus, but it's the other way around on the asset side, where a debit is a plus, and a credit is a minus. (This kind of thing happens when English mugs other languages - Italian in this case - for its vocabulary). The easy way to remember this is just to think that the right hand side is what you think it should be, and the left hand side isn't. Double entry book keeping is under appreciated - it's one of the earliest examples of error correction and detection coding kicking around.
- wrycoder 6y agoI’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 increase in your bank account) comes onto your books. You credit cash and debit asset. From the bank’s POV, cash came in - they debit their cash account. And they credit your account in their books. That account is a liability from their POV - they owe you the money. Notice how the debit and credit to cash even balanced across entities. If you talk about pluses and minuses, you’ll get confused quickly. One of the worst things that ever happened was banks issuing “debit cards”. When you take cash from an ATM, it’s a debit from the bank’s POV. The bank carries your account as a liability, which carries a credit balance. (You are the bank’s creditor!) So the bank debits your account (credit came in again) and credits their cash (cash went out). You credit the bank account on your books (asset went out) and debit your cash (cash came in) Just remember that a “debit card” reflects the banks POV and don’t let that confuse you about the meaning of “debit”. Debiting an asset is generally a good thing! When making accounting transactions, debits always balance credits - meaning they total to zero in the code itself. 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.
- 6y ago
- jlj 6y agoI learned from my accounting 101 professor, "debits on the left, credits on the right." Then later after learning about natural account balances, it all made sense. If an account has a debit balance, a debit increases the balance and a credit decreases it. An asset or expense account has a debit balance. Credit balance is just the opposite. Liabilities, revenue, accounts. Credit is an increase, debit decrease. (I think equity too but I always have to look it up. Rarely work with equity accounts in my day to day)
- juped 6y agoEquity accounts are confusing.
- jkulubya 6y agoI wish I could tell you how to remember it from first principles, but I can’t do what I did was burn the A = L + (OE/Equity) accounting equation into my head. Then I remember that the when my bank balance goes up, the bank speaks of a credit in their accounts which is a debit to assets in my account. Then L + OE must be credit accounts. Why are OE and L on the same side? Well to finance an asset, say a new car for your business, the company would either take on some debt (L) or you’d put in some of your own money (OE) in exchange for more ownership. I don’t know if that’s more confusing or less
- juped 6y agoI mean, it's not hard to remember. They're liability-like. It's just their uses in practice that're confusing. BTW, nonprofits have Net Assets accounts instead of Equity accounts.
- juped 6y agoThis comment expressing confusion on this valiantly misguided OP seems like a good place to throw my standard explanation out into the aether to do neither readers nor myself any good. A transaction has two polarities, because it represents a flow of value. The credit side is the source, the debit side is the sink/destination/whatever. Let's temporarily pretend that every transaction hits exactly two accounts for the moment (which is not true), to make it easier. Let's say we have $1000 in Cash, which is an Asset, and we want to buy a Pizza, which is also an Asset, for $20. How does this look in accounting? Cash provides the source side, and Pizza provides the sink. Cash is credited $20, and Pizza is debited $20. If we ran the balances now, Cash would come out to $980, and Pizza would come out to $20. Let's unwind that transaction. We're a business; we don't trade cash for pizzas. We contract for delivery of pizzas with a pizza vendor, who invoices us. So here we are, with $1000 in Cash and $0 worth of Pizza. The pizza delivery driver comes, and hands us a pizza and an invoice. We know we have to debit Pizza $20; what is the credit source for this debit? Well, the pizza vendor has actually extended us a loan worth $20, in a sense (this is called "trade credit"), and the offsetting entry is the fact that we owe the vendor $20, as memorialized in its invoice. This goes in a Liability account, usually called something like Accounts Payable. Current balances (if we ran them - "running the balances" is thought of by accountants as a discrete operation, just FYI): Assets/Cash $1000 Assets/Pizza $20 Liabilities/Accounts Payable $20 Accountants think of accounts as being naturally debit-increased, like Assets, or naturally credit-increased, like Liabilities. I find it a bit misleading to try to think of these as positive or negative signs, as you might be inclined to at this point. It's just $20 - don't even think of it as cr $20, IMO. (dr and cr are the abbreviations for debit and credit.) Let's just leave that on the books and eat the pizza. After eating the pizza, we no longer have $20 worth of pizza, so we have to credit Assets/Pizza $20. What do we debit to offset this - i.e., where did the pizza value flow to? In this case, it would be a Depreciation account (these are debit-increased) - something like Depreciation/Eaten Pizzas. So we have: Assets/Cash $1000 Assets/Pizza $0 Depreciation/Eaten Pizzas $20 Liabilities/Accounts Payable $20 (a commenter below points out correctly that this would be an Expense, not a Depreciation, and I'm still in the edit window!) Meanwhile, someone pays us on one of our invoices, which we had sent out earlier offscreen. When we delivered our fine $50 widget and invoiced the buyer, we entered that into our accounting system as a debit of $50 to Assets/Accounts Receivable, and a credit of $50 to Assets/Widgets. This part of the system looks like (we still have 9 widgets in stock): Assets/Cash $1000 Assets/Widgets $450 Assets/Accounts Receivable $50 But now that the invoice is paid, $50 of value flows from our receivables asset into our cash asset - i.e., we credit A. R. $50, and debit cash $50. Getting paid is nice. Assets/Cash $1050 Assets/Widgets $450 Assets/Accounts Receivable $0 After the customarily long delay, our accounts payable department has approved payment of the pizza invoice. Cash has to be credited, because cash is flowing out, and it's probably easy to guess the debit where it goes to - that's right, our Liabilities/Accounts Payable is finally cleared, because we don't owe the pizza vendor $20 anymore. Assets/Cash $1030 Assets/Pizza $0 Assets/Widgets $450 Assets/Accounts Receivable $0 Depreciation/Eaten Pizzas $20 Liabilities/Accounts Payable $0 Hope that makes sense. It gets more complicated in real life. Accounting is nontrivial. If there are any accountants in the thread, maybe they can correct any errors I've made.
- juped 6y agoIt's actually less wrong, but still wrong, to say the exact opposite (i.e., "Debits always increase and Credits always decrease").
- qznc 6y agoIn my opinion the core idea is about the data model: Double entry accounting stores movements of money instead of accounts. Everything else follows from that idea plus a bunch of terminology.
- junkrat002 6y agoEx-finance SWE here. I closed the article after that part. If you don't understand accounting and read this, you'll only be more confused when you learn how accounting actually works. For the most part, devs in general should not be teaching accounting. There's a reason that it is so challenging to earn a CPA.
- Hamuko 6y ago>For the most part, devs in general should not be teaching accounting. There's a reason that it is so challenging to earn a CPA. Surely there's a big difference between earning a CPA and just knowing the basics of accounting. I had a summer job helping out with entry in a family member's small accounting firm. I don't think that double entry accounting is that crazy of a concept that it cannot be grasped by someone without a degree in the field.
- inopinatus 6y agoLearning anatomy doesn’t qualify someone as a surgeon.
- junkrat002 6y agoYes I agree, a vast difference between basic accounting and a CPA. I am not a CPA, but I do understand accounting. That doesn't change the fact that I'd be wary of any accountant writing a blog post on how to write good quality code for production. Are there accountants out there who can do a good job of that? Absolutely. Are there many more accountants who would do a poor job of that? My guess is also yes.
- rbg246 6y agoIt's not that hard to qualify, it's the equivalent of three years software engineering experience with some side study. It's more a case of someone who has one year of writing JavaScript shouldn't be writing on the theory of software development.
- junkrat002 6y ago
- Havoc 6y ago>I mean, this is just....wrong. I wouldn't call it wrong per se, but it's about what would happen if I as accountant designed a database architecture. It would work, but any programmer looking at the dodgy code would think "omg what have you done?"
- Lazare 6y agoThe traditional accounting identity is something like "Assets = Liabilities + Equity", or in an expanded form "Assets = Liabilities + Contributed Capital + Revenue - Expenses - Dividends" (from Wikipedia https://en.wikipedia.org/wiki/Accounting_equation https://en.wikipedia.org/wiki/Accounting_equation). You can re-arrange that as: Assets + Expenses + Dividends = Liabilities + Contributed Capital + Revenue Traditional accounting takes this as says: "All accounts have positive values. All transactions contain an equal number of debits and credits. Debits always come first, are always written on the left, and so it (sort of) makes sense for debits of left hand side accounts to always increase the value of the account, while debits of right hand side accounts always decrease the value in the account. Similarly, credits come second, are always written on the right, credits of right hand side accounts increase the value of the account, and credits of left hand side accounts decrease the value of the accounts." It turns out if you work through the implications of this, it works perfectly. I buy lunch for $5, so I must have a $5 debit and a $5 credit. That's an expense; my expenses are going up, expenses are on the left, so they go up via a debit. The matching credit could be to cash; cash is an asset, it's also on the left, credits make left hand accounts go down, that makes sense. Or the matching credit could be an accounts payable account, that's on the right hand side, and credits make right hand accounts go up, which again makes sense. The core logic here is that changes must balance. If your changes are both on one side, one will be positive and one will be negative (summing to 0). If your changes are on opposite sides, either both will be positive or both will be negative (still summing to zero). But, you could also re-arrange the equation further: Liabilities + Contributed Capital + Revenue - Assets - Expenses - Dividends = 0 Algebraically, that's the same. If you built a system on that, you could say something like "All transactions must sum to zero. Asset, expense, and dividend accounts are subtracted from the balance, while other accounts are added to it." That still works. My $5 lunch increases expenses, which is a "negative type" account, so I have to either increase a matching "positive type" account (like liabilities) or decrease a matching "negative type" account (like assets) so everything stays zero. It doesn't feel...easier, but it works. Or you could take it a step further, and weirder, and say: Assets + Expenses + Dividends + Liabilities + Contributed Capital + Revenue = 0 That...uh....doesn't work mathematically, unless you flip the sign of all assets, expenses, and liabilities. So maybe: (-Assets) + (-Expenses) + (-Dividends) + Liabilities + Contributed Capital + Revenue = 0 I dunno, this is getting a bit weird. Now my $5 lunch is a $5 credit and a $5 debit. Expenses has gone up, so that must be what the author calls a credit, but since expenses is a magic negative account the displayed value will go down. And then we must have a match debit (in the authors terms) which will make an account go down. And again, we can pick assets to go down (if I spent cash), except again assets is a magic flipped account so will make the displayed value of assets increase, or we could pick liabilities which is a normal account and thus the value will actually go down. Technically, all this is interchangeable. However: The standard form (LHS = RHS, debits increase LHS and decrease RHS, credits increase RHS and decrease LHS, debits = credits) is universally used around the globe, and has been in active use since the middle ages. It's also, in my view, relatively intuitive once explained. The middle form (all accounts sum to zero) is unorthodox, but also fine. Both require to to know an equality, and ensure that each transaction respects the equality. The linked form is, in my view, by far the least intuitive, and also re-uses accounting terms with a different meaning. Not only does it not, in my view, help novices understand accounting, but I fear learning it makes it actively harder because you'll need to unlearn it first. But it does, technically, work.
- SnowingXIV 6y agoSpot on. This is another situation of trying to solve a problem that doesn't exist and the writer does not understand at all. There are reasons why GAAP and IFRS exist. Accounting can make a lot of sense to a programmer, I've moved between fields early on with relative ease because accounting is extremely rule based/puzzle-oriented and adheres to a structured and specific framework. I haven't touched accounting in years (though I do have a bachelors in accounting) but this is jarring and would not recommend this to anyone.
- goat_whisperer 6y agoHey Snowing, would love to learn more about your experience -- I'm a fellow accountant (BS accounting) looking to move into development.
- SnowingXIV 6y agoNothing too special, I worked for a few large tech consulting companies early on in finance but did a bunch of a side development projects/freelance work as well. One of those ended up becoming a full-time gig so jumped ship and went from there. Best of luck!
- t-vi 6y agoWell, if you want to define accounting in an alternate universe, you can define it that way. However, if you want to describe accounting as it is done, it is utterly wrong. Doing this will bite you once you read other sources on accounting, talk to accountants, the tax office, etc. From my experience, if you're doing accounting beyond a hobby, you likely want to follow whatever GAAP (generally accepted accounting practices), and likely need to consult references for how specific cases are represented. If you then don't use the same language and conventions as everyone else, it's just even more of a pain than it is. My experience here is that I was with a large audit company, albeit as an actuary rather than an accountant. I did have the opportunity to dig quite deep accounting records of insurance companies there. Now I own an incorporated company and do my own accounting and taxes (with GnuCash for accounting, even if I hand-rolled reporting for XBRL export and all).