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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham 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: g2news1.google.com!news1.google.com!goblin1!goblin2!goblin3!goblin.stu.neva.ru!news.tu-darmstadt.de!news.internetdienste.de!noris.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Mon, 18 Apr 2011 00:26:13 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Fun with C 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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <4dab6906$0$6893$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 18 Apr 2011 00:26:14 CEST NNTP-Posting-Host: c53dcb0e.newsspool2.arcor-online.net X-Trace: DXC=BA^lV]MAh;WYI9]OHn9o5^A9EHlD;3YcR4Fo<]lROoRQ8kFejVXRSlYC:LZn6Z On 4/17/11 9:35 PM, Elias Salom�o Helou Neto wrote: > 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 know > about such conversions. OK, that's a claim. Michael Barr seem to have found results contradicting it if the "minimum" is what you minimally find with professional C programmers. In his netrino.com embedded C quiz, he found that US takers got at D+ on average. That's a real world, observable minimum, then. I suggest turning to observable facts and away from normative ontology for a moment. Towards justifiable language design. Whenever a statistical phenomenon is observed, many start looking for correlations and hypotheses. Here, we have errors related to the / operation and the promotion rules of C's $6.3.1. Is there a correlation? Will the correlation between error rates and language rules be the same if using another language? Is that other language intrinsically better or worse, then? If there is a correlation between the frequency of a number of programming errors (in this case related to +,-,*,/ etc) and the way the corresponding part of the programming language is defined (in this case operand treatment), then I suggest the following Hypothesis 1: A language A is better designed than another B if, after comparable introduction to the languages, programmers of an A-group make fewer mistakes than programmers of a B-group when implementing the same algorithm. If so, then competent, informed language *design* will have to consider expected error rates when defining the language. Because the definitions affect error rates. A second perspective: Definition: The complexity of / (or another language feature) is the number of concepts that a human mind will have to connect properly in order to use / (or another language feature) correctly. Assumption: Programming is a human activity. Since programs express human ideas, clear means of expression reflect programmer intentions better than formally implicit means that in addition depend on statements outside the language, as is the case with C's fundamental types. I suggest, then, Hypothesis 2: A language A is better designed than another B if an understanding and using the language properly is less complex, that is, in order to express the same algorithm, (a) it requires thinking about fewer interconnected, possibly implicit concepts and (b) depends less on statements outside the language.