On 1/14/2011 11:08 AM, Achilleas Margaritis wrote:
On Fri, Jan 14, 2011 at 5:59 PM, Paul Koning<paul_kon...@dell.com> wrote:
...
2) I like headers because they are specifications (they aren't, but
what can I do if one believe so? nothing).
I think that's a matter of opinion, and language-specific as well.
I disagree that it is 'a matter of opinion'. It is not. The concepts
we are discussing are specific and concrete, they are not abstract. We
are not talking religion or morality. It's not a philosophical
subject.
There you are definitely wrong. Of course headers are specifications,
they specify the parameter types etc. Now the question is whether to
go beyond that (after all that's all the Ada syntax really does itself)
and regard them as the proper repository of all the information
that is part of the specification. That *is* a matter of taste
and viewpoint.
You are free to disagree with that as a desirable approach, but it
is indeed a matter, not of religeon or morality (truly weird references
in this discussion) but of desirable viewpoint. And you saying
categorically that "they aren't" does not help the discussion.
The proper viewpoint to take here to support the idea of automatic
generation is to recognize that there is a legitimate difference of
opinion, but that there are lots of people whose opinion (not
statement of fact) matches yours, that headers should not be
regarded as specifications, and therefore it is useful to
generate them automatically. I think if you take the attitude
that everyone has to agree with your viewpoint, you will have
even less success than you already have in pushing this idea.
There are two issues here really
1. How do we deal with the language distortion that your proposal
causes. this seems a significant problem to me, and I have not
really seen you address it.
2. Will having this capability discourage people from viewing
headers as specifications? If so, that might be a good thing
or bad thing depending on your point of view. My view is that
it won't make much difference, I can't see people thinking
It's really nice that I can use headers to mimic the effect
of separate specifications, I will do that ... oh oh, I can
generate them automatically, so much for that idea I can't
be bothered. It's really quite a strong separation of viewpoints
here, and I can't see someone's viewpoint being modified much
by the availability of automatic generation of headers.
But I do think it must be done in a way that does not distort
the language, and for my taste, if this cannot be done with an
external tool, and no changes to the compiler, it is a non-starter.
The Ada people call their headers 'specifications', because a lot of
program specifications are placed in those headers.
But they are not specifications in a sense that you can have multiple
implementations of them. I.e. there is a 1-to-1 correspondence between
Ada package declarations and package bodies.
This is completely wrong, it is quite normal to have specifications
in Ada with multiple bodies, e.g. for different targets, then you
select the body you want to use. This is one of the advantages of
this approach. For example, this approach is used extensively in
the GNAT Ada run time.
How do headers thought of specifications are helpful in achieving high
quality? please give us a concrete example of a case that not having
the headers provides less quality.
You can definitely answer this question yourself, I don't think you
can expect anyone to give you a long tutorial on why this separation
is desirable. A lot has been written on this subject, and there are
lots of programs to use as examples.