Introducing the C# Style Guide

A coming new year brings an update style guide. Take a look to see how Unity tutorials will be formatted in future tutorials. By Eric Van de Kerckhove.

Leave a rating/review
Save for later


Hide contents

Introducing the C# Style Guide

2 mins

The Unity Team at has grown a lot in the past year. At this point, we’ve released over 20 free Unity tutorials, and even a brand new Unity book.

Now that the team has grown, we want to make sure we keep our style consistent, following the modern C# and Unity conventions developers are acquainted to.

So today, the team and I are proud to announce the official C# style guide!

Let’s take a look at what’s inside.

Guide Highlights

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.

To learn more, check out the full C# style guide.

Where To Go From Here?

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! :]