phq's picture

Automatic code formatting

I have Monodevelop configured to automatically format the code on save, I also tend to press the Ctrl-E D quite often.

I tried to make a few minor changes.
However the result changes almost every line in any file I touch. This is because of tab vs spaces and a lot of other rules such as brace placement and space before parentheses.

It looks like the code format settings in the solution file does not match that of the existing code.

Is there any guidelines in the OpenTK project so that these settings can be matched?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
flopoloco's picture

I have started using C# .NET on windows and for 4 years I kept within Microsoft coding convention.
http://msdn.microsoft.com/en-us/library/ff926074.aspx

But currently I have switched to Mac Mono
http://www.mono-project.com/Coding_Guidelines

Personally I prefer the one of Microsoft because I got used to it and it seems more logical and structured.
For example Mono style has a few distinctions in some cases that will lead you to confusion, but in Microsoft you will always have the same rules applicable in every case. For example, braces, with Microsoft style you keep every brace in a new line and you sleep good at night without nightmares.

As far as I think OpenTK is based on the Microsoft style guide, but I have seen that is not strict.