FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Style and standards
Goto page Previous  1, 2
 
Post new topic   Reply to topic     Forum Index -> Ares
View previous topic :: View next topic  
Author Message
larsivi
Site Admin


Joined: 27 Mar 2004
Posts: 453
Location: Trondheim, Norway

PostPosted: Wed Sep 15, 2004 1:17 am    Post subject: Re: Code style draft suggestion Reply with quote

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 Smile

A new version (using null, not NULL) is uploaded.
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Thu Sep 16, 2004 12:10 pm    Post subject: Reply with quote

And note the moved asterisk Smile

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 Wink
Back to top
View user's profile Send private message
larsivi
Site Admin


Joined: 27 Mar 2004
Posts: 453
Location: Trondheim, Norway

PostPosted: Thu Sep 16, 2004 12:32 pm    Post subject: Reply with quote

sean wrote:
And note the moved asterisk Smile

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 Wink


Of course I'll complain Wink Or silently change them while I curse you.
Back to top
View user's profile Send private message
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Thu Sep 16, 2004 4:58 pm    Post subject: Reply with quote

I'm likely to do the same Wink 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
View user's profile Send private message
qbert



Joined: 30 Mar 2004
Posts: 209
Location: Dallas, Texas

PostPosted: Thu Sep 16, 2004 5:34 pm    Post subject: Reply with quote

[deleted]

Last edited by qbert on Sat Sep 18, 2004 3:09 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
qbert



Joined: 30 Mar 2004
Posts: 209
Location: Dallas, Texas

PostPosted: Sat Sep 18, 2004 1:11 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Sun Sep 19, 2004 3:48 pm    Post subject: Reply with quote

Sounds good to me.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Ares All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group