At this point, the guide is fairly basic. It contains guidance on the following items:
Case. Case can be confusing – sometimes it’s best to use camelCase, and sometimes it’s best to use PascalCase. We try to clarify what’s best where.
Code blocks. Indentation should always be done using spaces. Blocks of code should always be indented 4 spaces.
Braces. All braces get their own line. This follows the C# convention and improves readability. Conditional statements are always required to be enclosed with braces, irrespective of the number of lines required.
Switch statements.. Never include the default statement, this only clutters up the code and should be removed.
We know everyone has a different opinion on a certain style of code and we’d love to hear yours!
If you have any suggestions on how to improve this code even further, post issues on the GitHub page or file pull requests – I’ll be watching for them, and if you can convince me (and the rest of the team), we’ll change the guide.
We hope you like the new and improved C# style guide – you can look forward to some awesome Unity tutorials coming up that will be using it! :]
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.