DEV Community

Parth Kamal
Parth Kamal

Posted on

3

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 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.

💡 One last tip before you go

Tired of spending so much on your side projects? 🤔

We have created a membership program that helps cap your costs so you can build and experiment for less. And we currently have early-bird pricing which makes it an even better value! 🐥

Check out DEV++

Top comments (2)

Collapse
 
manvi_kamal_8a07e69a78de8 profile image
Manvi Kamal

Nice 👍

Collapse
 
parthkamal profile image
Parth Kamal

thanks manvi

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay