Keep code clean and consistent with established project conventions. This includes: 1. Follow existing formatting style in files: ```cpp // Follow Allman style if file uses it
Keep code clean and consistent with established project conventions. This includes:
// Follow Allman style if file uses it
void function()
{
if (condition)
{
statement;
}
}
Avoid using namespace
declarations as they pollute the namespace, even if the header is not included directly.
// Use feature macros if code might be needed later #ifdef EXPERIMENTAL_FEATURE for (int i1 = 0; i1 < STEP_SIZE; ++i1) { if (ptr + i1 < n1) { matOut[ptr + i1] = matA[ptr1 + i1] + matB[ptr2 + i1]; } } #endif ```
Prefer C++ templates over complex multi-line macros for better debugging and type safety.
Use standard type names rather than shortcuts (e.g., unsigned char
instead of uchar
).
Consistency in code style significantly improves readability and maintainability while reducing review friction.
Enter the URL of a public GitHub repository