Re: this girl calls c ugly

Liste des GroupesRevenir à cl c  
Sujet : Re: this girl calls c ugly
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.c
Date : 04. Jun 2026, 15:27:28
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <10vs20g$d992$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Mozilla Thunderbird
On 04/06/2026 15:18, Bart wrote:
On 04/06/2026 13:35, David Brown wrote:
On 04/06/2026 13:40, Bart wrote:
On 04/06/2026 10:34, Tim Rentsch wrote:
Bart <bc@freeuk.com> writes:
>
My point was that it could be objective, at least for too many.  So
(a*a) + (b*b) would be commonly agreed to have too many, [...]
>
Apparently you misunderstand what is meant by the word objective.
An objective statement is one that is independent of personal
assessment, even collective personal assessment.
>
I don't know of any infix PL syntax where 'a*a + b*b', as a standalone expression, doesn't mean '(a*a) + (b*b)'.
>
Google agrees with me (in that 2*2+3*3 shows 13), and so does my Casio calculator.
>
It's not my personal opinion!
>
You are - again - moving the goalposts.
>
It is an objective fact that "a * a + b * b" means "(a * a) + (b * b)" in normal mathematics (at least in the countries I am familiar with), and also in most mainstream programming languages.
>
It is an objective fact, therefore, that "(a*a) + (b*b)" has more parentheses than needed in the context of most programming languages.
>
"(a*a) + (b*b) has too many parentheses", on the other hand, is a purely subjective opinion.
 So, you're arguing 'more than needed' is a completely different thing from 'too many'.
 
Of course they are different things - albeit related things, rather than /completely/ different.  One is a question of fact, the other a question of opinion, and they do not always coincide.
It is a fact that "a << (b + c)" has more parentheses than needed.  But I think we are both of the opinion that it does not have "too many" parentheses - it has an appropriate number of parentheses.

Sigh...
 
>
If you wrote, for example, that "a << b + c" is ambiguous in C, then you
 It is technically unambiguous in C.
There is no "technically" about it.  It is unambiguous in C.

It can be ambiguous in the mind of somebody who would have to double-check the precedence levels, or where the C context is missing.
I would not use the word "ambiguous" there - "unclear" would be more appropriate in the situation when someone does not know the C precedence levels.
If you are given the expression and don't know it is in C, it's a very different matter - there are all kinds of things it could mean.  In C++, it could mean concatenating two strings and passing the result to a output stream.  In Forth, it could mean anything you like.  With no context, the expression is not "ambiguous" because that implies that there is a number of reasonable interpretations - and without context, there is no limit to the interpretations.
So while I entirely agree that "a << b + c" may not be clear, and may easily be misinterpreted, "ambiguous" is the wrong word to use.

 The discssion seems to about what exactly is 'too many'.
No, it's an attempt to get you to understand the difference between "objective" and "subjective" - fact and opinion.  I don't understand why you are having such a problem here.

 Apparently you can constuct a valid C source file where 99.9% of the text consists of () characters, but if someone - or even a million people - say that it is too many, then that is just their subjective opinion.
64 levels of nested parentheses is /factually/ and /objectively/ too many to be guaranteed supported by a conforming C compiler.  It takes a far smaller number to be viewed as too many in the subjective opinion of a large proportion of people.

 I don't have the patience for such nonsense any more:
 * The () in '(a * b) + c' are generally unnecessary
 
Yes.  They are unnecessary in C (that is a fact), and most people would not find them helpful in understanding the expression (that is a claimed fact, given without evidence, about people's opinions.  It is my opinion that this claimed fact is true).

* The () in 'a << (b + c)' are advisable
That is a subjective opinion.  /I/ would generally advise including the parentheses here.  Other people might have a different opinion.  And people can have different opinions depending on the target audience.

 * The () in '(a << b) + c)' are necessary if the intent is to have
   what might be the more intuitive meaning.
The parentheses in "(a << b) + c" are necessary if the intent is to shift "a" by "b", and then add "c" to the result.  That is fact, not opinion.  Any discussion of "intuitive" is necessarily subjective.

 If this not 100% C-specific, than () are needed for both the last two examples, but not the first.
 You all know this.
 
Do /you/ know what is fact and what is opinion here?  Do you understand the difference, after spoon-feeding you these examples?
And do you understand why it is important in a discussion to be able to make these distinctions?  It matters, even if you and I would likely both want the parentheses mostly in the same places.

 
(Note that C has its own problems in this area:
>
    a = b/*p;      // divide b by dereferenced pointer p
>
Here, /* also happens to start a block comment.)
>
>
Here you are objectively wrong.  C does not have a "problem" with this. The parsing rules of the language are clear - often called "maximum munch".  The character sequence "/*" is the start of a comment, it is not two separate operators.
 This is where it falls down. It's very clearly a 'gotcha', and consequence of poorly thought-out design.
It is neither a "gotcha", not a consequence of poor design.  It does not "fall down".  It is simply a minor consequence of the choice of operator syntax.  Such an expression would occur rarely in code, and to be a "gotcha" it would need to be realistic for someone to write it, without spaces, and for their code to compile and be used without the mistake being noticed.  Do you think that is in any way realistic?  I do not.
And to be "poor design", it needs to be something that is likely to cause problems (which it is not), or which requires significant effort to work around.  Writing "a = b / *p;" is not challenging, and a lot of people prefer spaces around binary operators anyway.
I'd say you were making a mountain out of a molehill, but I don't think it's as big as a molehill.

 That the behaviour is deterministic doesn't change that.
 
Of course it does.  If some compilers treated it differently, then there might be a chance that someone wrote such code and got the expected results from the tool they were using, even though it was treated differently by other tools.

 It's silly to
worry about something that 999 people out of a 1000 (and the actual
numbers are undoubtedly much higher) are able to navigate without
difficulty.  Yet the examples you give insist on focusing on the few
hopeless individuals.
>
Are you saying that whoever wrote code like this:
>
      crcu32 = (crcu32 >> 4) ^ s_crc32[(crcu32 & 0xF) ^ (b & 0xF)];
>
is needlessly worrying about the 99.9+% of the readership who you claim will know C syntax rules precisely? That is, they would find this version just as clear without any extra cognitive effort:
>
      crcu32 = crcu32 >> 4 ^ s_crc32[crcu32 & 0xF ^ b & 0xF];
>
?
>
Tim did not write that.
 What was the 'something' in "It's silly to worry about something that ..."?
 
My mind-reading skills are not that well developed.

I assume it's people being unable to understand that second example.
He did not say he was talking about those examples.  Given that the "crc" examples are more distant in the Usenet thread, it seems a stretch to assume he was referring to them, rather than to the code examples you had just given.  (It would, perhaps, have been helpful if Tim had not snipped those examples.)

 Yet I seee parenthese being used in such cases a LOT more than 0.1% of the time. 50% or more would be my guess.
 
  That example was not on the list of examples you gave recently.
  It was posted several times.
 (https://github.com/richgel999/miniz/blob/master/miniz.c line 81, second hit for '>>')
 

Date Sujet#  Auteur
27 May 26 * this girl calls c ugly363fir
27 May 26 `* Re: this girl calls c ugly362fir
28 May 26  `* Re: this girl calls c ugly361BGB
28 May 26   +* Re: this girl calls c ugly5Lawrence D’Oliveiro
28 May 26   i+* Re: this girl calls c ugly3BGB
29 May 26   ii`* Re: this girl calls c ugly2Lawrence D’Oliveiro
29 May 26   ii `- Re: this girl calls c ugly1BGB
28 May 26   i`- Re: this girl calls c ugly1Bonita Montero
28 May 26   +* Re: this girl calls c ugly19Janis Papanagnou
28 May 26   i+* Re: this girl calls c ugly15BGB
29 May 26   ii+- Re: this girl calls c ugly1Lawrence D’Oliveiro
29 May 26   ii`* Re: this girl calls c ugly13Janis Papanagnou
29 May 26   ii `* Re: this girl calls c ugly12BGB
29 May 26   ii  +* Re: this girl calls c ugly9David Brown
29 May 26   ii  i`* Re: this girl calls c ugly8BGB
30 May 26   ii  i `* Re: this girl calls c ugly7David Brown
30 May 26   ii  i  +* Re: this girl calls c ugly2Janis Papanagnou
30 May 26   ii  i  i`- Re: this girl calls c ugly1David Brown
30 May 26   ii  i  `* Re: this girl calls c ugly4BGB
31 May 26   ii  i   `* Re: this girl calls c ugly3David Brown
31 May 26   ii  i    `* Re: this girl calls c ugly2BGB
31 May 26   ii  i     `- Re: this girl calls c ugly1David Brown
29 May 26   ii  +- Re: this girl calls c ugly1Janis Papanagnou
30 May 26   ii  `- Re: this girl calls c ugly1Lawrence D’Oliveiro
28 May 26   i`* Re: this girl calls c ugly3Chris M. Thomasson
29 May 26   i `* Re: this girl calls c ugly2Janis Papanagnou
29 May 26   i  `- Re: this girl calls c ugly1Chris M. Thomasson
28 May 26   `* Re: this girl calls c ugly336fir
28 May 26    `* Re: this girl calls c ugly335BGB
29 May 26     +* Re: this girl calls c ugly328Lawrence D’Oliveiro
29 May 26     i`* Re: this girl calls c ugly327Janis Papanagnou
29 May 26     i `* Re: this girl calls c ugly326Bart
29 May 26     i  +* Re: this girl calls c ugly310Janis Papanagnou
29 May 26     i  i`* Re: this girl calls c ugly309Bart
29 May 26     i  i +* Re: this girl calls c ugly9Janis Papanagnou
29 May 26     i  i i+* Re: this girl calls c ugly2Bart
29 May 26     i  i ii`- Re: this girl calls c ugly1Janis Papanagnou
29 May 26     i  i i`* Re: this girl calls c ugly6Bart
29 May 26     i  i i +* Re: this girl calls c ugly4Janis Papanagnou
29 May 26     i  i i i`* Re: this girl calls c ugly3Bart
29 May 26     i  i i i `* Re: this girl calls c ugly2Janis Papanagnou
29 May 26     i  i i i  `- Re: this girl calls c ugly1Bart
29 May 26     i  i i `- Re: this girl calls c ugly1Keith Thompson
29 May 26     i  i `* Re: this girl calls c ugly299tTh
29 May 26     i  i  `* Re: this girl calls c ugly298Bart
29 May 26     i  i   +* Re: this girl calls c ugly296Keith Thompson
29 May 26     i  i   i`* Re: this girl calls c ugly295Bart
29 May 26     i  i   i +- Re: this girl calls c ugly1Janis Papanagnou
29 May 26     i  i   i `* Re: this girl calls c ugly293Keith Thompson
29 May 26     i  i   i  `* Re: this girl calls c ugly292Bart
29 May 26     i  i   i   +* Re: this girl calls c ugly5Keith Thompson
30 May 26     i  i   i   i`* Re: this girl calls c ugly4James Kuyper
30 May 26     i  i   i   i `* Re: this girl calls c ugly3Bart
30 May 26     i  i   i   i  `* Re: this girl calls c ugly2Keith Thompson
30 May 26     i  i   i   i   `- Re: this girl calls c ugly1Bart
30 May 26     i  i   i   `* Re: this girl calls c ugly286Dan Cross
30 May 26     i  i   i    +* Re: this girl calls c ugly282Bart
31 May 26     i  i   i    i+* Re: this girl calls c ugly280Keith Thompson
31 May 26     i  i   i    ii+* Re: this girl calls c ugly5Janis Papanagnou
31 May 26     i  i   i    iii+* Re: this girl calls c ugly2Keith Thompson
2 Jun 26     i  i   i    iiii`- Re: this girl calls c ugly1Janis Papanagnou
31 May 26     i  i   i    iii`* Re: this girl calls c ugly2David Brown
2 Jun 26     i  i   i    iii `- Re: this girl calls c ugly1Janis Papanagnou
31 May 26     i  i   i    ii`* Re: this girl calls c ugly274Richard Harnden
31 May 26     i  i   i    ii +* Re: this girl calls c ugly169David Brown
31 May 26     i  i   i    ii i+* Re: this girl calls c ugly166Bart
31 May 26     i  i   i    ii ii+* Re: this girl calls c ugly140David Brown
31 May 26     i  i   i    ii iii`* Re: this girl calls c ugly139James Kuyper
31 May 26     i  i   i    ii iii `* Re: this girl calls c ugly138David Brown
31 May 26     i  i   i    ii iii  +* Re: this girl calls c ugly4James Kuyper
31 May 26     i  i   i    ii iii  i`* Re: this girl calls c ugly3David Brown
31 May 26     i  i   i    ii iii  i `* Re: this girl calls c ugly2James Kuyper
1 Jun 26     i  i   i    ii iii  i  `- Re: this girl calls c ugly1David Brown
31 May 26     i  i   i    ii iii  `* Re: this girl calls c ugly133Keith Thompson
1 Jun 26     i  i   i    ii iii   +* Re: this girl calls c ugly2David Brown
1 Jun 26     i  i   i    ii iii   i`- Re: this girl calls c ugly1Keith Thompson
2 Jun 26     i  i   i    ii iii   +* Re: this girl calls c ugly129Janis Papanagnou
2 Jun 26     i  i   i    ii iii   i+- Re: this girl calls c ugly1James Kuyper
2 Jun 26     i  i   i    ii iii   i+* Constants and undefined behavior82Tim Rentsch
2 Jun 26     i  i   i    ii iii   ii`* Re: Constants and undefined behavior81Dan Cross
4 Jun 26     i  i   i    ii iii   ii `* Re: Constants and undefined behavior80Tim Rentsch
4 Jun 26     i  i   i    ii iii   ii  `* Re: Constants and undefined behavior79Dan Cross
4 Jun 26     i  i   i    ii iii   ii   +* Re: Constants and undefined behavior31Keith Thompson
5 Jun 26     i  i   i    ii iii   ii   i+* Re: Constants and undefined behavior28Dan Cross
5 Jun 26     i  i   i    ii iii   ii   ii+* Re: Constants and undefined behavior24Keith Thompson
6 Jun 26     i  i   i    ii iii   ii   iii+* Re: Constants and undefined behavior19Dan Cross
6 Jun 26     i  i   i    ii iii   ii   iiii`* Re: Constants and undefined behavior18Keith Thompson
8 Jun 26     i  i   i    ii iii   ii   iiii `* Re: Constants and undefined behavior17Dan Cross
8 Jun 26     i  i   i    ii iii   ii   iiii  +* Re: Constants and undefined behavior5Keith Thompson
9 Jun 26     i  i   i    ii iii   ii   iiii  i`* Re: Constants and undefined behavior4Dan Cross
9 Jun 26     i  i   i    ii iii   ii   iiii  i `* Re: Constants and undefined behavior3Keith Thompson
9 Jun10:46     i  i   i    ii iii   ii   iiii  i  `* Re: Constants and undefined behavior2Dan Cross
9 Jun23:07     i  i   i    ii iii   ii   iiii  i   `- Re: Constants and undefined behavior1Keith Thompson
9 Jun 26     i  i   i    ii iii   ii   iiii  `* Re: Constants and undefined behavior11Waldek Hebisch
9 Jun23:29     i  i   i    ii iii   ii   iiii   +* Re: Constants and undefined behavior3James Kuyper
10 Jun00:01     i  i   i    ii iii   ii   iiii   i`* Re: Constants and undefined behavior2Keith Thompson
10 Jun13:36     i  i   i    ii iii   ii   iiii   i `- Re: Constants and undefined behavior1Dan Cross
11 Jun15:49     i  i   i    ii iii   ii   iiii   `* Re: Constants and undefined behavior7Janis Papanagnou
11 Jun16:20     i  i   i    ii iii   ii   iiii    +* Re: Constants and undefined behavior2Dan Cross
11 Jun17:08     i  i   i    ii iii   ii   iiii    i`- Re: Constants and undefined behavior1Janis Papanagnou
11 Jun17:30     i  i   i    ii iii   ii   iiii    `* Re: Constants and undefined behavior4Waldek Hebisch
6 Jun 26     i  i   i    ii iii   ii   iii`* Re: Constants and undefined behavior4Tim Rentsch
5 Jun 26     i  i   i    ii iii   ii   ii`* Re: Constants and undefined behavior3Janis Papanagnou
7 Jun 26     i  i   i    ii iii   ii   i`* Re: Constants and undefined behavior2Tim Rentsch
9 Jun07:05     i  i   i    ii iii   ii   `* Re: Constants and undefined behavior47Tim Rentsch
2 Jun 26     i  i   i    ii iii   i`* Re: this girl calls c ugly45Keith Thompson
2 Jun 26     i  i   i    ii iii   `- Re: this girl calls c ugly1Chris M. Thomasson
2 Jun 26     i  i   i    ii ii`* Re: this girl calls c ugly25Dan Cross
31 May 26     i  i   i    ii i`* Re: this girl calls c ugly2James Kuyper
31 May 26     i  i   i    ii +* Re: this girl calls c ugly2Keith Thompson
31 May 26     i  i   i    ii `* Re: this girl calls c ugly102Tim Rentsch
31 May 26     i  i   i    i`- Re: this girl calls c ugly1Dan Cross
1 Jun 26     i  i   i    `* Re: this girl calls c ugly3Tim Rentsch
30 May 26     i  i   `- Re: this girl calls c ugly1David Brown
29 May 26     i  +* Re: this girl calls c ugly6Janis Papanagnou
30 May 26     i  `* Re: this girl calls c ugly9Lawrence D’Oliveiro
29 May 26     `* Re: this girl calls c ugly6Bonita Montero

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal