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

3 Lessons We Learned Going Back to the Office

Earlier this year we made the bold decision to make everyone come back to the office after two years working from a dressing table in the corner of their bedroom.

Read more

The Future of Web Development: Our Predictions for 2023

Let’s examine the latest trends in web development and present some of our predictions about them, including how they will shape the industry in the coming year.

Read more

Tell us about your project

Our office

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