Sujet : Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?)
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 27. Mar 2025, 19:31:04
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250327110538.863@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-03-27, James Kuyper <
jameskuyper@alumni.caltech.edu> wrote:
On 3/26/25 05:59, Keith Thompson wrote:
David Brown <david.brown@hesbynett.no> writes:
[...]
Sure. But most people have forgotten such details long ago - negative
numbers are not part of daily life (except as an indicator of how much
you owe the bank...). After all, negative numbers are not natural!
>
Most people understand credits and debits.
From my experience, most do not. In particular, if you gave them
examples of a transaction and the relevant accounts, they would have no
idea which accounts should be debited, and which should be credited.
Or, well, they would know because the transaction would say so.
It will always be a debit/credit pair identifying the accounts.
What they wouldn't necessarily know is whether they are supposed to add
the credit or subtract it from the given account, and likewise
for debit.
Suppose Cash is used to make a $100 payment on a Loan.
I think that would be a transaction consisting of a $100 debit from the
Cash account, and a $100 credit to the Loan.
Both of them subtract: Loan gets smaller when credited;
Cash gets smaller when debited. Or ... do I have that backwards?
If you use $100 Cash to buy an asset that is recorded in Assets,
Cash will decrease as before by the debit, but Assets will increase
by the credit, unlike Loan. These accounts have the same "polarity"
because they are on that side of the ledger which tracks what the
business possesses. Equity and Loan are what the business owes to
external interests. Equity is the owner's stake in the business; Loan is
the lender's stake.
It is much, much better to just make the different types of accounts
have opposite signs. Anything owed, like Equity and Loan, runs
negative.
Things are more flexible then, because a transaction can then involve
two *or more* accounts. The deltas have to add to zero, that is all.
Thus a transaction can be valid that updates accounts
A, B, C and D with these deltas: A:10, B:-5, C:3, D:-8.
This is extremely convenient for record keeping. For instance
transactions that involve tax slices can directly record them in tax
accounts, without needing a separate transaction.
E.g. a transaction that collects a 1050 invoice from a customer can
assign the 50 of that to the VAT account, and 1000 to Cash, in one
transaction, while Equity decreases by the entire 1050 (going more
negative). Rather than having to credit Cash with 1050, and then
introducing a separate transaction which debits Cash by 50 and credits
Vat. That increasees the number of items recorded against each account
and requires transactions to be linked together for traceability.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca