Achilleas Margaritis <axil...@gmail.com> writes:
> So, if the compiler checks the code, and the documentation says
> whatever must be said about the program, headers are completely
> redundant.

I think this is often/usually not true in practice though.

It seems _far_ more common for there to be reasonable header files than
for there to be reasonable documentation (in part because much
documentation is not actually reasonable).

With a module language, one can read the actual source files instead the
headers, of course, but this is often much more difficult than reading
the header files, because there's _too_ much (usually irrelevant)
information in the source files...

This could be helped by, for instance, a tool that automatically hid
most of a source file for browsing purposes, showing only "exported"
interfaces, but I'm not sure it's good to assume such a thing.

[My main complaint about C/C++ header files would not be the redundancy
of the "interface" declarations, but rather that they contain too much
private information that should really be hidden to users of the
interface, and so make reading the interface more complicated (similar
to reading the actual source file).]

-Miles

-- 
Laughter, n. An interior convulsion, producing a distortion of the features
and accompanied by inarticulate noises. It is infectious and, though
intermittent, incurable.

Reply via email to