Blog articles

Programming naming conventions (explained by a snake)

January 15, 2023

Have you ever had the following burning questions:

- What are all the different naming conventions?

- What is each naming convention commonly used for?

- What does my favorite naming convention say about me, personally?

Yeah, me neither, yet here we are! In this article we answer each of these questions, assisted by our handy companion, Snek the snake.

A snake wrapped around a browser window. It says my fav languages are python and anaconda.

Snek: I tried out Cobra, but some guy kept shouting ‘Strike first. Strike hard. No mercy.’

Table of contents

A quick primer: What are naming conventions?

As a programmer, you’ve got to name a lot of things, like variables, functions, classes, and methods. Reliability is important, so naming conventions are an agreed upon way of naming these things the same way each time. This improves the readability of your code, which is vital when you’re working in a team.

A list of programming naming conventions

There are a lot of naming conventions, so here are the most popular (and some extras). I’ll let Snek take it away from here….


1. Snake Case

watch_out_i_bite snake_case

Snek: If you get bit eight times, you get one byte in exchange. 

snake_case is a variable naming convention where each word is in lower case, and separated by underscores. It is also known as pothole_case.

Examples: last_name, annual_earnings, total_snakes_found.

Commonly used in: Python, Ruby, C/C++ standard libraries, Wordpress, database table and column names.

If it’s your favorite case, what it says about you: You’d happily usher in the next age of AI domination if they’d help you organize your sock drawer in nice, segmented sections.


2. Screaming Snake Case

watch_out_i_bite snake_case

Snek: IT’S A STAND-UP MEETING, NOT A STAND-ON MEETING!

SCREAMING_SNAKE_CASE is a variable naming convention where each word is in upper case, and separated by underscores. It is also known as MACRO_CASE or CONSTANT_CASE.

Examples: FIRST_NAME, TOTAL_SCORE, SNAKE_PAIN_THRESHOLD.

Commonly used in: Naming constants in things like C, Javascript, and Java.

If it’s your favorite case, what it says about you: You’re as unalterable as a rock, hate risky errors, and listen to loud music while VSC is set to “darker than dark” mode.


3. Lowercase

watch_out_i_bite snake_case

Snek: BOOT FAILURE. Press Ctrl+Alt+Del to restart, or visit your local pet store.

lowercase is a variable naming convention where each word is in lowercase and they are not separated by spaces, dashes, or underscores. It is also known as flatcase.

Examples: middlename, firstlogindate, snakessteppedon.

Commonly used in: HTML elements and attributes.

If it’s your favorite case, what it says about you: You do things your own way! After all, you know what your code means. That’s why you don’t write comments in it.


4. Uppercase

watch_out_i_bite snake_case

Snek: Slither has really gone downhill after a muskrat took over. It’s messing up the whole ecosystem.

UPPERCASE is a variable naming convention where each word is in uppercase and they are not separated by spaces, dashes, or underscores.

Examples: DATEOFBIRTH, STARTINGHP, MAXTWEETSPERMINUTE.

Commonly used in: Naming constants, ex-presidential tweets.

If it’s your favorite case, what it says about you: You don’t know how to turn off your caps lock, probably because you hit your keyboard after your last compilation error.


5. Camel case

watch_out_i_bite snake_case

Snek: Those boys are always asking me to GIT, but I won’t commit.

camelCase is a variable naming convention where the first word is always in lowercase and every other word starts with a capital letter. The words are also not separated by spaces, dashes, or underscores. It is also known as dromedaryCase.

Examples: firstName, currentAccountBalance, humpsOnAliceTheCamel.

Commonly used in: Pascal, Modula, .NET, JavaScript and Java instance and local variable names. JSON element names.

If it’s your favorite case, what it says about you: You own an iPhone, like to shop on eBay, and still remember what your first teacher taught you about naming conventions.


6. Camel snake case

watch_out_i_bite snake_case

Snek: I need a CAML query to define if I am one.

camel_Snake_Case is a variable naming convention where the first word is always in lowercase and every other word has the first letter capitalized. The words are also separated by underscores.

Examples: minutes_Taken, withdrawal_Amount, snakes_Wearing_Blankets.

Commonly used in: Similar use-cases to camelCase.

If it’s your favorite case, what it says about you: You fret about giving people the right directions to find your house, because you don’t want them to get lost. People find your love of best practices both helpful and irritating.


7. Kebab case

watch_out_i_bite snake_case

Snek: Unless you swallow the whole thing, which makes things a whole lot worse.

kebab-case is a variable naming convention where each word is in lower case, and separated by dashes. It is also known as dash-case, list-case, or spinal-case.

Examples: first-name, transactions-made, kebabs-eaten-today.

Commonly used in: COBOL, Lisp, Perl 6, CSS class names, HTML ids, Java and JavaScript REST endpoints.

If it’s your favorite case, what it says about you: You like alternative music over mainstream music, you probably work with websites, and now you’re hungry. Thanks, article.


8. Screaming kebab case

watch_out_i_bite snake_case

Snek: According to my friend Ruby, my Slither account is really off the rails at the moment.

SCREAMING-KEBAB-CASE is a variable naming convention where each word is in uppercase, and separated by dashes. It is also known as MACRO_CASE or CONSTANT_CASE.

Examples: LAST-NAME, TOTAL-PAID, KEBAB-TWEETS-MADE.

Commonly used in: Macros.

If it’s your favorite case, what it says about you: You love reusing things, like copy-pasting the same message to people in personal messages. If you can wear your socks two days in a row because it’s the weekend, you will.


9. Spongebob case

watch_out_i_bite snake_case

Snek: “That’s not even a real case!” “thAtS nOt EvEN a ReAl caSe!”

spOngeBoB_Case is a variable naming convention where the text alternates from upper to lowercase to indicate sarcasm, based on the popular “Mocking SpongeBob” meme. It may or may not include spaces, dashes, or underscores. It is also known as SpongeCase or Mocking Spongebob Case.

Commonly used in: Joke code and insane asylums.

If it’s your favorite case, what it says about you: You’re a Batman villain and you’re waiting for him to figure out your latest plan, so you thought you’d do some learning on the side.


10. Pascal case

watch_out_i_bite snake_case

Snek: My upper-class father worked in Java, so I inherited the wig.

PascalCase is a variable naming convention where the first letter in every word is capitalized and the rest is in lowercase. There are also no gaps between each word. It is also known as UpperCamelCase or StudlyCase.

Examples: FirstName, TotalBalance, WigsWorn.

Commonly used in: Pascal, Modula, .NET, Java classes and enums, and JavaScript classes.

If it’s your favorite case, what it says about you: You’ll put product in your hair, but you still wear a hoodie to work. On the alignment chart, you’re True Neutral.


11. Train case

watch_out_i_bite snake_case

Snek: No, for real, Snakes on a Train is an actual movie. Apparently reviewers said it lacked a lot of bite.

TRAIN-CASE is a variable naming convention where the first letter in every word is capitalized and the rest is in lowercase. Each word is also separated by dashes. It is also known as HTTP-Header-Case.

Commonly used in: Java and JavaScript HTTP headers.

If it’s your favorite case, what it says about you: You’ve got meticulous attention to detail. You’ve probably already picked apart this article while reading it.


12. Pluralsight case

snake holding a trophy

Snek: 100% of snakes who have taken Pluralsight courses approve of Pluralsight courses. That’s a completely real statistic.

Okay, so there’s no such thing as Pluralsight case (it’s shameless self promotion!) But if you do want to learn more about fundamental programming concepts, check out our programming fundamentals course. In this entertaining course, you’ll learn the fundamentals, the essential ideas, and the concepts for success in any programming language.


Going for a particular programming role in the future? Check out to see if you’ve got the skills to succeed at it by doing a free role IQ. You can also do an (equally free) Skill IQ test to check out your individual knowledge and how they stack up to others in the field.