Page 1 of 1

Curly Brackets - coding protocols

Posted: Wed May 21, 2008 1:36 pm
by dwkrueger
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.

Re: Curly Brackets - coding protocols

Posted: Wed May 21, 2008 3:36 pm
by jordansparks
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.

Re: Curly Brackets - coding protocols

Posted: Wed May 21, 2008 4:31 pm
by drtech
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

Re: Curly Brackets - coding protocols

Posted: Wed May 21, 2008 7:26 pm
by dwkrueger
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)

Re: Curly Brackets - coding protocols

Posted: Thu May 22, 2008 1:45 pm
by jordansparks
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.

Re: Curly Brackets - coding protocols

Posted: Thu May 22, 2008 1:52 pm
by jordansparks
A settings export file has been created. http://www.open-dent.com/manual/codingstyle.html

Re: Curly Brackets - coding protocols

Posted: Thu May 22, 2008 5:46 pm
by dwkrueger
Very cool. Thanks,
Dan