Introducing the raywenderlich.com C# Style Guide

Eric Van de Kerckhove
Check out the new C# style guide!

Check out the new C# style guide!

The Unity Team at raywenderlich.com 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 raywenderlich.com 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! :]

Eric Van de Kerckhove

Eric is a belgian hobbyist game dev and has been so for more than 10 years.
He started with DarkBasic, RPG Maker, Game Maker & XNA and now he makes games using Unity.
Eric also takes interest in 3D modelling, vector art and playing video games.
Eric is currently the Unity team lead.

Other Items of Interest

Save time.
Learn more with our video courses.

raywenderlich.com Weekly

Sign up to receive the latest tutorials from raywenderlich.com each week, and receive a free epic-length tutorial as a bonus!

Advertise with Us!

PragmaConf 2016 Come check out Alt U

Our Books

Our Team

Video Team

... 20 total!

Swift Team

... 16 total!

iOS Team

... 28 total!

Android Team

... 15 total!

macOS Team

... 10 total!

Apple Game Frameworks Team

... 11 total!

Unity Team

... 11 total!

Articles Team

... 11 total!

Resident Authors Team

... 15 total!