Sujet : Re: do { quit; } else { }
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 13. Apr 2025, 03:53:08
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vtf8um$1s1am$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 12.04.2025 14:57, Kaz Kylheku wrote:
On 2025-04-12, bart <bc@freeuk.com> wrote:
[...]
The main difference is that the the expressions are the payload that
does the work, whereas declarations are just mental overead.
(Not for me, but okay.)
The thought process is that the C programmer has a data structure
layout in their mind and can write expressions to navigate through
it, from the top-level reference down to its leaves.
But, oh crap, the C programmer has to declare the things they are using
in that expression.
Different people might think differently. Myself (for example) I have
the structure in mind first, and then the natural traversal/navigation
through those structures; navigation follows the structure, which is
defined by the declaration. (And not vice versa.)
C brings a nice simplification here. If you can write the expression to
access the thing you are imagining, the declaration can be derived
from that shape.
This "simplification" is what might be the reason for some to dislike
it. And its "rationale" to be "derived from that _shape_[sic!]" which
is probably the source of the convoluted declaration syntax.
WRT "shape"; I'm certainly someone who would not mind (or rather who'd
appreciate) to have a * declaration ('ptr') and a * operation ('deref')
clearly differentiated and I've no need for a common "shape"; here my
primary requirement is certainly a clean, non-convoluted declaration
syntax.
Janis