DEV Community

Cover image for Programming Case Types !Explained
Mahesh Sv
Mahesh Sv

Posted on • Originally published at Medium on

1

Programming Case Types !Explained

No matter how well you are at Coding. Name Conventions can be a pain in the A**.

In the programming world, languages use some specific pattern in naming variables, functions

Jeff Atwood (Stack Overflow Co-founder ) says

“Naming Conventions is one of the two hard things in Computer Science”

Why Case Type?

we all use naming to things we define in the program from variables to functions. In Programming, if you want to name a thing with more than one word you can’t name it with added space or without space directly some times it might mislead the code reviewers/ code readers like therapists can sound like therapists or the rapists.

Here comes the Case Type with a solution where it has different ways to name a thing that has more than one word.

Today, we will look into the Different Case Types in the Programming World

1.camelCase

Camel Case is actually inspired by the animal “Camel”. Where the first word will be small letters and from the second word, the first character will be capitalized like camelCase.

Some of the big companies also inspired by this. Example like iPhone, eBay

Generally, Camel Case is used for Variable Naming

2.snake_case

Snake Case is naming with words separated by _ ( underscore ) and all small letters

Generally, Snake Case is used for Variable Naming

Ex :- snake_case, new_word

3.kebab-case

Kebab Case is naming with words separated by — ( hyphen ) with all small letters

Generally, Kebab Case is used for CSS naming

Ex :- new-word, kebab-case

4.PascalCase

Pascal Case is naming with the First letter of each word is Capitalized.

Generally, Pascal Case is used for Class Naming

Ex :- NewWord, PascalCase

5.MACRO_CASE

Macro case is naming with all letters Capitalized but the words are joined with _ ( underscore)

Generally, Macro case is used for Preprocessor and constants

Ex :- NEW_WORD, MACRO_CASE

6.Train-Case

Train Case is naming with the first character of every word of the name is Capitalised and words are connected with — ( hyphen ).

Ex :- New-Word, Train-Case


Billboard image

Monitoring as code

With Checkly, you can use Playwright tests and Javascript to monitor end-to-end scenarios in your NextJS, Astro, Remix, or other application.

Get started now!

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay