Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: My C program does not compile or gives segmentation fault Date: Tue, 28 Mar 2017 11:51:16 -0700 Organization: None to speak of Lines: 51 Message-ID: References: <89549322-236e-4a59-9bb5-dc881593a846@googlegroups.com> <1b709495-03da-462d-926f-3ee2be0a7ab5@googlegroups.com> <58d642e0.2297265@news.xs4all.nl> <58d6e0b3.20124312@news.xs4all.nl> <874lye5usl.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="621a15f5f24560a56e85ad6532f35357"; logging-data="13986"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/qXxb0E0uCLTBpsp5mRTEa" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:62Rn4WV0sV1FDYwLBQ1ROmwQmUk= sha1:6sit+uIvZVMJ5wWCBanteQv6kkc= Xref: csiph.com comp.lang.c:107301 Richard Heathfield writes: > On 28/03/17 17:15, Keith Thompson wrote: >> Alla writes: >>> On 3/28/17 15:28, Richard Heathfield wrote: >>>> On 28/03/17 10:34, Alla wrote: >>>> >>>> >>>>> But again both approaches carry the same logical value, and none is the >>>>> only correct approach. Hence there is no point of argument here. >>>> >>>> It is precisely because both approaches are correct that we are arguing >>>> about them. >>> >>> I thought so - it's called for the sake of arguing :-) >> [...] >> >> Not at all. It's arguing because we have a genuine difference of >> opinion, and each side is trying to understand the other side's point of >> view. The fact that the disagreement isn't about technical correctness >> is a fairly minor point. > > Agreed (although if it /were/ about technical correctness we'd be > finished by now). > > I am trying hard to understand why people object to > constant-on-the-left, and so far I'm failing... but I'm still trying. Let me ask you a question. This won't resolve the issue, but it might result in some small progress. Suppose C had been designed a little differently, so that the assignment operator is ":=", the equality operator is "==", and a single "=" is a syntax error. The rest of the language is left as it is. I think you'd agree that there would then be little or no danger of confusing assignment vs. equality; something like `if (x := 3)` would not be confused with `if (x == 3)`. (If you don't agree, then please assume it for the sake of argument, or feel free to suggest a different pair of symbols.) Granting that you would not find `if (3 == x)` problematic, would you ever *write* `if (3 == x)` in such a language? And how surprised would you be to see `if (3 == x)` rather than `if (x == 3)` in someone else's code? (Surprised in the sense of "hmm", not "ick".) -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"