Liste des Groupes | Revenir à cl c |
On 11/12/2024 18:20, bart wrote:On 11/12/2024 16:51, Janis Papanagnou wrote:On 11.12.2024 17:47, David Brown wrote:
I don't think so. My main example which followed on from semicolons was about 'do while'. I said that, even though the C grammar makes it work, that it was fragile: adding or removing a semicolon could radically change the meaning.I don't think anyone has ever disagreed that you can write "if" statements with "else" in C in a way that is confusing or unclear to human readers. (But it still has fixed and unambiguous meaning to the compiler.)>Most C coding standards and style guides make that requirement>
- not because the C compiler sees it as ambiguous, but because humans
often do. (Or they misinterpret it.)
Yes, true. (We had that in our standards, too.)
So here you finally acknowledge there may be ambiguity from a human perspective.
Equally, of course, it is possible to write them in a way that is not confusing or unclear at all.
But there is no ambiguity in the language itself - only possible confusions from the way the language could be used. (And since the language is well defined here, it doesn't make sense to call it an ambiguity at all, even "from a human perspective". Call it unclear, confusing, or deceptive code if you like.)
I don't see that anyone has changed their position on this.
>Sure.
But when I try to make that very point, it's me making up unrealistic examples; I'm being deliberately obtuse; I clearly find things confusing that no one else has a problem with; or you make snarky comments like this:
>
We all know it is possible to write unclear and confusing C code. There's a whole competition devoted to it!
But we also all know that most C programmers - like programmers of any other language - usually avoid writing code they find unclear. (Clarity is quite subjective - a solid proportion of programmers will agree roughly on a set of guidelines, but there will be outliers with very different positions. This is independent of language.)
"I mean, if you get confused by an unambiguous syntaxes already,It was a totally different point. It is extraordinary that you can't see that.
what do you think happens with people if they have to program
in or understand an ambiguous language!"
>
It's astonishing how I have to fight across a dozen posts to back up my point of view (you even specifically said you didn't recognise my point).
>
And yet here: somebody makes that very same point, and you merely say:
>
"Yes, true."
>
It really is extraordinary.
>
You claimed the language and its grammar was ambiguous and confusing. It is not.
Les messages affichés proviennent d'usenet.