Sujet : Re: technology discussion → does the world need a "new" C ?
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.cDate : 12. Aug 2024, 23:36:54
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <867ccl2ws9.fsf@linuxsc.com>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
bart <
bc@freeuk.com> writes:
On 06/07/2024 19:28, James Kuyper wrote:
[...]
It is that conversion [from array designator to a pointer to the
first element of the array] which creates the illusion of array
indexing, but since it's been converted to a pointer, it is
actually pointer indexing.
>
Isn't that how all languages work 'under the hood'?
First, no, it isn't.
Second, it's the wrong way to think about it. People who always
think about what's going on 'under the hood' are forever doomed
to program in a glorified assembly language. The big problem of
programming in assembly language is it doesn't scale. Any program
above a certain size must develop and build on abstractions for it
to be developed effectively. Constantly thinking is assembly
language greatly interferes with that.
The net affect from the user's point of view is that you have an
array object, and use 'indexing' to access its individual
elements.
That's wrong. For some users, sure. But not all, and not "the
user". Beginners may think of it that way, but more experienced
C developers do not, at least not always. This is why it's
important that descriptions of how C works not disguise these
details, because it will have the effect of confusing beginning
programmers and likely slowing down their understanding, which
ultimately is a disservice to the C programming community.
You should feel free to think any way you like. But it's wrong
to insist that everyone else thinks the way you do. They don't.