Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #172371

Re: Why does the -> operator exist ?

From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c
Subject Re: Why does the -> operator exist ?
Date 2023-08-16 05:29 -0700
Organization A noiseless patient Spider
Message-ID <86zg2r5fxn.fsf@linuxsc.com> (permalink)
References (3 earlier) <874jlyq8re.fsf@nosuchdomain.example.com> <86pm3xbswl.fsf@linuxsc.com> <877cq5qfc6.fsf@nosuchdomain.example.com> <86wmxx7t7l.fsf@linuxsc.com> <87bkf9mg0y.fsf@nosuchdomain.example.com>

Show all headers | View raw


Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>
>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>
>>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>>
>>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>>>
>>>>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>>>>
>>>>>> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>>>>>>
>>>>>>> [...] I would argue that using `->` rather than `.` when the
>>>>>>> prefix is a pointer makes for more explicit code, which is a
>>>>>>> good thing;  [...]
>>>>>>
>>>>>> More explicit is not always better.
>>>>>
>>>>> No, it isn't.
>>>>>
>>>>> If you had anything to say about this particular case (`->` being
>>>>> more explicit than `.`, and whether it's better), this would have
>>>>> been a good opportunity to say it.
>>>>
>>>> In the particular case of using '.' instead of '->', more
>>>> explicit is not always better.
>>>
>>> That's a useless statement.
>>
>> No more useless than the statement from you that prompted
>> the discussion.
>
> My original statement, quoted above, was that using `->` rather
> than `.` is more explicit and that that's a good thing.  That was
> and is my opinion, applicable only to that particular case.  I've
> used languages that use `.` for both (where the prefix can be
> either a structure or a pointer), and haven't had any particular
> problem with that.  I have a preference, but not a strong
> preference.
>
> If I see `foo->bar` in C code, I know that `foo` is a pointer
> expression pointing to a struct or union.  If I see `foo.bar`, I
> know that `foo` is an expression of struct or union type.  I know
> that without looking for the declaration.  I sometimes find it
> useful to be able to understand something about a code fragment
> without having to understand 100% of the context.
>
> You apparently think that was a useless statement.  You apparently
> thought it was important enough to comment on it.

I didn't say your statement was useless.  I said only that
my statement is no more useless than yours.

> You refuted a claim that explicit is *always* better.  Of course I
> never said that, nor do I believe it.

I was not refuting, nor was I trying to refute, any such claim.
I was merely responding to a statement of your opinion, giving
a statement of my own opinion.

> I tried to invite you to expand on your statement.  Perhaps you
> think that dropping `->` and using `.` for both structs and
> pointers (and unions and union pointers) would have been better.
> Perhaps you have good reasons for your preference, assuming it is
> your preference.  Perhaps an explanation of those preferences
> would have been useful and interesting.  Heck, I might even agree
> with you.

You asked if I had anything to say about this particular case.
I did that.

> Instead, you chose to respond several times,

This statement mischaracterizes my postings.  I responded once to
your implicit question about a more specific statement.  I
responded later to your one-line posting saying that my response
was a useless statement.  In both cases I was responding to what
was said in the immediately previous posting.

> adding exactly
> nothing useful to the discussion.  Perhaps you expected us to
> understand what you were thinking without you saying it.  If so,
> that was an unrealistic expectation.

It would be good for you to learn that just because you want
something doesn't mean that other people want it.

> Let's stop this.

Feel free to stop at any time.  If there are no responses to my
comments here I'm not inclined to continue.

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Why does the  ->  operator exist ? Spiros Bousbouras <spibou@gmail.com> - 2023-06-27 09:12 +0000
  Re: Why does the  ->  operator exist ? felix@palmen-it.de (Felix Palmen) - 2023-06-27 15:01 +0200
    Re: Why does the  ->  operator exist ? Spiros Bousbouras <spibou@gmail.com> - 2023-06-27 14:09 +0000
      Re: Why does the  ->  operator exist ? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-06-27 15:56 +0100
  Re: Why does the -> operator exist ? Bart <bc@freeuk.com> - 2023-06-27 16:06 +0100
    Re: Why does the -> operator exist ? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2023-06-27 18:01 +0100
      Re: Why does the -> operator exist ? BGB <cr88192@gmail.com> - 2023-06-27 12:46 -0500
    Re: Why does the -> operator exist ? fir <profesor.fir@gmail.com> - 2023-08-09 00:08 -0700
      Re: Why does the -> operator exist ? fir <profesor.fir@gmail.com> - 2023-08-09 00:11 -0700
        Re: Why does the -> operator exist ? fir <profesor.fir@gmail.com> - 2023-08-09 00:23 -0700
  Re: Why does the  ->  operator exist ? Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2023-06-27 15:13 +0000
  Re: Why does the  ->  operator exist ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-06-27 15:30 +0000
    Re: Why does the -> operator exist ? Bart <bc@freeuk.com> - 2023-06-27 17:05 +0100
      Re: Why does the -> operator exist ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-06-27 17:11 +0000
  Re: Why does the -> operator exist ? BGB <cr88192@gmail.com> - 2023-06-27 10:54 -0500
  Re: Why does the  ->  operator exist ? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-06-27 12:23 -0700
    Re: Why does the  ->  operator exist ? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2023-06-27 15:33 -0600
    Re: Why does the  ->  operator exist ? Spiros Bousbouras <spibou@gmail.com> - 2023-06-28 16:31 +0000
      Re: Why does the  ->  operator exist ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-06-29 03:14 +0000
    Re: Why does the  ->  operator exist ? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-07-20 18:57 -0700
      Re: Why does the  ->  operator exist ? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-07-20 19:49 -0700
        Re: Why does the  ->  operator exist ? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-08-08 05:49 -0700
          Re: Why does the  ->  operator exist ? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-08-08 16:33 -0700
            Re: Why does the  ->  operator exist ? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-08-14 04:34 -0700
              I love it... (Was: Why does the  ->  operator exist ?) gazelle@shell.xmission.com (Kenny McCormack) - 2023-08-14 12:41 +0000
              Re: Why does the  ->  operator exist ? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2023-08-14 15:10 -0700
                Re: Why does the  ->  operator exist ? Phil Carmody <pc+usenet@asdf.org> - 2023-08-15 23:00 +0300
                Re: Why does the  ->  operator exist ? Tim Rentsch <tr.17687@z991.linuxsc.com> - 2023-08-16 05:29 -0700
      Re: Why does the  ->  operator exist ? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-07-22 05:39 +0000
  Re: Why does the -> operator exist ? Andrey Tarasevich <andreytarasevich@hotmail.com> - 2023-06-28 14:16 -0700

csiph-web