= Updated formatting and language.

This commit is contained in:
Matthew Cech
2019-04-10 23:40:38 -07:00
parent 2c3e6cd159
commit c21880fe3a
+16 -15
View File
@@ -2,43 +2,44 @@ KittyBot Style Guide
--- ---
#### Indenting #### Indenting
Tabs are used so that individual developers can configure their own width settings, and they won't be enforced on others working on the project. Tabs are used so that individual developers can configure their own indent width settings that won't be enforced on others working on the project.
` ```java
// No indent! // I'm not indented!
// One indent! {
// Two indents! // I'm indented with one tab!
` }
```
#### Braces #### Braces
When braces are present, Allman style is used which means that braces are on the next line. Braces should be used to prevent scope confusion. Omitting braces on single-line statements is fine so long as the statement is clear. When braces are present, Allman style is used meaning that braces start on the next line. Braces are used to prevent scope confusion. Omitting braces on single-line statements is fine if the situation is clear.
` ```java
if(something) if(foo)
{ {
System.out.println("This"); System.out.println("This");
System.out.println("has"); System.out.println("has");
System.out.println("braces!"); System.out.println("braces!");
} }
if(something) if(bar)
System.out.println("No braces!"); System.out.println("No braces!");
` ```
#### Naming #### Naming
Class names and function names are in PascalCase! Variable names are in camelCase! Class names and function names are `PascalCase`. Variable names are `camelCase`.
` ```java
public class MyClass public class MyClass
{ {
private String myString; private Foo myVariable;
public function MyFuction() public function MyFuction()
{ {
// ... // ...
} }
} }
` ```
#### Ternary Operator #### Ternary Operator
Don't. Don't.