From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a9b0810d3106d9b8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!a26g2000vbo.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Elias_Salom=E3o_Helou_Neto?= Newsgroups: comp.lang.ada Subject: Re: Fun with C Date: Mon, 18 Apr 2011 19:06:30 -0700 (PDT) Organization: http://groups.google.com Message-ID: <2693b280-bbe2-45ea-8355-e96ccbc381f9@a26g2000vbo.googlegroups.com> References: <27cf3992-4132-4483-9110-adc7a089cd4a@e8g2000vbz.googlegroups.com> <54108d8d-4e7c-4901-bd5e-819d27720d48@a11g2000pro.googlegroups.com> <4daa8fc6$0$7652$9b4e6d93@newsspool1.arcor-online.net> <37428a21-61b4-4cdf-9897-7b84252f8fce@a11g2000pro.googlegroups.com> <08279ed8-61de-414e-a53c-996bc0ae2ba9@f31g2000pri.googlegroups.com> NNTP-Posting-Host: 186.223.216.44 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1303178790 6308 127.0.0.1 (19 Apr 2011 02:06:30 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 19 Apr 2011 02:06:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a26g2000vbo.googlegroups.com; posting-host=186.223.216.44; posting-account=8auP9QoAAACkSx2qxJhP83KA6-tg78E8 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.8 SUSE/7.0.528.0 (KHTML, like Gecko) Chrome/7.0.528.0 Safari/534.8,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:19854 Date: 2011-04-18T19:06:30-07:00 List-Id: On Apr 18, 10:22=A0pm, "George P." wrote: > On Apr 18, 3:24=A0pm, Elias Salom=E3o Helou Neto > wrote: > > > > > > > > > > > On Apr 17, 9:12=A0pm, "George P." wrote: > > > > On Apr 17, 3:35=A0pm, Elias Salom=E3o Helou Neto > > > wrote: > > > > > On Apr 17, 1:15=A0pm, KK6GM wrote: > > > > > > On Apr 16, 11:59=A0pm, Georg Bauhaus > > > > > wrote: > > > > > > > On 4/17/11 8:26 AM, KK6GM wrote: > > > > > > > > Wow and wow. =A0I've been writing C all my adult life and I d= idn't > > > > > > > realize this could or would happen. =A0I would have said that= the > > > > > > > unsigned would be promoted to signed. > > > > > > > > I'm going to include this example in my push to use Ada in ou= r next > > > > > > > project. > > > > > > > Be careful that there are no C savvy people around. > > > > > > You are demonstrating a lack of understanding of C basics! > > > > > > ("Stupid!") > > > > > > That lack is not (in their view, and it's their view that count= s) > > > > > > a good start for asking for a different language. > > > > > > > Had you read section 2.7 of K&R (or A.6), you'd have expected > > > > > > the result you got: arithmetic operators will convert their > > > > > > arguments following the rules of the C language definition. > > > > > > Yes, I understand how the "stupid" argument works in the C commun= ity. > > > > > I'm going to ask some other programmers tomorrow and see how many= of > > > > > them get this right. =A0I'm guessing our situation will be simila= r to > > > > > the situation at the OP's workplace, where presumably competent > > > > > programmers still got clobbered by this language-legal insanity. > > > > > Most programmers are competent in their views. Few really are and i= t > > > > does not matter what is the actual language. For example, looks lik= e > > > > you feel you are competent in C, but are you? > > > > > "I would expect unsigned to int conversion" is just unacceptable! > > > > Someone has written a line of code without knowing what it does. Is= it > > > > a language problem? Not that C is spectacular, but blaming the > > > > language here is not fair. Minimally competent C programmers do kno= w > > > > about such conversions. If you don't you suck as a C programmer. If > > > > you suck as a C programmer, please do not try to advocate any other > > > > language over it, this _is_ stupid! > > > > > Maybe Ada over C is a smart choice, but advocating it without havin= g a > > > > strong knowledge of both is unacceptable.- Hide quoted text - > > > > > - Show quoted text - > > > > Seems that someone never worked on projects of more then few thousand > > > lines of code, supports multiple hardware platforms and yes after > > > programming for 30+ years in it can tell C sucks. > > > > Wonder if sudden acceleration in Toyota cars was not caused by > > > "intuitive" C typing conversions. > > > Now you're making hypothesis. I don't even know the problem the, less > > so the language of the code, but rest assured that it was a > > programmer's fault. Or a compiler bug. One thing that can't be the > > cause is the language. Maybe lack of knowledge of it, but not the > > language per se. > > > And nobody said type promotion rules in C are intuitive. They are what > > they are, they won't change, is it smart to keep complaining instead > > of go read a book? > > > You say C sucks, ok it is an opinion. I would say someone who doesn't > > know type promotion rules and considers himself competent in C sucks > > far more. > > > Elias.- Hide quoted text - > > > - Show quoted text - > > Oh really? So C is the language of cyborgs that never have bad days, > never argue with their girlfriends and never go late night drinking? > And sure none of such people should be allowed to design embedded > systems :-) No, not cyborgs, it is the language of nerds. They don't drink and about girlfriends, you've gotta be kidding! Also all of their days are bad, so they're used to it. :-) Now, seriously, what I meant is that bashing C without knowing the basics doesn't make anyone look smart. It is quite the opposite. And I repeat, whining is not the way to go here. Yes, C is dangerous, unsafe and difficult to master, but let us be men and use it well if required. I believe making assumptions about language behavior is danger. There are historical reasons why C is the way it is. Some of them were wrong, now we know, but it won't change - mainly because of the huge codebase. So, let's have fun with C, why not? I have fun with C, C++, TeX, Lisp, Pascal, Matlab, etc. Right now I am trying to find time to study Ada - more fun! I am sure I will share you guys' view about how Ada is good and safe, but it is really unlikely that I am going to become such a sissy and fill this newsgroups with foolish complaints. And as a side note, even sober, I have recently written a heavily templated C++ ray tracer which I instantiated with unsigneds as indices and signeds as difference types. There was a mixed expression that gave me some trouble, and I do understand the problem people mention in this thread. What I do not understand is how people can show pride in not knowing the language! And I can't see me whining that much because of something that won't (because it can't) change - the C language.