-
Class Naming Conventions:
- Class names should begin with a capital letter, following CamelCase convention. For example:
DatabaseHandler
.
- Class names should begin with a capital letter, following CamelCase convention. For example:
-
Private Class Members:
- Private class members should be named with an underscore suffix. For instance,
int m_counter
.
- Private class members should be named with an underscore suffix. For instance,
-
Variable Naming:
- Use meaningful and descriptive names for variables.
- Follow camelCase convention for variable names.
- Avoid single-letter names or abbreviations unless they are widely recognized.
- Global variables should be avoided whenever possible. If needed, prefix them with "g_" for clarity.
-
Function Naming:
- Use verbs or verb phrases to describe functions' actions.
- Follow camelCase convention for function names and function arguments
-
Comments:
- Use comments to explain complex algorithms, non-trivial decisions, or any code that might be unclear.
- Comments should be clear, concise, and written in English.
- Avoid redundant comments that merely restate the code.
-
Indentation and Formatting:
- Use formatting from .clang-format(in VS code ctrl + shift + i)
-
Error Handling:
- Always handle errors gracefully. Use exceptions where appropriate.
- Use descriptive error messages for better debugging and maintenance.
-
Memory Management:
- Prefer smart pointers (e.g.,
std::unique_ptr
,std::shared_ptr
) over raw pointers whenever possible. - Use RAII (Resource Acquisition Is Initialization) principle for resource management.
- Prefer smart pointers (e.g.,
-
Const-Correctness:
- Utilize
const
keyword appropriately to indicate immutability where applicable. - Prefer
const
references over pass-by-value for function parameters when the parameter won't be modified.
- Utilize
-
Code Reusability and Modularity:
- Write modular and reusable code.
- Break down complex functionalities into smaller, more manageable functions or classes.
-
Standard Library Usage:
- Utilize features provided by the C++ Standard Library whenever possible rather than reinventing the wheel.
-
Naming Conventions for Constants:
- Constants should be all uppercase with underscores separating words. For example:
const int MAX_SIZE = 100;
.
- Constants should be all uppercase with underscores separating words. For example:
-
File Organization:
- Each class declaration and its implementation should reside in separate header (.h) and source (.cpp) files, respectively.
- Group related header files in a separate directory (e.g.,
include
).
-
Version Control:
- Utilize version control systems (e.g., Git) effectively.
- Commit regularly with meaningful commit messages.
- Please squash your commits before you push it to remote repository
-
Testing:
- Write comprehensive unit tests to validate the correctness of the code.
- Test edge cases and unexpected inputs.
forked from coders-school/simple-text-communicator
-
Notifications
You must be signed in to change notification settings - Fork 0
JDemski/simple-text-communicator
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- QML 48.6%
- C++ 29.8%
- CMake 21.6%