Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #123502
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: "The long goodbye to C" by Eric Raymond |
| Date | 2017-11-26 11:54 +1300 |
| Message-ID | <f7ualpF1omrU16@mid.individual.net> (permalink) |
| References | (21 earlier) <1MjQB.110400$GS.21955@fx06.am4> <ovc6ob$4kr$1@reader2.panix.com> <hChSB.57907$U41.3798@fx07.am4> <f7tvl3F1omrU15@mid.individual.net> <wQkSB.52925$321.3234@fx12.am4> |
On 11/26/2017 09:59 AM, bartc wrote:
> On 25/11/2017 19:46, Ian Collins wrote:
>> On 11/26/2017 06:19 AM, bartc wrote:
>>> On 25/11/2017 16:46, ruben safir wrote:
>>>> On 11/19/2017 01:07 PM, bartc wrote:
>>>>> It's fairly obvious really
>>>>
>>>>
>>>> No it is not obvious. I hate languages that have blocks without braces.
>>>
>>> You mean, like C?
>>>
>>> C doesn't need braces around a statement sequence when there are less
>>> than two statements. Or sometimes, you can have N statement-expressions
>>> which are separated with commas, again not needing braces.
>>>
>>> And this is when the chance of errors comes in; see the examples in my
>>> post. Perhaps it will become more obvious.
>>
>> int main( int argc, char** argv )
>> {
>> int x, y, z;
>>
>> if (argc >1)
>> x = 100;
>> else
>> y = 200;
>> z = 300;
>> }
>>
>> gcc -std=c99 -Wall x.c
>> x.c: In function ‘main’:
>> x.c:10:3: warning: this ‘else’ clause does not guard...
>> [-Wmisleading-indentation]
>> else
>> ^~~~
>> x.c:12:5: note: ...this statement, but the latter is misleadingly
>> indented as if it is guarded by the ‘else’
>> z = 300;
>>
>> Use the tools bartc....
>
> You have to use a specific C compiler, of a specific version that may
> not have existed a decade ago, and with a highly specific option.
The most widely used compiler with the most common option..
> One
> that may also generate a swathe of false positives (I frequently use
> mis-indented debug code on purpose, so that it stands out and I can
> easily get rid of it later.)
It hurts when I do that doctor comes to mind.
> C however has existed with that PROBLEM for decades, and has been/has
> had to be used on a hundred compilers that didn't have that workaround.
They do now, so move on. Coding standards have also existed for
decades. These are old, well know and easily avoided warts. No one
denies that C is old and crusty, but that hasn't stopped it being useful.
> It's like you complaining of the lack of operator overloading in C, and
> me saying, just use the right tools, Ian: 'lccwin'. The fundamental
> problem still exists.
>
> It is rather bizarre taking a crude language from the earlier days of
> computing, and choosing to apply advanced 21st century techniques to
> work around all its problems, rather than just fixing the language.
I'm somewhat crude and from the earlier days of computing, but clients
still use me :)
--
Ian.
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