View previous topic :: View next topic |
Author |
Message |
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Wed Sep 15, 2004 1:17 am Post subject: Re: Code style draft suggestion |
|
|
regan wrote: | Code: |
UPDATE 2001-11-21 larsa: Actually, we now prefer that you use this
define as an if-condition instead, because of the cleaner look the
source code gets when it is not littered with preprocessing
directives. For permanent debugging code, write therefore source
code like this instead:
|
Is this part correct? we don't have pre-processor directives? debugging should be done with
debug (ident) {
}
right?
|
Non-sensical leftover from the original.
regan wrote: |
Code: |
e) Pointer types and references: use a space on each side of the
'*' and '&' operators, like this
SoNode * mynode = NULL;
not like this
SoNode *mynode = NULL;
because it makes it look like the '*' "belongs" to the variable
name (which of course is wrong -- it's part of the type), and
not like this either
SoNode* mynode = NULL;
because it's ugly and unusual. So for consistency, _please_
stick with the space-on-both-sides convention in Ares code.
|
I thought D style was:
SoNode* mynode = NULL;
Regan |
Well, sure
A new version (using null, not NULL) is uploaded. |
|
Back to top |
|
|
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Thu Sep 16, 2004 12:10 pm Post subject: |
|
|
And note the moved asterisk
Frankly, I don't really care where people put their curly braces and such so long as they're consistent and the result is readable. What matters most to me is interface consitency. So someone who is familiar with the basics of Ares should be able to use any of its functionality with a minimum learning curve and few surprises. Also, back-end code consistency eases maintainability for library implementors. Again, this isn't a formatting issue so much as a naming and procedural issue. So my only issue with the codestyle draft is that it is too complete. I promise not to complain about your formatting style so long as you don't complain about mine |
|
Back to top |
|
|
larsivi Site Admin
Joined: 27 Mar 2004 Posts: 453 Location: Trondheim, Norway
|
Posted: Thu Sep 16, 2004 12:32 pm Post subject: |
|
|
sean wrote: | And note the moved asterisk
Frankly, I don't really care where people put their curly braces and such so long as they're consistent and the result is readable. What matters most to me is interface consitency. So someone who is familiar with the basics of Ares should be able to use any of its functionality with a minimum learning curve and few surprises. Also, back-end code consistency eases maintainability for library implementors. Again, this isn't a formatting issue so much as a naming and procedural issue. So my only issue with the codestyle draft is that it is too complete. I promise not to complain about your formatting style so long as you don't complain about mine |
Of course I'll complain Or silently change them while I curse you. |
|
Back to top |
|
|
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Thu Sep 16, 2004 4:58 pm Post subject: |
|
|
I'm likely to do the same It's too bad there isn't an autoformatter for D yet, it would be nice to just define the rules we want and run it on a source file. |
|
Back to top |
|
|
qbert
Joined: 30 Mar 2004 Posts: 209 Location: Dallas, Texas
|
Posted: Thu Sep 16, 2004 5:34 pm Post subject: |
|
|
[deleted]
Last edited by qbert on Sat Sep 18, 2004 3:09 pm; edited 1 time in total |
|
Back to top |
|
|
qbert
Joined: 30 Mar 2004 Posts: 209 Location: Dallas, Texas
|
Posted: Sat Sep 18, 2004 1:11 pm Post subject: |
|
|
I will commit to getting astyle work with D if everyones cool with http://astyle.sf.net .
Should we move to the next phase ?
Charlie |
|
Back to top |
|
|
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Sun Sep 19, 2004 3:48 pm Post subject: |
|
|
Sounds good to me. |
|
Back to top |
|
|
|