This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Stop putting function comments in foo.h
- From: DJ Delorie <dj at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 17 Mar 2014 13:14:53 -0400
- Subject: Re: [RFC] Stop putting function comments in foo.h
- Authentication-results: sourceware.org; auth=none
- References: <CADPb22QBBrYB70YoL-Aqyfi77gphGija4zK5mSgYckwfZ7e84g at mail dot gmail dot com> <53271DC0 dot 3050405 at redhat dot com>
Pedro Alves <palves@redhat.com> writes:
> Whenever I look at a header file that doesn't document its
> functions' interfaces (and often doesn't even list the
> parameter names), I get depressed and disappointed. I'm
> wondering if it's just me. :-)
Speaking from the "someone who uses the API but doesn't understand the
source tree" point of view, it's usually a lot easier to discover an API
through the header files, and that's where I expect to find some
documentation about the API.
The only time that documentation-in-source works is when there's a
strict one-to-one mapping of headers to sources, else finding the
documentation becomes yet another task to hurdle.
Also, I've yet to find a doxygen doc set that adds any value over just
commenting the headers.
Also, IMHO there should be *two* sets of in-source docs: the headers
should have comments suitable for users of each API, and the source
should have comments relevent to those editing the implementation.