DEV Community

aryan015
aryan015

Posted on

Types of casing in programming

note: for consistancy i will keep the same example.

1. camelCase

//userDate
//firstName
Enter fullscreen mode Exit fullscreen mode

2. snake_case

//user_name
//first_name
Enter fullscreen mode Exit fullscreen mode

3. PascalCase

//UserName
//FirstName
Enter fullscreen mode Exit fullscreen mode

4. kebab-case

This style mostly used as ID name and classes in html.

//user-name
//first-name
Enter fullscreen mode Exit fullscreen mode

my linkedin

Top comments (5)

Collapse
ย 
jonrandy profile image
Jon Randy ๐ŸŽ–๏ธ โ€ข

kebab-case

Collapse
ย 
aryan015 profile image
aryan015 โ€ข

though most popular programming languages does not allow dashing in naming

Collapse
ย 
jonrandy profile image
Jon Randy ๐ŸŽ–๏ธ โ€ข

That's correct. It's most often used in CSS class names, and HTML attribute names

Thread Thread
ย 
aryan015 profile image
aryan015 โ€ข

ok corrected.

Collapse
ย 
aryan015 profile image
aryan015 โ€ข

ok i will remember that ty