| Deutsch English Français Italiano |
|
<20250327110538.863@kylheku.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <643-408-1753@kylheku.com> Newsgroups: comp.lang.c Subject: Re: Integral types and own type definitions (was Re: Suggested method for returning a string from a C program?) Date: Thu, 27 Mar 2025 18:31:04 -0000 (UTC) Organization: A noiseless patient Spider Lines: 59 Message-ID: <20250327110538.863@kylheku.com> References: <vrd77d$3nvtf$2@dont-email.me> <vrdhok$47cb$2@dont-email.me> <20250319115550.0000676f@yahoo.com> <vreuj1$1asii$4@dont-email.me> <vreve4$19klp$2@dont-email.me> <20250319201903.00005452@yahoo.com> <86r02roqdq.fsf@linuxsc.com> <vrh1br$35029$2@dont-email.me> <LRUCP.2$541.0@fx47.iad> <vrh71t$3be42$1@dont-email.me> <KFVCP.594649$SZca.498578@fx13.iad> <vrhb77$3frk8$1@dont-email.me> <vrru8f$174q6$1@dont-email.me> <86o6xpk8sn.fsf@linuxsc.com> <vrtmu4$2s1q2$1@dont-email.me> <20250325011327.41@kylheku.com> <20250325131110.000056bd@yahoo.com> <86bjtpjp22.fsf@linuxsc.com> <vruid4$3iuvq$1@dont-email.me> <87iknw7sz8.fsf@nosuchdomain.example.com> <vs0e6r$1avlb$2@dont-email.me> <87sen05cza.fsf@nosuchdomain.example.com> <vs4324$od4j$1@dont-email.me> Injection-Date: Thu, 27 Mar 2025 19:31:05 +0100 (CET) Injection-Info: dont-email.me; posting-host="7fadb7d092ba26bd3c219599bf0a46ce"; logging-data="865063"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19HVCp3OMhwZjYproOlqdVPEFTZ++msh/o=" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:M3mRHI8Mhmj4jQNmQRM9X/sY3Zc= 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/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca