Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: technology discussion =?utf-8?Q?=E2=86=92?= does the world need a "new" C ? Date: Mon, 12 Aug 2024 15:36:54 -0700 Organization: A noiseless patient Spider Lines: 36 Message-ID: <867ccl2ws9.fsf@linuxsc.com> References: <871q48w98e.fsf@nosuchdomain.example.com> <87wmlzvfqp.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Tue, 13 Aug 2024 00:36:58 +0200 (CEST) Injection-Info: dont-email.me; posting-host="7741d78d7fa92162b25738c81b1a0845"; logging-data="3686921"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181jlMVkH1Mll4Y99szMrUTqGQ3cVDw81M=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:bB20qPjJPqogyiSsRQMPARpG2NA= sha1:dF4U6I9B9puraHsYJLqpkq4XmiA= Xref: csiph.com comp.lang.c:387529 bart 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.