This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ext/ names (was: re:[PATCH] HP/SGI extensions to...)


On Fri, Jan 04, 2002 at 01:22:46AM +0100, Paolo Carlini wrote:

> Currently, every modern (not the backward, deprecated ones) header file meant to
> be included by the user does *not* have any extension: indeed, when I started my
> task, I found in the ext directory slist, hash_map, hash_set, rope. I think,
> naively perhaps, that when you learn C++, you learn that C++ header files do not
> have a .h extension. You learn that, even if you unfortunately don't have any
> first hand information on the actual meetings of the standard commitee. As time
> passes, you ends up finding such naming scheme much more elegant. This is of
> course only my humble, personal, point of view.


>From a lowly user's point of view, I prefer suffixed headers, if only
because a number of editors I use won't automatically do syntax
highlighting on a file without a suffix, so if I open up ext/memory to
see what extensions are available, or check the prototype for a function
(usually quicker than referring to the docs if it's just a check) then my
editor won't highlight it.

I realise that this will always be true of the std headers, but I'm less
likely to open them to check prototypes; if they're std-conforming then
they're documented in far more places than the libstdc++ extensions, and
I'm more likely to know them anyway. The same isn't true of extensions.
(Also, the model where <vector> includes <bits/std_vector.h> gets around
the problem of my editor not highlighting the std headers, as everything
of interest is in the suffixed file bits/std_vector.h)

In a similar way, some graphical filemanagers won't show the correct
filetype icon for suffixless files, so won't choose the right action to
perform on the file when selected by the user.

Minor points compared with some of the issues, admittedly, but they're the
only ones I care about  ;)

I think adopting the committee's decision to avoid choosing between .h,
.hpp, .hxx etc. is mistaken, as there seems to be no disagreement between
you that the "correct" suffix is .h and, after all, having no suffix tells
you even less about the file. ".h" may not distinguish C++ from C headers,
but it's better than nothing.

Just my two penneth...

jon


-- 
"Sell your cleverness and buy bewilderment:
 Cleverness is mere opinion, bewilderment is intuition."
        - Jalal-uddin Rumi



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]