comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Drummond <brian_drummond@btconnect.com>
Subject: Re: Embedded systems programmers worldwide earn failing grades in C
Date: Mon, 25 Jan 2010 01:32:00 +0000
Date: 2010-01-25T01:32:00+00:00	[thread overview]
Message-ID: <5pppl5lm5h1eerr6aesru2n9poois8vesc@4ax.com> (raw)
In-Reply-To: 7roqb2Fas8U1@mid.individual.net

On Wed, 20 Jan 2010 17:46:09 +0100, "Alex R. Mosteo" <alejandro@mosteo.com>
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



  parent reply	other threads:[~2010-01-25  1:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20 10:50 Embedded systems programmers worldwide earn failing grades in C alexandru.chircu
2010-01-20 16:46 ` Alex R. Mosteo
2010-01-20 20:48   ` Keith Thompson
2010-01-21 10:09     ` Alex R. Mosteo
2010-01-21 21:54       ` Keith Thompson
2010-01-25  1:32   ` Brian Drummond [this message]
2010-01-25 23:22     ` Keith Thompson
2010-01-26  0:38       ` Brian Drummond
2010-01-26 14:09         ` stefan-lucks
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox