what is considered best practice from a code readability standpoint regarding spacing?
Are there any really good C# style guides out there?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A good, short, practical one is here: http://blogs.msdn.com/kirillosenkov/archive/2009/03/12/kirill-s-whitespace-guidelines-for-c.aspx
In short, have the amount of whitespace that is easy on eye. In C#, you’ll have less whitespace than in some other languages because many lines consist only of curly braces. Leaving no blank lines can still result in plenty of white space. I also like to keep very related lines of code right up next to each other, making paragraphs in a sense.
There one reason for taking out blank lines that’s not okay: to fit more code on your screen. If you’re doing that, your code is probably not organized well, with functions too long.