A Short Guide to Component Naming

by İsmail Arılık, Software Engineer

1. Brevity is Key

A component’s name identifies it, so it should be understandable. One approach is to use elements within the component’s user interface.

Do you have a button that allows you to log in after entering your username and password? Call it "btnLogin". What about a modal that opens before adding items to your to-do list? How about "modalNewToDo"? This way, when you look at a piece of code, you’ll be able to understand its meaning more quickly and save time.

2. Rank High in Search

When working in large repos with lots of collaborators, it’s important that your component ranks high when people search for anything.

One way to attract attention is to include relevant keywords in your component’s metadata. You might consider using these words in your component’s name, but this isn’t a good idea; component names should be easy to read and understand.

3. Do not Mix Languages

Decide as a team from the outset which language you’ll use for your naming, and stick to that decision. If you decide on English, use English everywhere. If you decide on German, use German everywhere.

It’s common practice to use English naming for software projects. However, if you’re working on a local application with a team where everyone speaks, for example, French, using French might also be a good idea. This way, team members can more easily understand the code.

More articles

Why You Should Market Your SaaS With an Eye-catching Website

If you’ve just launched your groundbreaking new idea, the next step is marketing it. Your product or service is only as special as the first impression users make of it. Make your project special with a special marketing website.

Read more

Why You Should Market and Present Your Podcast With an Eye-catching Website

You don’t have to bother with Spotify, Apple Podcast, or YouTube for your podcast. The requirements for a podcast are minimal, and a simple website dedicated to podcasting will do the trick.

Read more

Tell us about your project

Our office

  • Technopark
    Hüseyin Yılmaz st.
    20160, Denizli, Turkey