-
Notifications
You must be signed in to change notification settings - Fork 9
Code Style Document
Valk edited this page Sep 25, 2024
·
36 revisions
- Follow SRP and DRY principles
- Separation of Concerns
- Avoid over engineering code
- Use Encapsulation
- Prefer Composition over Inheritance
- Think Abstraction
- Indentation: 4 spaces.
- Curly Braces: Always expand.
- Using Directives: Above namespace.
- PascalCase: Types, methods, properties, constants, events.
- camelCase: Private fields, local variables, method args.
-
Prefixes:
On
for events,Set
for set methods,Get
for get methods
- Static Functions: Use when possible.
- CallDeferred(): Avoid if alternatives exist.
- var Keyword: Do not use ever.
- C# Delegate Events: Always use over Godot signals.
-
Explicit Private Modifiers: Always specify
private
.
- Commit Separation: Separate large indentation changes.