Use of templates in c code?

Alec Teal a.teal@warwick.ac.uk
Wed Feb 13 15:34:00 GMT 2013


On 13/02/13 13:47, Diego Novillo wrote:
>
>> I feel silly now, why not use .cpp? SVN's move not good enough?
>> (or is it just because no one could be bothered?)
> The latter.  Perhaps we should start renaming the files.  It will help
> with this confusion and it will also be useful for tools like editors
> and such.
>
> Richi, should we wait for stage 1 to re-open to do a round of mass renames?
>
>
> Diego.
>
I'm at a computer now!

A few questions, what is this stage 1? (link to documentation please, or 
a descriptive answer).

for the choice of file extension, this is really a tiny thing, but I do 
have a reason for .cpp
http://stackoverflow.com/questions/1545080/correct-c-code-file-extension-cc-vs-cpp
So I have done some research :P

I wouldn't go as far as to change header-file extensions because that's 
clear from the context and most tools now (read: Doxygen) are quite 
happy with .h being a c++ header file.

I like .cpp because it's what I learned, "see-pee-pee" seems to be a 
natural short-hand of "see-plus-plus" and "see-see" just brings to mind 
carbon-copying. I am also used to seeing extensions that make sense, 
".py" for python, ".php" for php why not go with this.

The last reason is a reason but it's quite a null one. Seeing .cpp files 
makes them feel more accessible when first meeting them, that hesitation 
when seeing .cc or .C (I've never seen c++ as an extension) just makes 
it feel either "old-skool" and created by people from before my time 
(not accessible, daunting in fact) or not nice to glance over because of 
that thought in the .cc part (this could be a dyslexic thing.... it 
doesn't help!), conversely any confident person would not be deterred by 
such silly reasons (even though I know they're silly, I still feel them) 
and thus to them it doesn't matter.

Alec
I'm also thinking of re-writing the C++ parser there are some 
interesting todos (using lookahead rather than "try the next option") 
it's a topic I enjoy and something I could (probably) do, especially 
given a working version already. thoughts and feelings on that real quick?





More information about the Gcc mailing list