Bug 4008 – dmd source should contain no tabs and use .cpp file extensions

Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2010-03-26T03:22:00Z
Last change time
2015-06-09T05:13:49Z
Assigned to
nobody
Creator
nfxjfg

Comments

Comment #0 by nfxjfg — 2010-03-26T03:22:47Z
Rationale: Right now, the dmd source code contains mixed tabs and spaces for indentation. You can have endless discussions about whether using tabs for indentation is ok, but I'm sure almost everybody will agree that MIXING tabs and spaces is a really, really, really bad idea and causes trouble for most editors, making writing or applying patches unnecessarily hard. I suggest Walter to consistently use either tabs or spaces for indentation (spaces would cause the least trouble for others). Additionally, the dmd source is full of .c whiles, which, despite their file extensions, are not C, but C++ sources. This is confusing and leads to trouble with various tools trying to autodetect the language from the filename. I suggest using more conventional file extensions. I believe .cpp is most widely accepted for C++ sources.
Comment #1 by bearophile_hugs — 2010-03-26T07:44:34Z
They are both ideas that I like, but: - It seems versioning systems are stupid, they are not able to ignore leading spaces, so replacing tabs with spaces can create a huge diff file, essentially it's a new version of all files. Yet, if this is the only change then I think this can be acceptable. - Walter and others seems to not like "cpp" file extensions.
Comment #2 by nfxjfg — 2010-03-26T07:51:58Z
Other popular file extensions: .cc .cxx .c++ I've never seen .c for C++ sources, only dmd.
Comment #3 by nfxjfg — 2010-03-30T20:09:53Z
http://dsource.org/projects/dmd/changeset/428 "remove tabs, any trailing spaces" Thanks, Walter! This is a good change. The dmd source code's indentation will no longer look chaotically random for new people.