Also I am sure that accounting students or those who have studied accounting in school will find some aspects of this challenging since I explore some areas that accountants are not taught about and because, as a history buff, I refuse to believe that certain designations are arbitrary.
I think that the apparent evolution of double entry accounting shows a number of potential approaches for dealing with the very difficult distributed transaction issues of today, not so much in what to do but where to look for answers.
The Tally Stick System and the Origins of Double Entry
In medieval Europe there were two basic economic constraints. First most people could not read or write or perform arithmetic on paper, which limited the forms of exchange possible. Secondly there was a perpetual shortage of currency which meant that official money was not really possible to use money as a simple medium of exchange. These problems were resolved by the development of the split tally stick. The split tally stick evolved through the Middle Ages into a very highly developed system and was still in active use in some places into the 19th century. Ironically it was an effort to destroy these sticks held by the British Government in 1836 which burned down both houses of parliament.
At its fully fully developed form, a split tally stick consisted of a stick, usually of hazel, which had notches carved in it. The stick would be split length wise and one side would be cut short. The long side would be called the stock (trunk) and represented the debt. It would be held by the creditor. The short side, called the foil ('leaf') would follow the loan.
The creditor, at the allotted day, could show up and present his stock and demand payment. If the creditor tried to pad the debt by adding more notches, this would be immediately apparent, and there was no way to erase notches on the other side. Additionally it was immediately apparent if the sides were from different tally sticks.
As the Middle Ages progressed, literacy became somewhat more widespread. From the days of the Merovingian king, Charles Martel, through the "Carolingian Renaissance" in to the high Middle Ages, literacy began to become more open beginning with kings and eventually being available to the children of wealthy merchants. With literacy came basic knowledge of arithmetic and eventually algebra, and the efforts to track tally sticks on paper may have given rise to double entry systems of bookkeeping.
The first step of course is a journal. Here the tally sticks could be recorded. The bigger stocks (like bigger numbers) would be reported on the left, while the smaller foils would be reported on the right. One could then get a quick breakdown of one's position in terms of debt collectable vs debt owing. Within a few hundred years, this develops into general ledgers and the full double entry accounting system that has not changed in its outlines since Luca Pacioli wrote about it in the 15th century.
However it is worth noting that split tally sticks are inherently double entry in the sense that every debit has a corresponding credit, and they are inherently accrual since income and formal payment could not be as well correlated as could invoice and income. Moreover the rules for stock and foil appear to have tracked the rules for debit and credit today.
It is finally worth noting that even in Pacioli's day, and even a hundred years later, tally sticks were in common use in this way. Therefore, it seems to me that Pacioli himself was probably familiar with these and so his use of Latin terms corresponds almost certainly to the tally stick approach.
Business as Owning Nothing for Itself
Many of the principles I have found while investigating the origins of double entry accounting are challenging to us today and force us to think about businesses differently. Exploring the development of designs of older functional systems also better prepares us to think about design ourselves in areas of software where we are building complex functional systems today.
In a double entry accounting system, a business owns nothing for itself. Everything it owns, it owes to its owners. This is why the books always balance and why debits always equal credits. Corporations are a legal fiction which post-date the development of double-entry accounting systems but even they don't own things for themselves. Their equity is owned entirely by their owners. A corporation owns things only on behalf of its shareholders. Limited liability only means that the effective equity cannot drop below 0 and a corporation has no possessory interest distinct from those of its stockholders.
This understanding is also behind the fundamental accounting equation that assets - liabilities = equity.
As long as the books are guaranteed to balance, then it is possible to detect errors by balancing the books (using a trial balance, as Pacioli suggests). This is only possible if the intrinsic net worth of the business is always 0 (when we talk about the net worth of the business, we are talking about the extrinsic net worth, namely the equity balance, see below, but this is actually the net balance of debt owed by the business to its owners--- while an individual may on balance be worth a million dollars, this means something very different than if a business is worth a million dollars because the business, unlike the individual, owes that money to someone).
While stock and foil tally sticks were originally used to track debt, Henry I of England required that they be used for receipts for taxes in the 11th century. The process followed the pre-existing use, where the stock follows the person who has given money, while the foil was retained by the exchequer as a receipt of money retained. The continued use of this sort suggests that the basic principles of double entry accounting were already known to some extent. If tax liability is a debt owed, then the payment is a debit and one receives a stock, while the foil follows the money given.
It is my belief that the basic principles of double entry accounting were explored first with tally sticks and later, as literacy became somewhat more widespread, on paper.
What Accounting Systems are Designed to Do
Accounting systems are designed to do one thing only, to track who owes what to whom. Even tracking of current assets is a part of that since all assets of a business are effectively owed to the owners.
This may sound overly simplistic but the anthropological assessment on the origin of money is that money itself arises as a way to quantify debt. Debt pre-exists money systems, and all economies are powered by debt, and this is particularly noticeable in gift economies where debt, in the form of honor, is the primary currency. Everywhere debt precedes payment, and everywhere debt precedes money. Therefore not only is accrual-basis accounting better in terms of reporting, but it better represents what actually is happening economically.
Debits and Credits
In the 15th Century, Luca Pacioli wrote his now-famous book on arithmetic, including a section on double-entry accounting. Pacioli did not invent the system. Instead his description is that of the Venetian system which was already in use at the time. In general, the design is indicative of accrual-based accounting however in part because assets include debts owed to the business. This actually is clearer when looking at the Latin terms Pacioli uses in his descriptions and how these fit together, Namely he uses the terms "debit" and "credit" to refer to financial units which are clearer in Latin than they are in English and much of our accounting terminology derives from his work.
Pacioli's use of debit and credit are specifically of distinct concepts, and when every accounting student is taught these are arbitrary, every accounting student is taught wrong.
In Latin, debit refers to something which is owed and indeed it leads to our modern English word debt (via Old French). The word derives from early Latin roots meaning "to take away something you have" and so it denotes a loss of a possessory interest in something.
A credit is the opposite side of a debit. A debit is something owed. A credit (from credere, to believe or trust, related to "creed" in Modern English) is something entrusted to someone else or loaned to them. This term denotes a continued possessory interest in something, even as it is entrusted to someone else. So we can most simply translate debit and credit as debt and investment or loan, respectively. Being opposites, a credit abates a debit and vice versa.
Also being opposite sides of the transaction every transaction inherently balances. One person's debit must by nature correspond to someone else's credit. By entering everything from the perspective of the counterparty, whether customer, vendor, or owner, the books will be guaranteed to balance, and this allows one to detect errors because the total intrinsic value of the business will remain 0.
For this reason both debits and credits have two distinct meanings. One is to off-set the other (paying back a loan is a debit against the corresponding credit), and the other is to represent debts (debits) and assets entrusted to the business but possessed by others (credits). Every type of account furthermore has a specific type of counter-party but these fall into two categories: owners (equity, and change-in-equity accounts, namely accounts for tracking income and expenses) and non-owners (assets and liabilities).
From this point we can derive the normal balance of every account because we understand the basic structure and functions of the system:
- Asset accounts track debt and debt payments by those who owe money to the business. Therefore they use debits for positive balances. Being debits, they can be used to pay off loans made to the business (credits) or investors (investments are credits). The perspective is that of the debtor.
- Liability accounts track loans and loan payments to those the business owes money to. Therefore they use credits for positive balances. The perspective is that of the lender.
- Equity accounts track investments in a business which reflect the value of the business to the owners. Therefore they use credits for positive balances. The perspective is that of the owner.
- Income accounts track positive changes in equity. Therefore they use credits for positive balances. The perspective is that of the owner.
- Expense accounts track negative changes in equity. Therefore they use debits for positive balances. The perspective is that of the owner.
What Software Engineers can Learn from Accounting Systems
Most of the time, those of us who design and write software find that our approaches are relatively orderly but fragile. Aspects of a system fail to support each other, and we basically add complexity to the system in order to hold it together. Highly engineered systems are thus brittle, or to the extent that they are not, require layer upon layer of complexity in order to keep working. These systems often cannot continue to be maintained properly once people have forgotten why certain design decisions were made in the first place.
In contrast, double entry accounting systems (particularly accrual-based systems), which probably arose organically during the Late Middle Ages until they became important enough for Pacioli to write about, is a highly evolved system. The overall approach, while difficult to grasp at first, can be maintained without any understanding of the reasons behind the design decisions. Accounting systems have further evolved from Pacioli's day, presumably through the same process they evolved before then. People understand, in general terms, principles required to get meaningful information out of the system, are confronted by new problems, and respond by experimenting and sharing results, until new approaches take root.
One thing we as engineers can do is look to some of these highly evolved systems, and how they change over time, and recognize that they show us what may be a better way to create highly robust systems that tolerate and detect errors well. In double entry accounting, we look to owners 'interest in the business vs the business's interest in everyone else's assets and make sure they are equal. This adds redundancy in entering information but it also adds richness in reporting that is not possible otherwise. Perhaps there are opportunities for things like this elsewhere.
Here, with double entry accounting, the perspective chosen, namely the value of a business to itself, is an easy one to check. Such a business will inherently have no value to itself. Choice of perspective makes some difficult problems (like catching data entry errors when tracking money) relatively simple to catch, locate, and correct. Sometimes the most elegant solutions are not in what you do but how you look at things. This is very clear when it comes to this specific sort of system.
The real challenge going forward in my view is how we look at distributed systems and what perspectives we can find which make these problems elegantly solvable. As with double entry accounting, this will probably have to arise from looking at pre-computing methods, for example petty cash management as a basis for a guarantee of eventual consistency in a distributed transaction. Current approaches like those adopted by the NoSQL community don't get us there. Approaches that draw from our experiences doing non-distributed transactions well as well as paper forms of distributed transactions may, however provide something a lot more robust and usable.