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 a Beauty Center Website Should be Beautiful

Are we overdoing the word “beauty” in the name “beauty center”, or would people who truly want to be “beautiful” actually care about “beauty” on your website? Let's take a look together.

Read more

3 Important Criteria for a Seamless E-commerce Experience

After our e-commerce expansion, we focused on how we should serve our customers. Here are the things we believe are essential for a seamless e-commerce system.

Read more

Tell us about your project

Our office

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