Curly Brackets - coding protocols

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
dwkrueger
Posts: 47
Joined: Tue Jun 26, 2007 1:43 pm
Location: Indiana

Curly Brackets - coding protocols

Post by dwkrueger » Wed May 21, 2008 1:36 pm

I am using visual studio and the default for placing curly bracketts is on the line below the declartion. This feature is nice because when you hit the lower curly bracket on the block it autoformats the code.

Your spec's state to put the curly bracket on the same line as the declartion
private void somemethod (vars) {
...stuff...
...stuff...
}

VS Defaults
private void somemethod (vars)
{
...stuff...
...stuff...
}

Does anyone know how to change this?

Is this in the SLN file? If so can someone change it to the coding style you like?
If this is preserved in the .SUO file I suggest what the SVN manual states.
1) Make a SUO file the way you like things.
2) Change the name of the file name to Opendental.suo.master
3) Commit the master file
4) (optional) Block the committing of .suo files
5) We as user can pull the master file off change the name back to Opendental.suo then we should have your preference for coding style build in to our developing environment.

This would also may reduce the changes that occurr with a commit.

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Curly Brackets - coding protocols

Post by jordansparks » Wed May 21, 2008 3:36 pm

It's not in the sln file, and I don't think it's even in the suo file. I will create an export file later.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
drtech
Posts: 1649
Joined: Wed Jun 20, 2007 8:44 am
Location: Springfield, MO
Contact:

Re: Curly Brackets - coding protocols

Post by drtech » Wed May 21, 2008 4:31 pm

you change the setting in the text formatting options of VS...but I don't know where it saves that so that everyone will have the same settings
David Fuchs
Dentist - Springfield, MO
Smile Dental http://www.887-smile.com

User avatar
dwkrueger
Posts: 47
Joined: Tue Jun 26, 2007 1:43 pm
Location: Indiana

Re: Curly Brackets - coding protocols

Post by dwkrueger » Wed May 21, 2008 7:26 pm

What do you mean by "I will create an export file later."

by the way I personally like
method
{
...stuff...
...stuff...
}

I think you can mentally digest the code quicker. But I know it takes up screen realestate - get a bigger monitor. (minimal file size)

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Curly Brackets - coding protocols

Post by jordansparks » Thu May 22, 2008 1:45 pm

While it is somewhat arbitrary that the current curly brackets style was chosen, the important thing is for everyone to do it the same. It is possible for a programmer to quickly become accustomed to either way. What's hard is switching back and forth. It is less efficient. So we need to go with the prevailing style, which just also happens to save space.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
jordansparks
Site Admin
Posts: 5744
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Curly Brackets - coding protocols

Post by jordansparks » Thu May 22, 2008 1:52 pm

A settings export file has been created. http://www.open-dent.com/manual/codingstyle.html
Jordan Sparks, DMD
http://www.opendental.com

User avatar
dwkrueger
Posts: 47
Joined: Tue Jun 26, 2007 1:43 pm
Location: Indiana

Re: Curly Brackets - coding protocols

Post by dwkrueger » Thu May 22, 2008 5:46 pm

Very cool. Thanks,
Dan

Post Reply