# The C# Style Guide

This style guide is based on [this other C# style guide](https://github.com/raywenderlich/c-sharp-style-guide/blob/master/README.markdown) and expands upon it.

You can use whatever file editor you want, but [Visual Studio](https://code.visualstudio.com/) is probably the most popular and recommended choice. It's free, has many features, and integrates well with Unity and Git.&#x20;

If you're a student, we recommend getting a copy of [JetBrain's Rider](https://www.jetbrains.com/rider/) which adds a lot of code hints and shortcuts that will significantly improve your code quality.

Our overarching goals are **clarity**, **readability** and **simplicity**. Also, this guide is written to keep **Unity** in mind.

### Inspiration

This style guide is based on C# and Unity conventions, and discussions within the development team.

### Automation

We recently added an [EditorConfig](https://editorconfig.org/) file to automate the code review process, it is a file you can add to [Visual Studio](https://learn.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2022) or [Rider](https://www.jetbrains.com/help/idea/editorconfig.html) and it will apply the formatting and style we use to your analyzers, telling you when something is out of order.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ss3d.gitbook.io/dev-guide/guidelines/the-c-style-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
