Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
Skyward Boardcore
Wiki
Coding Guidelines
Changes
Page history
New page
Templates
Clone repository
Updated Coding Guidelines (markdown)
authored
7 years ago
by
Luca Erbetta
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Coding-Guidelines.md
+11
-0
11 additions, 0 deletions
Coding-Guidelines.md
with
11 additions
and
0 deletions
Coding-Guidelines.md
View page @
61ab6dd3
...
...
@@ -20,6 +20,17 @@ The use of dynamic allocation can lead to heap fragmentation and out-of-memory e
Recursive code is hard to read and debug, and can easy lead to stack overflow errors.
-
**Every class with a virtual function shall define a virtual destructor**
Avoid undefined behavior where a derived class is destroyed through a reference to the base class, possibly leaking resources.
-
**Every header file shall be guarded using defines containing the full project path of the file**
Example: File
`src/shared/sensors/ExampleSensor.h`
```
#ifndef SRC_SHARED_SENSORS_EXAMPLESENSOR_H
#define SRC_SHARED_SENSORS_EXAMPLESENSOR_H
//Code goes here
#endif /* SRC_SHARED_SENSORS_EXAMPLESENSOR_H */
```
## **General rules**
These are not critical rules, but you should follow them in most cases.
...
...
This diff is collapsed.
Click to expand it.