|
|
@@ -1,4 +1,5 @@
|
|
|
# Vinora Project Conventions
|
|
|
+(Modified from raylib's conventions)
|
|
|
|
|
|
In Vinora Project we use C99. We would use C89 (for a lot of reasons), but
|
|
|
raylib use C99, so we kinda concede here.
|
|
|
@@ -6,7 +7,7 @@ raylib use C99, so we kinda concede here.
|
|
|
Still, we have no respect for so called "technical standarts" here.
|
|
|
_Compability_ is our sacred cow, especially backwards compatibility.
|
|
|
|
|
|
-## Banned technologies
|
|
|
+## Banned Technologies
|
|
|
|
|
|
1. **VLA**: Just don't. [Please](https://lkml.org/lkml/2018/3/7/621).
|
|
|
> AND USING VLA'S IS ACTIVELY STUPID!
|
|
|
@@ -22,7 +23,24 @@ grant them this ability with Vinora Engine.
|
|
|
3. **To be continiued...**
|
|
|
|
|
|
|
|
|
-## Style Conventions
|
|
|
+## General Conventions
|
|
|
+1. Lines **MUST NOT** exceed **80 characters** (in **ANY** file).
|
|
|
+2. Files and directories are named in **snake_case**. For important files, use
|
|
|
+**ALL_CAPS**
|
|
|
+3. All names and code are **ASCII-only**. Unicode and other encodings are
|
|
|
+allowed only in .vnrs and .conf files (which are created by user).
|
|
|
+4. **User's time > developer's time.**
|
|
|
+So, if we have a choice between making developer's life easier or making
|
|
|
+user's life easier, we **ALWAYS** choose the second option.
|
|
|
+
|
|
|
+
|
|
|
+## Code Conventions
|
|
|
+1. **ALWAYS** initialize all defined variables.
|
|
|
+2. **Do not use TABS**, use 4 spaces instead.
|
|
|
+3. Avoid trailing spaces, please, avoid them
|
|
|
+4. Control flow statements always are followed **by a space**
|
|
|
+
|
|
|
+### Code Style Conventions
|
|
|
|
|
|
It's mostly the same as raylib, **except enum members**.
|
|
|
If you're an old-school C developer, pls look carefully: this conventions
|
|
|
@@ -49,16 +67,6 @@ Struct | TitleCase | `struct Texture2D`, `struct Material`
|
|
|
Functions | TitleCase | `InitWindow()`, `LoadImageFromMemory()`
|
|
|
Parametrs | lowerCase | `func(int screenWidth, int screenHeight)`
|
|
|
|
|
|
-### Some other conventions to follow:
|
|
|
-
|
|
|
-1. **ALWAYS** initialize all defined variables.
|
|
|
-2. Lines **MUST NOT** exceed **80 characters** (in ANY file).
|
|
|
-3. **Do not use TABS**, use 4 spaces instead.
|
|
|
-4. Avoid trailing spaces, please, avoid them
|
|
|
-5. Control flow statements always are followed **by a space**
|
|
|
-6. **User's time > developer's time.**
|
|
|
-So, if we have a choice between making programming easier or making
|
|
|
-user's life easier, we **ALWAYS** choose the second option.
|
|
|
|
|
|
### Code example
|
|
|
```c
|