loading...
Cover image for CASE STYLES IN PROGRAMMING !

CASE STYLES IN PROGRAMMING !

the_unconventional_coder profile image ABHINAVA GHOSH ・1 min read

have you ever came across words like camel case ,snake case and wondered what actually they mean? 😕

In this Article I will be elaborating about the different case styles available in computer programming.

The most popular ways to combine words into a single string:


  • 🐫 camelCase: Camel case combines words by capitalizing all words following the first word and removing the space, as follows:

Raw:

the unconventional coder

Camel Case:

theUnconventionalCoder
----👆--------------👆

Use: Mainly in variable declaration.


  • Pascal Case : Pascal case combines words by capitalizing all words (even the first word) and removing the space, as follows:

Raw:

the unconventional coder

Pascal Case:

TheUnconventionalCoder

Use: Declaring classes


  • 🐍 Snake Case : Snake case combines words by replacing each space with an underscore (_) and, in the all caps version, all letters are capitalized, as follows:

Raw:

the unconventional coder

Snake Case:

the_unconventional_coder

Use : Used for naming constants.


  • Kebab Case : Kebab case combines words by replacing each space with a dash (-), as follows:

Raw:

the unconventional coder

Kebab Case:

the-unconventional-coder

Use : Used for naming URL's.


reference

Please leave a ❤️ if you liked this article!
And feel free to leave any suggestions for me in the discussions panel.

Posted on by:

the_unconventional_coder profile

ABHINAVA GHOSH

@the_unconventional_coder

I am a final-year Computer Science and Engineering student at KIIT UNIVERSITY. My areas of interest are mainly Android App development ,Web Development ,Networking and Competitive Programming.

Discussion

markdown guide
 

I just recently had to deal with this when generating classes for x11-client. The guava library has a class called CaseFormat which can perform conversions between the different formats programatically.

I used it here.

 

Note the kebab is a meal of meat especially cut into small pieces and joined by a tiny stick of wood or metal.
That's why that way of joining strings is called so, the hyphen stands for the empty space between the pieces of meat.

 

very practical example i must agree!