Comments on DMD frontend.

Bill Baxter dnewsgroup at billbaxter.com
Wed Feb 27 11:01:06 PST 2008


Leandro Lucarella wrote:
> Walter Bright, el 26 de febrero a las 12:24 me escribiste:
>> Leandro Lucarella wrote:
>>> My firt big surprise, and not a good one, was that the frontend files are
>>> named with the .c extension, instead of .cpp, .cxx, or anything used for
>>> C++ files. Is there a rationale behind that? I find it very confusing.
>> When I first started with C++, I carefully named all my h files ".hpp" and source files 
>> ".cpp". Over time, the .hpp was dropped in favor of .h, and eventually .cpp => .c.
>>
>> It's not confusing to me because I never mix C and C++ source files in the same project.
> 
> It's not confusing to you! If you do it in a closed source project, it's
> perfectly fine but if you do it in an open source project, it's a bad
> thing (TM). You are putting a barrier to people to contribute (and making
> D look ugly).
> 
> What are the chances that you rename them to a commonly used C++
> extension?
> 
> And what about the debug stuff. Are you willing to accept patcher or not?
> I'm just looking for a "yes" or "no". Please?
> 
> Thank you.
> 

Additionally, some IDEs decide what compiler to use based on the 
filename extension and will automatically try to use a C compiler 
instead of a C++ one if the filename is .c.  It doesn't matter for 
headers to be called .h since they're not directly compiled.  (Even with 
pre-compiled headers you pre-compile them by #including them all in a 
single source file).

Also editors often decide on what syntax highlighting mode to use based 
on the extension.

So it's not just about people getting confused.

--bb



More information about the Digitalmars-d mailing list