Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documented coding guidelines and standards for the ACE project #2571

Merged
merged 3 commits into from
Jan 19, 2016

Conversation

thojkooi
Copy link
Contributor

Add more documentation for the coding guidelines.

  1. Add design considerations
  2. Add specifications on code structures, including logging and design
  3. Add naming conventions.

This will still require more discussion and additional documentation to cover more cases.

  • Reasoning on some/most statements.
  • The usage of param and params
  • locality and the usage of publicvariable
  • postInit and initPost
  • common patterns used within ACE, ie the usage of runAfterSettingsInit
  • Settings framework, dependencies and modularity

Additionally we could write a checklist for reviewing PRs.

Add more documentation for the coding guidelines.

1. Add design considerations
2. Add specifications on code structures, including logging and design
3. Add naming conventions
@jonpas
Copy link
Member

jonpas commented Sep 22, 2015

#2120 contains some stuff as well.

4 spaces for indentation.
### 1.1. Variable Names
#### 1.1.1. Global Variable naming
All global variables must start with the ACE prefix followed by the component, separated by underscores. Global variables may not contain the fnc_ prefix if the value is not callable code.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACE ... fnc
or (whichever is selected should be used on the entire page)
ACE_ ... fnc_

Example:</br>
`STR_Balls_Banana`</br>
### 6.9. Initialization expression in for loops
The initialization expression in a for loop will perform no actions other than to initialize the value of a single for loop parameter.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code tags around for.

@commy2
Copy link
Contributor

commy2 commented Sep 22, 2015

Point 8.2. (createVehicle Array) should also apply to createUnit.

https://community.bistudio.com/wiki/createUnit
https://community.bistudio.com/wiki/createUnit_array

createUnit doesn't return the newly created unit and the concept of the init line is horrible.

| `LSTRING(banana)` | "STR_ACE_balls_banana"|
| `ELSTRING(balls,banana)` | "STR_ACE_balls_banana"|
### 6.11. GetVariable
When using getvariable, there should either be a default value given in the statement or the return value should be checked for correct data type as well as return value. A default value may not be given after a nil check.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using getVariable, there should either be a default value given in the statement or the return value should be checked for correct data type as well as return value. A default value may not be given after a nil check.

@jonpas
Copy link
Member

jonpas commented Sep 22, 2015

I may have been a bit picky...

Overall 2 notes:

  • We don't use dots . on any other page after heading number, eg: 8.7., we just use 8.7
  • We use - instead of *

…nvention

Added Private Variable naming conventions to PR #2571
@bux
Copy link
Member

bux commented Dec 30, 2015

Status?

@thojkooi
Copy link
Contributor Author

Merging this since it's more accurate as the current documentation, though not perfect yet. We will sort out the rest in a different PR so this won't be sitting here forever.

thojkooi added a commit that referenced this pull request Jan 19, 2016
Documented coding guidelines and standards for the ACE project
@thojkooi thojkooi merged commit 3819a56 into gh-pages Jan 19, 2016
@thojkooi thojkooi deleted the coding-guidlines branch January 19, 2016 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

8 participants