-
-
Notifications
You must be signed in to change notification settings - Fork 379
Proposed updates to the D style guide #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Phobos doesn't consistently follow them anyway.
I don't see any reason to require a particular commenting style in any given situation, and Phobos doesn't stick to those requirements anyway.
They haven't really been changed so much as cleaned up, however. Phobos is not entirely consistent with them, but they're what we've generally agreed upon, and Phobos should be changed to be more consistent with them where appropriate.
|
||
$(DT Class, Struct, Union, Enum, Template names) | ||
$(DD are capitalized. | ||
$(DT Classs, Structs, Unions, Enums, Templates) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: Classs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What, you don't think that classes should be hissing at people? ;)
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I LOL'ed.
$(DD Modules that are interfaces to C functions go into the "c" | ||
package, for example: | ||
$(DD Modules that are interfaces to C functions go into the "c" package and | ||
are all lowercase just like any other module. | ||
------------------------------- | ||
import std.c.stdio; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now core.stdc.stdio, and the other Phobos std.c modules are in core.sys.posix.XXX, core.sys.windows.XXX, etc.
I think the entire "C modules" section should just be removed, since we don't have a standard rule any more (C modules aren't treated any differently to other modules).
|
||
$(DT C Modules) | ||
$(DD Modules that are interfaces to C functions go into the "c" | ||
package, for example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember that the D1 style guide is also generated from this. Hence, D1 stuff should be in
The above is D1 stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any stuff on D1 on d-programming-language.org? D1 Home just redirects to the stuff on www.digitalmars.com. It was my understanding that d-programming-language.org was for D2-only.
) | ||
|
||
<h3>White Space</h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://en.wikipedia.org/wiki/Whitespace_character#Definition_and_ambiguity
Personally I've always preferred "white space": I can't stand when words are randomly concatenated...
I don't have any strong preference, though. Just saying that it was correct before, either way.
Not sure how to proceed here. The changed guide is an improvement, but still debated, and pulling this in would legitimize it and boost its importance. All - please advise. |
It is already considered legitimate by everyone who reads it, so we need to fix it or get rid of it, and we need a guide like this for Phobos contributors at minimum. However, I intend to clean it up some more based on other stuff that has come up since I did this, and I'll create a new pull request. Unfortunately, when I brought up one of the controversial points in here up in the Phobos group the other day, only one person responded, so I don't know how we're going to get any kind of consensus on the controversial points, and they do need to be resolved. |
This should bring the style guide in line with what we've been doing with Phobos.