I guess I would just summarize things as follows. You
can possibly generate headers automatically (just as
you could generate subprogram specifications in Ada
automatically).

No one would ever think of suggesting doing this
automatically in Ada.

Why not? Because you might be able to generate
the syntax of the specs, but you can never extract
the specification from the implementation. That's
because by its nature the implementation over-specifies.

For example, if you have a sort package, the spec may
simply require sorting, but not stable sorting.

The implementation may happen to use an algorithm that
happens to be stable.

But if you have only the implementation you won't
be able to tell if the stabilitiy is part of the
specification.

Then if you find later that you could speed things
up hugely by abandoning the stability, you won't know
if clients are legitimately depending on this or not.

So from my narrow Ada perspective, I don't like any
suggestion of automatic generation of c++ header
files, but on the other hand, I understand that there
are lots of people who have view a of headers (nuisance
required by the compiler), and for such people it may
ease writing to have such automatic generation. As I
said before I never care at all about ease of writing
code, compared to ease of reading it (and in the case
of library packages, clients are readers).

Reply via email to