Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #123523
| Subject | Re: "The long goodbye to C" by Eric Raymond |
|---|---|
| Newsgroups | comp.lang.c |
| References | (25 earlier) <f7uj4aF1omrU20@mid.individual.net> <oJxSB.96622$GW.61245@fx19.am4> <ovebi0$tr0$1@dont-email.me> <5yzSB.44364$M61.30990@fx38.am4> <oveqbl$v0p$1@dont-email.me> |
| From | bartc <bc@freeuk.com> |
| Message-ID | <CTCSB.62674$oe2.9901@fx15.am4> (permalink) |
| Organization | virginmedia.com |
| Date | 2017-11-26 17:31 +0000 |
On 26/11/2017 16:32, David Brown wrote:
> On 26/11/17 14:43, bartc wrote:
>> Of course in C, the statement sequence following 'else' doesn't have a
>> delimiter. That's why {} has to be used in C. And why other syntaxes
>> need to invent one in the form of 'end if' or 'fi', or a reduction in
>> indents in the case of Python.
>
> The problem is not in the use of braces. It is not even in the optional
> nature of the braces. The problem lies in using a syntax and a visual
> appearance that do not match each other - then the reader gets confused,
> and the writer makes mistakes.
The problem is because of the fact that two or more statements in a
sequence are treated differently from one or no statements.
So two are more need {...} (or begin...end).
Your solution is to treat one or no statements the same as two or more,
and always use {...}.
--
bartc
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar
Re: "The long goodbye to C" by Eric Raymond ruben safir <ruben@mrbrklyn.com> - 2017-11-25 11:46 -0500
Re: "The long goodbye to C" by Eric Raymond bartc <bc@freeuk.com> - 2017-11-25 17:19 +0000
Re: "The long goodbye to C" by Eric Raymond Ian Collins <ian-news@hotmail.com> - 2017-11-26 08:46 +1300
Re: "The long goodbye to C" by Eric Raymond bartc <bc@freeuk.com> - 2017-11-25 20:59 +0000
Re: "The long goodbye to C" by Eric Raymond Ian Collins <ian-news@hotmail.com> - 2017-11-26 11:54 +1300
Re: "The long goodbye to C" by Eric Raymond bartc <bc@freeuk.com> - 2017-11-25 23:34 +0000
Re: "The long goodbye to C" by Eric Raymond Ian Collins <ian-news@hotmail.com> - 2017-11-26 14:19 +1300
Re: "The long goodbye to C" by Eric Raymond bartc <bc@freeuk.com> - 2017-11-26 11:39 +0000
Re: "The long goodbye to C" by Eric Raymond David Brown <david.brown@hesbynett.no> - 2017-11-26 13:20 +0100
Re: "The long goodbye to C" by Eric Raymond bartc <bc@freeuk.com> - 2017-11-26 13:43 +0000
Re: "The long goodbye to C" by Eric Raymond David Brown <david.brown@hesbynett.no> - 2017-11-26 17:32 +0100
Re: "The long goodbye to C" by Eric Raymond bartc <bc@freeuk.com> - 2017-11-26 17:31 +0000
Re: "The long goodbye to C" by Eric Raymond David Brown <david.brown@hesbynett.no> - 2017-11-26 22:11 +0100
Re: "The long goodbye to C" by Eric Raymond Gareth Owen <gwowen@gmail.com> - 2017-11-26 06:53 +0000
csiph-web