DEV Community

Alexey Voinov
Alexey Voinov

Posted on

3

On not-so-smart coding standards

Sometimes bad naming conventions are biting us. Long before I joined the project someone decided that every class should have a 'C' prefix to its name. So, instead of Window we have CWindow etc. And all those reside in files named without the initial 'C'. This rule has a very nice side effect.

Can you guess what class is in the file called Logger.cpp? :)

Top comments (3)

Collapse
 
voins profile image
Alexey Voinov

Yeah, certainly that organisation has a lot to do with a lot of things. :) But someone has to decide to use that particular style in that project. And nobody really can tell me why. I've heard a very nice therm for that: Cargo Cult Programming.

As for scope prefixes, I'm big fan of Uncle Bob's clean code, and usually, I try to write classes and methods so small, you don't need any prefixes to visually separate things. :)

Collapse
 
codemouse92 profile image
Jason C. McDonald

My soul burns!

Warp.dev image

Warp is the #1 coding agent.

Warp outperforms every other coding agent on the market, and gives you full control over which model you use. Get started now for free, or upgrade and unlock 2.5x AI credits on Warp's paid plans.

Download Warp

👋 Kindness is contagious

Explore this practical breakdown on DEV’s open platform, where developers from every background come together to push boundaries. No matter your experience, your viewpoint enriches the conversation.

Dropping a simple “thank you” or question in the comments goes a long way in supporting authors—your feedback helps ideas evolve.

At DEV, shared discovery drives progress and builds lasting bonds. If this post resonated, a quick nod of appreciation can make all the difference.

Okay