C++ Best Practices : Naming Conventions

There are various popular naming conventions which are common among various languages, the relevance of these conventions comes from , the legacy which they hold and other factors like readability, purpose, programming cababilities, for example , we mo…


This content originally appeared on DEV Community and was authored by Parth Kamal

There are various popular naming conventions which are common among various languages, the relevance of these conventions comes from , the legacy which they hold and other factors like readability, purpose, programming cababilities, for example , we most follow camelcase for java, for c++ which comes with great capabilities, we use lowercase with underscores, most of the time.

why important ?

there are two main advantage which comes with this,

  1. consistency in the code base - especially you are contributing open source.
  2. readability - with common coding style and following it becomes easy for you to understand the code.

C++ naming convention -

  1. Variables - lowercase with underscores,
  2. Functions - lower case with underscores,
  3. Classes - Pascal case
  4. Constants - uppercase with underscores.

In gist : following the best practices , and guidelines, make the job easier for everyone.


This content originally appeared on DEV Community and was authored by Parth Kamal


Print Share Comment Cite Upload Translate Updates
APA

Parth Kamal | Sciencx (2024-06-16T19:17:23+00:00) C++ Best Practices : Naming Conventions. Retrieved from https://www.scien.cx/2024/06/16/c-best-practices-naming-conventions/

MLA
" » C++ Best Practices : Naming Conventions." Parth Kamal | Sciencx - Sunday June 16, 2024, https://www.scien.cx/2024/06/16/c-best-practices-naming-conventions/
HARVARD
Parth Kamal | Sciencx Sunday June 16, 2024 » C++ Best Practices : Naming Conventions., viewed ,<https://www.scien.cx/2024/06/16/c-best-practices-naming-conventions/>
VANCOUVER
Parth Kamal | Sciencx - » C++ Best Practices : Naming Conventions. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/06/16/c-best-practices-naming-conventions/
CHICAGO
" » C++ Best Practices : Naming Conventions." Parth Kamal | Sciencx - Accessed . https://www.scien.cx/2024/06/16/c-best-practices-naming-conventions/
IEEE
" » C++ Best Practices : Naming Conventions." Parth Kamal | Sciencx [Online]. Available: https://www.scien.cx/2024/06/16/c-best-practices-naming-conventions/. [Accessed: ]
rf:citation
» C++ Best Practices : Naming Conventions | Parth Kamal | Sciencx | https://www.scien.cx/2024/06/16/c-best-practices-naming-conventions/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.