Skip to content

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

Closed
wants to merge 10 commits into from
Closed

Conversation

jmdavis
Copy link
Member

@jmdavis jmdavis commented Jul 16, 2011

This should bring the style guide in line with what we've been doing with Phobos.

jmdavis added 7 commits July 16, 2011 02:28
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)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: Classs

Copy link
Member Author

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.

Copy link

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;
Copy link
Collaborator

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:
Copy link
Member

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 $(V1 ...) and D2 stuff $(V2 ...)

The above is D1 stuff.

Copy link
Member Author

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>
Copy link
Member

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.

@andralex
Copy link
Member

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.

@jmdavis
Copy link
Member Author

jmdavis commented Jul 16, 2012

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.

@jmdavis jmdavis closed this Jul 16, 2012
@jmdavis jmdavis deleted the style branch November 17, 2014 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants