comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: About a C/C++ to ADA translator
Date: 1998/01/05
Date: 1998-01-05T00:00:00+00:00	[thread overview]
Message-ID: <dewar.884014102@merv> (raw)
In-Reply-To: 68qr3u$m1t@universe.digex.net


Dave said

<<(I hope this was more helpful than Robert's rather acerbic reply)
>>

The important point in my reply was to discourage trying to learn
programming by example. Yes, examples are useful for understanding
good style, but they are generally a poor way of learning languages
where precision is required. Your (Dave) recommendation to read
books is a good one, and consistent with my suggestion.

I find that programmers who can only learn by example tend to have a very
spotty knowledge of the language, and in particular are least likely to
be able to distinguish between the language as defined and the language 
as implemented.

For my own personal tastes I dislike all examples in programming reference
manuals, they are either wrong, in which case they are misleading, or
redundant, and redundancy is not a good idea in any definition. An example
can only tell you one thing that works, it cannot tell you the class of
things that work. That's a fundamental weakness. At the same time I realize
that a surprising (to me) number of people do find examples helpful.

So if you don't know how 2D arrays (or any other feature of Ada) works,
then the starting point should be to go read the RM or a textbook, as
appropriate to your level of understanding, to find out the rules for
how to use 2D arrays. This is a straightforward syntactic matter, and
anyone should be able to read BNF fluently who considers themselves a
programmer (even if they cannot manage to wade through chapter 3 of the
RM :-)

Now of course, you sometimes read something and misread, and cannot understand
an example of your own that you think is right which gets an error message.
(We put in a huge effort to generate good error messages from GNAT, so once
again, I take the opportunity to encourage people to submit reports on error
messages they find confusing, preferably with suggestions on improvements,
don't be afraid to be ambitious in your suggestions, it is surprising sometimes
what can be achieved -- e.g. the job that GNAT does in figuring out the
semicolon/is mess is quite suprising sometimes).

If you are stuck on a specific error message, and cannot figure it out, then
that is indeed a good time to post a message to CLA, with exact code and
what you saw. If you post a sharp well defined example of this kind, which
involves main language features, as opposed to murky things like non-standard
rep clauses :-) then you will likely get a pretty immediate response from CLA.






  reply	other threads:[~1998-01-05  0:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-05  0:00 About a C/C++ to ADA translator Marcos Jimenez Bermejo
1998-01-05  0:00 ` David  Weller
1998-01-05  0:00   ` Robert Dewar [this message]
1998-01-05  0:00 ` Robert Dewar
1998-01-05  0:00   ` Marcos Jimenez Bermejo
1998-01-05  0:00     ` Kenneth W. Sodemann
1998-01-05  0:00     ` nabbasi
1998-01-05  0:00   ` Two dimensional arrays: help Michael F Brenner
1998-01-05  0:00     ` Robert Dewar
1998-01-06  0:00       ` Chris Morgan
1998-01-06  0:00         ` Robert Dewar
1998-01-07  0:00 ` About a C/C++ to ADA translator Benoit Jauvin-Girard
1998-01-12  0:00   ` Jean-Claude MAHIEUX
1998-01-09  0:00 ` Brian G. Holmes
replies disabled

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