Re: do { quit; } else { }

Liste des GroupesRevenir à cl c 
Sujet : Re: do { quit; } else { }
De : david.brown (at) *nospam* hesbynett.no (David Brown)
Groupes : comp.lang.c
Date : 12. Apr 2025, 14:43:05
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vtdql9$kspt$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
User-Agent : Mozilla Thunderbird
On 12/04/2025 03:27, bart wrote:
On 12/04/2025 00:59, Keith Thompson wrote:
bart <bc@freeuk.com> writes:
On 11/04/2025 22:36, Keith Thompson wrote:
bart <bc@freeuk.com> writes:
[...]
Rubbish. Everyone finds C declaration syntax a nightmare.
Rubbish.  I find C declaration syntax annoying, not a "nightmare".
>
Annoying would be having to get letter case or punctuation just right.
[...]
So, yeah, a 'nightmare' is more apt than 'annoying'.
>
Bart, bart, bart.
    
You made a false statement about how *everyone* feels about
C's declaration syntax.
 So what would be a true statement? That everyone finds it at least midly annoying?
I don't find C's declaration syntax annoying in the least.
What I /do/ find annoying at times is the way some programmers write declarations in C.  But that is a very different thing.
If someone wrote "int (*A)[10](int);" in code that I had to maintain, I would find that mildly annoying.  If someone wrote "int long unsigned const long const const typedef A;", I would find it extremely annoying.
But I don't have any problem writing :
typedef int (*FIntInt)(int);
FIntInt A[10];
or
typedef const unsigned long long A;
(other than that I'd want better names for the object or type).
I write my C code in a way that I don't find annoying to read, nor do others that read me code.  I'd recommend all programmers try to do the same (with the full understanding that different kinds of code will be read by different kinds of programmers).
Like a great many things in C, if I were making the syntax for a language I would do it a little differently.  Again, that is a different thing from saying that I find C's syntax a problem.
And there /are/ things about C that I find annoying, or limiting.  Some of these things I can work around using good tools and language extensions.  Often I use C++ rather than C (C++ also has things I find annoying).
However, C declaration syntax is not something that bothers me at all for the code I write.
I'm sure that /some/ people find it annoying, at least in some situations.  With a language used by so many people, pretty much every feature is going to annoy someone, and pretty much every programmer is going to find something annoying.  But there will be a wide range of which things different people find annoying, and to what extent. Generalisations like you are giving, where you extrapolate your own rather radical opinions, are guaranteed to be wrong.

 C type syntax is famous for being difficult and confusing; I think most will agree about that. Even the creators said so.
I disagree with that claim.  I think it is probably fair to say that advanced, complicated and multi-layer types are difficult in any programming language.  It is also fair to say that the way some people write complicated types in C can be confusing - as can be the case in any language.  C lets you write confusing types - it does not force you to do so.

 This was the discussion:
 BC:
 > Humans have to parse it too. C must be the only non-esoteric language where you need to use third-party tools (CDECL etc) to make sense of type-declarations. Either that or follow complex spirular algorithms to [decode] them.
 DB:
I have never heard of anyone other than you who views cdecl as a necessity.
 So, is that last statement true or not?
Are you asking Keith to tell you about my personal experience?
Yes, it is true.  Why would I have said it otherwise?

I didn't say it was a necessity, but that you need to use such tools or special methods to understand them. And clearly, that would be the more complicated ones; people can usually cope with 'int'.
So you didn't say it was a necessity, you said people need to use them? Or are you suggesting that people who can understand what complicated C type declarations mean by reading the C code are somehow using "special methods" ?  Other people might just call that knowing the language and being experienced at reading it.
To be clear - I think putting a complicated type declaration on a single line makes code harder to read.  Putting /anything/ complicated and composed of many parts in one condensed lump makes it harder to understand - regardless of the programming language, and regardless of whether it is programming or something else.  Dividing complex things into smaller and more manageable parts is usually a good thing - within reason, of course.
"An array of 10 objects each of which is a pointer to a function that takes an int parameter and returns an int" is not much clearer than "int (*A)[10](int)", and for people who are used to seeing such C declarations, the familiarity of the C version makes it much faster to parse.

 I replied to one sweeping statement with another.
One "sweeping statement" was about a single person, the other was about everyone.

You want to be treated better?  Stop making deeply silly statements.
 DB was making light of the type syntax issue and pretty much dismissed it out of hand. How should I have responded?
 
If you didn't make such wildly exaggerated remarks in the first place, you wouldn't have to respond to people telling you they are wildly exaggerated.
No one - not me, and not anyone else in comp.lang.c - has ever claimed that C is perfect or flawless.  What people have claimed is that they can understand the language, and write useful code in it, and that it is good enough for a lot of purposes.  They have sometimes said why the language is the way it is, even though they think some things would have been better if done differently.

Not that it would cut any ice with him. Nothing is ever that complicated or too onerous or too slow or too over the top or too badly designed or ...
 
A vast number of people have written a vast amount of code in C. Clearly it is /not/ too complicated, or onerous, or slow.  Clearly the declaration syntax in C is not a "nightmare" for everyone - clearly most C programmers find it is good enough to do the job even if some people have issues with it.
I write code in C.  If it were too complicated, I would not do so.  And often my choice to replace C is C++ - at the risk of making a sweeping generalisation, I think most programmers would agree that C++ is more complicated than C.  Yet like the millions of other C++ programmers, I manage to write code in C++ too.

I suggest also that you stop taking throwaway comments too literally. Yet, there is probably more truth in my remark than in David's.
 You might also consider that while many features of C have been copied, I don't know of any language that has copied its type syntax.
 
If another language copied all of C's syntax, it would just be C.
The way that types work in a language is fairly fundamental to the kind of language you have, so it's not surprising that there is a lot of variety in the syntax for types.  Some languages /have/ copied the syntax, such as C++, D, and Objective-C.  No doubt you will call these derivatives of C rather than new languages.  You could then say the same about other type syntaxes - what languages have copied Pascal's type syntax, other than Pascal derivatives like Ada and Modula 2 ?
So what if other newer languages have a different syntax for type declarations?  It means their designers feel they have a better way of writing types that suit their new language.  Fair enough.  It doesn't imply that they think the C syntax is a "nightmare" (though of course they /may/ think that).

I wonder why? Do you think the designers had an opinion about it closer to mine, or to David Brown's?
 
I have said multiple times that if I were to design a new programming language, its syntax would differ significantly from C's.

Date Sujet#  Auteur
4 Apr 25 * do { quit; } else { }625Thiago Adams
4 Apr 25 +* Re: do { quit; } else { }2bart
4 Apr 25 i`- Re: do { quit; } else { }1Thiago Adams
4 Apr 25 +* Re: do { quit; } else { }11Kaz Kylheku
4 Apr 25 i+* Re: do { quit; } else { }3Thiago Adams
4 Apr 25 ii`* Re: do { quit; } else { }2Kaz Kylheku
4 Apr 25 ii `- Re: do { quit; } else { }1Chris M. Thomasson
4 Apr 25 i+* Re: do { quit; } else { }4Kaz Kylheku
4 Apr 25 ii+* Re: do { quit; } else { }2Thiago Adams
4 Apr 25 iii`- Re: do { quit; } else { }1Thiago Adams
8 Apr 25 ii`- Re: do { quit; } else { }1candycanearter07
5 Apr 25 i`* Re: do { quit; } else { }3Janis Papanagnou
5 Apr 25 i +- Re: do { quit; } else { }1Janis Papanagnou
6 Apr 25 i `- Re: do { quit; } else { }1Michael S
4 Apr 25 +* Re: do { quit; } else { }608Tim Rentsch
4 Apr 25 i`* Re: do { quit; } else { }607Thiago Adams
6 Apr 25 i +* Re: do { quit; } else { }600Tim Rentsch
6 Apr 25 i i+* Re: do { quit; } else { }550Michael S
6 Apr 25 i ii`* Re: do { quit; } else { }549Tim Rentsch
6 Apr 25 i ii `* Re: do { quit; } else { }548Michael S
7 Apr 25 i ii  `* Re: do { quit; } else { }547Tim Rentsch
7 Apr 25 i ii   `* Re: do { quit; } else { }546Michael S
7 Apr 25 i ii    +* Re: do { quit; } else { }542bart
8 Apr 25 i ii    i`* Re: do { quit; } else { }541David Brown
8 Apr 25 i ii    i `* Re: do { quit; } else { }540bart
8 Apr 25 i ii    i  +* Re: do { quit; } else { }535David Brown
8 Apr 25 i ii    i  i`* Re: do { quit; } else { }534bart
8 Apr 25 i ii    i  i +* Re: do { quit; } else { }78Tim Rentsch
8 Apr 25 i ii    i  i i`* Re: do { quit; } else { }77bart
8 Apr 25 i ii    i  i i +* Re: do { quit; } else { }74Tim Rentsch
8 Apr 25 i ii    i  i i i`* Re: do { quit; } else { }73bart
9 Apr 25 i ii    i  i i i `* Re: do { quit; } else { }72Tim Rentsch
9 Apr 25 i ii    i  i i i  `* Re: do { quit; } else { }71bart
9 Apr 25 i ii    i  i i i   +- Re: do { quit; } else { }1Chris M. Thomasson
9 Apr 25 i ii    i  i i i   +- Re: do { quit; } else { }1Chris M. Thomasson
9 Apr 25 i ii    i  i i i   `* Re: do { quit; } else { }68Tim Rentsch
10 Apr 25 i ii    i  i i i    +* Re: do { quit; } else { }63bart
10 Apr 25 i ii    i  i i i    i+* Re: do { quit; } else { }61Kaz Kylheku
10 Apr 25 i ii    i  i i i    ii+* Re: do { quit; } else { }2Michael S
10 Apr 25 i ii    i  i i i    iii`- Re: do { quit; } else { }1Kaz Kylheku
10 Apr 25 i ii    i  i i i    ii`* Re: do { quit; } else { }58bart
10 Apr 25 i ii    i  i i i    ii +* Re: do { quit; } else { }43Keith Thompson
10 Apr 25 i ii    i  i i i    ii i+* Re: do { quit; } else { }39bart
10 Apr 25 i ii    i  i i i    ii ii+* Re: Endless complaints [was Re: do { quit; } else { }]16bart
10 Apr 25 i ii    i  i i i    ii iii+* Re: Endless complaints [was Re: do { quit; } else { }]14Janis Papanagnou
11 Apr 25 i ii    i  i i i    ii iiii`* Re: Endless complaints [was Re: do { quit; } else { }]13bart
11 Apr 25 i ii    i  i i i    ii iiii +- Re: Endless complaints [was Re: do { quit; } else { }]1Keith Thompson
11 Apr 25 i ii    i  i i i    ii iiii +- Re: Endless complaints [was Re: do { quit; } else { }]1Kaz Kylheku
11 Apr 25 i ii    i  i i i    ii iiii `* Re: Endless complaints [was Re: do { quit; } else { }]10David Brown
11 Apr 25 i ii    i  i i i    ii iiii  `* Re: Endless complaints [was Re: do { quit; } else { }]9bart
11 Apr 25 i ii    i  i i i    ii iiii   +* Re: Endless complaints [was Re: do { quit; } else { }]5Michael S
11 Apr 25 i ii    i  i i i    ii iiii   i`* Re: Endless complaints [was Re: do { quit; } else { }]4bart
11 Apr 25 i ii    i  i i i    ii iiii   i `* Re: Endless complaints [was Re: do { quit; } else { }]3Michael S
11 Apr 25 i ii    i  i i i    ii iiii   i  +- Re: Endless complaints [was Re: do { quit; } else { }]1Janis Papanagnou
11 Apr 25 i ii    i  i i i    ii iiii   i  `- Re: Endless complaints [was Re: do { quit; } else { }]1bart
11 Apr 25 i ii    i  i i i    ii iiii   +- Re: Endless complaints [was Re: do { quit; } else { }]1David Brown
11 Apr 25 i ii    i  i i i    ii iiii   +- Re: Endless complaints1Tim Rentsch
11 Apr 25 i ii    i  i i i    ii iiii   `- Re: Endless complaints [was Re: do { quit; } else { }]1Keith Thompson
10 Apr 25 i ii    i  i i i    ii iii`- Re: Endless complaints [was Re: do { quit; } else { }]1Keith Thompson
10 Apr 25 i ii    i  i i i    ii ii`* Re: do { quit; } else { }22Keith Thompson
11 Apr 25 i ii    i  i i i    ii ii `* Re: do { quit; } else { }21bart
11 Apr 25 i ii    i  i i i    ii ii  `* Re: do { quit; } else { }20Keith Thompson
11 Apr 25 i ii    i  i i i    ii ii   `* Re: do { quit; } else { }19Michael S
11 Apr 25 i ii    i  i i i    ii ii    +- Re: do { quit; } else { }1David Brown
11 Apr 25 i ii    i  i i i    ii ii    +* Re: do { quit; } else { }16Kaz Kylheku
11 Apr 25 i ii    i  i i i    ii ii    i+* Re: do { quit; } else { }2bart
11 Apr 25 i ii    i  i i i    ii ii    ii`- Re: do { quit; } else { }1Keith Thompson
13 Apr 25 i ii    i  i i i    ii ii    i`* Re: do { quit; } else { }13Michael S
12 May 25 i ii    i  i i i    ii ii    i `* Re: do { quit; } else { }12Tim Rentsch
12 May 25 i ii    i  i i i    ii ii    i  `* Re: do { quit; } else { }11David Brown
12 May 25 i ii    i  i i i    ii ii    i   `* Re: do { quit; } else { }10Keith Thompson
13 May 25 i ii    i  i i i    ii ii    i    `* Re: do { quit; } else { }9David Brown
14 May 25 i ii    i  i i i    ii ii    i     `* Re: do { quit; } else { }8James Kuyper
14 May 25 i ii    i  i i i    ii ii    i      +* Re: do { quit; } else { }6Keith Thompson
14 May 25 i ii    i  i i i    ii ii    i      i+* Re: do { quit; } else { }4James Kuyper
14 May 25 i ii    i  i i i    ii ii    i      ii`* Re: do { quit; } else { }3David Brown
14 May 25 i ii    i  i i i    ii ii    i      ii +- Re: do { quit; } else { }1Kaz Kylheku
15 May 25 i ii    i  i i i    ii ii    i      ii `- Re: do { quit; } else { }1James Kuyper
14 May 25 i ii    i  i i i    ii ii    i      i`- Re: do { quit; } else { }1David Brown
14 May 25 i ii    i  i i i    ii ii    i      `- Re: do { quit; } else { }1Tim Rentsch
11 Apr 25 i ii    i  i i i    ii ii    `- Re: do { quit; } else { }1Keith Thompson
6 May 25 i ii    i  i i i    ii i`* Re: do { quit; } else { }3Tim Rentsch
6 May 25 i ii    i  i i i    ii i `* Re: do { quit; } else { }2Keith Thompson
6 May 25 i ii    i  i i i    ii i  `- Re: do { quit; } else { }1Tim Rentsch
10 Apr 25 i ii    i  i i i    ii `* Re: do { quit; } else { }14Kaz Kylheku
10 Apr 25 i ii    i  i i i    ii  +* Re: do { quit; } else { }11bart
10 Apr 25 i ii    i  i i i    ii  i+* Re: do { quit; } else { }2Kaz Kylheku
11 Apr 25 i ii    i  i i i    ii  ii`- Re: do { quit; } else { }1bart
11 Apr 25 i ii    i  i i i    ii  i+* Re: do { quit; } else { }6Tim Rentsch
11 Apr 25 i ii    i  i i i    ii  ii`* Re: do { quit; } else { }5Keith Thompson
11 Apr 25 i ii    i  i i i    ii  ii `* Re: do { quit; } else { }4Tim Rentsch
11 Apr 25 i ii    i  i i i    ii  ii  `* Re: do { quit; } else { }3Keith Thompson
11 Apr 25 i ii    i  i i i    ii  ii   +- Re: do { quit; } else { }1bart
5 May 25 i ii    i  i i i    ii  ii   `- Re: do { quit; } else { }1Tim Rentsch
11 Apr 25 i ii    i  i i i    ii  i+- Re: do { quit; } else { }1Keith Thompson
11 Apr 25 i ii    i  i i i    ii  i`- Re: do { quit; } else { }1Keith Thompson
10 Apr 25 i ii    i  i i i    ii  +- Re: do { quit; } else { }1bart
10 Apr 25 i ii    i  i i i    ii  `- Re: do { quit; } else { }1Kaz Kylheku
11 Apr 25 i ii    i  i i i    i`- Re: do { quit; } else { }1Tim Rentsch
9 May 25 i ii    i  i i i    `* Re: do { quit; } else { }4Bonita Montero
9 May 25 i ii    i  i i i     `* Re: do { quit; } else { }3Richard Heathfield
9 Apr 25 i ii    i  i i +- Re: do { quit; } else { }1Richard Damon
9 Apr 25 i ii    i  i i `- Re: do { quit; } else { }1David Brown
9 Apr 25 i ii    i  i `* Re: do { quit; } else { }455David Brown
8 Apr 25 i ii    i  +- Re: do { quit; } else { }1Tim Rentsch
9 Apr 25 i ii    i  `* Re: do { quit; } else { }3Ike Naar
8 Apr 25 i ii    `* Re: do { quit; } else { }3Tim Rentsch
6 Apr 25 i i`* Re: do { quit; } else { }49Michael S
7 May 25 i `* Re: do { quit; } else { }6Wuns Haerst
6 Apr 25 +- Re: do { quit; } else { }1Lawrence D'Oliveiro
6 Apr 25 +- Re: do { quit; } else { }1David Brown
18 Apr 25 `- Re: do { quit; } else { }1Mikko

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal