<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ Naming Conventions - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ Naming Conventions - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Tue, 19 May 2026 10:29:22 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/naming-conventions/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ Programming Naming Conventions – Camel, Snake, Kebab, and Pascal Case Explained ]]>
                </title>
                <description>
                    <![CDATA[ If you've been programming for a while, you may have heard the words "camel case" or "pascal case". And maybe you're wondering what those terms mean. Well, let me explain. What are Naming Conventions in Programming? Apart from the hard and fast rules... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/programming-naming-conventions-explained/</link>
                <guid isPermaLink="false">66b0ab435e73cf343a5cc05d</guid>
                
                    <category>
                        <![CDATA[ Naming Conventions ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Farhan Hasin Chowdhury ]]>
                </dc:creator>
                <pubDate>Mon, 22 Aug 2022 15:16:55 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/08/Programming-Naming-Conventions-Explained.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you've been programming for a while, you may have heard the words "camel case" or "pascal case". And maybe you're wondering what those terms mean. Well, let me explain.</p>
<h2 id="heading-what-are-naming-conventions-in-programming">What are Naming Conventions in Programming?</h2>
<p>Apart from the hard and fast rules that we get with every programming language, there are also conventions. These are sets of standards that are generally accepted by the majority of developers out there.</p>
<p>Among all sorts of conventions, naming conventions are some of the most common. Because as programmers, we name a lot of things. Such as variables, functions, classes, methods, interfaces and so on.</p>
<p>Throughout the years, developers have used different case types to name different entities in their code. And four of them have proved to be the most popular ones. They are:</p>
<ul>
<li><a class="post-section-overview" href="#heading-what-is-camel-case">Camel Case</a></li>
<li><a class="post-section-overview" href="#heading-what-is-snake-case">Snake Case</a></li>
<li><a class="post-section-overview" href="#heading-what-is-kebab-case">Kebab Case</a></li>
<li><a class="post-section-overview" href="#heading-what-is-pascal-case">Pascal Case</a></li>
</ul>
<p>Let's have a look at some examples so you can see how these work, shall we?</p>
<h2 id="heading-what-is-camel-case">What is Camel Case?</h2>
<p>In camel case, you start a name with a small letter. If the name has multiple words, the later words will start with a capital letter: </p>
<p>Here are some examples of camel case: <code>firstName</code> and <code>lastName</code>.</p>
<h2 id="heading-what-is-snake-case">What is Snake Case?</h2>
<p>Like in camel case, you start the name with a small letter in snake case. If the name has multiple words, the later words will start with small letters and you use a underscore (_) to separate the words. </p>
<p>Here are some examples of snake case: <code>first_name</code> and <code>last_name</code>.</p>
<h2 id="heading-what-is-kebab-case">What is Kebab Case?</h2>
<p>Kebab case is similar to snake case, but you use a hyphen (-) instead of an underscore (_) to separate the words.</p>
<p>Here are some examples of kebab case: <code>first-name</code> and <code>last-name</code>.</p>
<h2 id="heading-what-is-pascal-case">What is Pascal Case?</h2>
<p>Unlike the previous examples, names in pascal case start with a capital letter. In case of the names with multiple words, all words will start with capital letters.</p>
<p>Here are some examples of pascal case: <code>FirstName</code> and <code>LastName</code>.</p>
<h2 id="heading-when-to-use-each-naming-convention">When to Use Each Naming Convention</h2>
<p>Now, based on the language you're working on and what you're naming, the preferred case type can change. </p>
<p>For example, according to the <a target="_blank" href="https://peps.python.org/pep-0008/">PEP 8 – Style Guide for Python Code</a>, variable and function names should use snake case:</p>
<pre><code class="lang-python">user_name = <span class="hljs-string">'Farhan'</span>

<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">reverse_name</span>(<span class="hljs-params">name</span>):</span>
    <span class="hljs-keyword">return</span> name[::<span class="hljs-number">-1</span>]
</code></pre>
<p>Let's take a look at JavaScript now. According to the <a target="_blank" href="https://github.com/airbnb/javascript">Airbnb JavaScript Style Guide</a>, variable and function names should use camel case:</p>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> userName = <span class="hljs-string">"Farhan"</span>;

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">reverseName</span>(<span class="hljs-params">name</span>) </span>{
     <span class="hljs-keyword">return</span> name.split(<span class="hljs-string">""</span>).reverse().join(<span class="hljs-string">""</span>);
}
</code></pre>
<p>Although Python and JavaScript require you to follow different conventions when you're naming variables and functions, both languages require you to use pascal case when naming a class.</p>
<p>Style guides are available for more or less all popular programming languages. Here are some of the most commonly used:</p>
<ul>
<li>Python - <a target="_blank" href="https://peps.python.org/pep-0008/">PEP 8 – Style Guide for Python Code</a></li>
<li>JavaScript - <a target="_blank" href="https://github.com/airbnb/javascript">Airbnb JavaScript Style Guide</a></li>
<li>Java - <a target="_blank" href="https://www.cs.cornell.edu/courses/JavaAndDS/JavaStyle.html">Java style guide</a></li>
<li>C# - <a target="_blank" href="https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions">C# Coding Convention</a></li>
<li>Go - <a target="_blank" href="https://github.com/uber-go/guide/blob/master/style.md">Uber Go Style Guide</a></li>
<li>C++ - <a target="_blank" href="https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines">C++ Core Guidelines</a></li>
<li>PHP - <a target="_blank" href="https://www.php-fig.org/psr/psr-12/">PSR-12: Extended Coding Style</a></li>
</ul>
<p>These are some of the guides I've referred to in the past. There are other guides as well. Feel free to do your own research and pick the one you like. Just make sure the guide you're following is actually well regarded by the developer community.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>These are the most popular naming conventions that you should be aware of. If you'd like to learn more about the different naming conventions, you can read through the style guide for the language you're using.</p>
<p>Knowing the conventions of the language you're learning is important. While not following conventions will not break your code, it'll make it less consistent and harder to work with.</p>
<p>Following these simple conventions, on the other hand, will make your code a lot more readable and easier to work with. So do yourself and others a favor and follow the conventions.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ JavaScript naming conventions: do’s and don’ts ]]>
                </title>
                <description>
                    <![CDATA[ I find it amazing how many different meanings we can get from less than 30 characters. I’m talking about the alphabet with some well-placed punctuation, of course. From a love story to a computer prog ]]>
                </description>
                <link>https://www.freecodecamp.org/news/javascript-naming-conventions-dos-and-don-ts-99c0e2fdd78a/</link>
                <guid isPermaLink="false">66d4617b33b83c4378a5184f</guid>
                
                    <category>
                        <![CDATA[ best practices ]]>
                    </category>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Naming Conventions ]]>
                    </category>
                
                    <category>
                        <![CDATA[ General Programming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Brandon Wozniewicz ]]>
                </dc:creator>
                <pubDate>Wed, 06 Mar 2019 15:51:47 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*xiJRjtRIJoosH5sI_fMdgQ.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>I find it amazing how many different meanings we can get from less than 30 characters. I’m talking about the alphabet with some well-placed punctuation, of course. From a love story to a computer program, writing has allowed us to create extraordinarily different worlds. And language, in general, provides a framework in which we can hang a stream of ideas.</p>
<p>Most programming languages seem to have very strict standards — certain terms have to be used in certain places. But one area where there is an enormous amount of freedom is how we name those terms.</p>
<p>Take this simple program which creates a sentence from an array of words, adds a punctuation mark, and logs it to the console:</p>
<img src="https://cdn-media-1.freecodecamp.org/images/dRQKspy4V21MPbO8LW1bFXtIOwTMvnNeRp5i" alt="Image" width="800" height="278" loading="lazy">

<p>Nothing too special, right? But what you may not have considered is how many <em>terms</em> you were responsible to name.</p>
<p>There are 23 words (not including hard-coded values) in the above program. We controlled the names of 14 of those words. That is more than 60% of what was typed, was our responsibility to name!</p>
<img src="https://cdn-media-1.freecodecamp.org/images/rQnG17-jJTsPsKtn0NCIPVD60qKRR8nhHNMX" alt="Image" width="800" height="278" loading="lazy">

<p><em>You are responsible for the majority of the names in your program</em></p>
<p>Whether you are building an enterprise application or a simple <em>Hello, World,</em> you want your program to read like a Times Bestseller, not a Mad Libs workbook.</p>
<p>This is <em>not</em> a manifesto on how to structure an entire JavaScript application, but rather a chapter on how to choose names for those things in which you have the freedom to do so. I’ve included the various references at the bottom if you want to learn more. One last thing, the key takeaway of all of our conventions and standards is this:</p>
<blockquote>
<p><em>Most of these conventions are not for you today, but instead, for you and the people reading your code tomorrow.</em></p>
</blockquote>
<img src="https://cdn-media-1.freecodecamp.org/images/-Se0xzoDIzsROxX4YKSWtQuD6Z7Mq4UbT-ub" alt="Image" width="800" height="4440" loading="lazy">

<h4 id="heading-references-and-continued-learning">References and continued learning</h4>
<ol>
<li><p><a href="https://www.amazon.com/gp/product/0132350882/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0132350882&amp;linkCode=as2&amp;tag=brandonwoz-20&amp;linkId=8af093cb2b8d9a87993f285341ff015a">“Clean Code” by Robert C. Martin</a> — <em>A great read for all languages. It goes beyond naming conventions and proposes the entire structure of your program. The examples are in Java, but the principles apply to JavaScript.</em></p>
</li>
<li><p><a href="https://github.com/ryanmcdermott/clean-code-javascript">“Clean Code JavaScript” by Ryan Mcdermott</a> — <em>The above book, but remade for JavaScript. It is available online and is free.</em></p>
</li>
<li><p><a href="https://github.com/airbnb/javascript">Airbnb JavaScript Style Guide</a> — <em>Possibly the most comprehensive style guide for JavaScript. It contains not only the what, but also the why. (If you’re on a small device, you may need to click on “view all readme” to see the entire document).</em></p>
</li>
<li><p><a href="https://www.w3schools.com/js/js_conventions.asp">W3 JavaScript Style Guide</a> — A s_hort and concise guide._</p>
</li>
<li><p><a href="https://google.github.io/styleguide/jsguide.html">Google’s ES6 Style Guide</a> — <em>Google’s style guide for JavaScript.</em></p>
</li>
</ol>
<p>Thanks for reading!</p>
<p>Found this helpful? I write about practical automation, productivity systems, and building smarter workflows — without the jargon. Visit me at <a href="http://brandonwoz.com">brandonwoz.com</a>.</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
