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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 24 Jan 2010 19:29:25 -0600 From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: Embedded systems programmers worldwide earn failing grades in C Date: Mon, 25 Jan 2010 01:32:00 +0000 Reply-To: brian@shapes.demon.co.uk Message-ID: <5pppl5lm5h1eerr6aesru2n9poois8vesc@4ax.com> References: <3aadd38d-0496-4f61-ba82-d0e1f0c983d2@a32g2000yqm.googlegroups.com> <7roqb2Fas8U1@mid.individual.net> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-s1jwymtzlohF9MVb7dnH1SGPZhGiXZPz22bWMiSFzYAGSce/wcApL0prE05DkaiqjaLLENvkpmYECiT!lZMTo7WDBVYMEQBZQl7J9mdJPqNfaMb/yFEZMhmHJptm1UXUCpvWXjf8B/mTlq8WHP+DSxP2MqGe!xQNm X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Xref: g2news1.google.com comp.lang.ada:8821 Date: 2010-01-25T01:32:00+00:00 List-Id: On Wed, 20 Jan 2010 17:46:09 +0100, "Alex R. Mosteo" wrote: >alexandru.chircu@gmail.com wrote: > >> http://www.edadesignline.com/showArticle.jhtml?articleID=222300710 >> >> I leave the witty remarks to the more regular posters here :). > >I just took it, and scored 7/10, with the caveat that > >2 of my failures were partial (I chose one were several were valid), so I >didn't chose wrong code. 7/10 here too. Similar reasons, plus (where I got it wrong) the knowledge that if I met the question in real life I'd take time to look it up. What might be interesting would be to port the questions to Ada (as far as can be done) and see (a) how many of them become trivial, and (b) how well people do on the translated test... One might plot the results against Ada experience as recorded in one additional question: I have used Ada: (a) as a professional (b) as a hobbyist (c) never, but I've used Pascal, Modula-2 or VHDL (d) none of the above If the Ada scores were significantly different from the C scores, that ought to say something about the best choice of language. Or would it make sense to try to set Ada-specific traps for the unwary? I can't help thinking they would be found in much more advanced aspects of the language than constant and array declarations! Hmmmm, anyway, here's a lame attempt at porting a couple of the questions. Q: Which of the following is the most portable way to declare an Ada (which has no preprocessor) constant for the number of seconds in a (non-leap) calendar year? (a) Seconds_Per_Year : constant natural := 60 * 60 * 24 * 365; (b) no preprocessor traps from textual substitution, so no ( ) subtleties (c) literals of type Universal Integer, so no explicit size qualifiers (d) all of the above are true, why make it more complex than (a)? Q: Which of the following statements accurately describes the intended effect of the declarations: type int_array is array (1..10) of integer; type int_array_ptr is access int_array; a: int_array_ptr; Answers (a) An array of ten integers (b) A pointer to an array of ten integers (c) An array of ten pointers to integers (d) An array of ten pointers to functions - Brian