How to Name Eveything — for developers — part 1

Nikolaos Margaris
2 min readJul 30, 2020

One of the most difficult things every developer has to do is, naming anything that is not of a reserved programming language specific keyword i.e a variable, a function, a class, an interface, a module, a file, a library and the list goes on …

Strange as it may sound, it is easier than we may think.

The rules are simple

We all could speed up the 'naming' process and be relieved from this headache once and for all.

You might wonder:

What could I do to just name this thing and move on with my piece of code ?

Well, if you need some guidance then you could do the following.

Respect the Team

Every team should, and I would rather say ‘must’, establish some kind of development guidelines or best practices so that everyone should follow.

Naming conventions are a good example (pascal case, camel case, snake case, kebab case e.t.c).

There is nothing wrong or right here. Only Do or Do Not.

Name prefixes should be agreed or not exist.

Name suffixes should be agreed or not exist.

… you get the point ;)

Most importantly, whenever there isn’t a rule, then this is the perfect time for good collaboration and discussion. Agree with your team on naming rules and next time a proper name will probably come naturally to your mind.

Set up a goal

You should always question yourself:

What is the reason for creating a variable?

Is it perhaps to …

  1. assign the result of a calculation?

2. assign an Object reference?

3. provide it as an input agument to a function?

Psst: about reduce

4. declare a constant value?

… to be continued in part 2

--

--

Nikolaos Margaris

FrontEnd Technical Lead, all-around player, experienced but also out-of-the-box thinker. ‘New’ has always something to give and ‘old’ always provides the basis.