December 2020
Beginner
444 pages
10h 52m
English
The C# Coding Standard for this Book
This appendix lists the coding standard for C# and Unity as used in this book. This is a fairly simple and short coding standard. More extensive and detailed coding standards can be found on the internet.
Tabs: Never use tabs. Instead, indent using spaces, either two or four spaces.
Line Width: Limit line width to 72 characters. This is to help with readability and with formatting the code for this book.
Bracing: Open and closed braces are at the beginning of lines and are the only thing on the line. Never omit braces for blocks of just one statement. Single line blocks may have the braces on the same line.
For example:
Bad if ( x > 9 ) y = 3; Good if (x > 9) { y = 3; } Also OK if (x > 9){ y ...
Read now
Unlock full access