How important is it to make conventions ?

September 11th, 2020 - ☕️ 4 min read

For the past 2 years, I've been developing with the same team. And during those two years, we've spent a lot of time setting up conventions. It can be Code conventions, git conventions, or just a kind of a charter of good practices.

When I began this job, I couldn't understand why it was so important to make those conventions and to stick to them. For me, as a newbie, it was a complete waste of time.

Why would you spend so much time writing a readme? Why would you spend so much time to code like the other devs? why is it so f**king important to remove this semicolon? To add your PHP doc? To add spaces before you write the parameters of your function?

And I have to admit it, I understand why a lot of people think that way and why they are seeing that as a huuuuge waste of time.

But one week ago, things have changed in my mind.

I had a new job and a new team.

So as I have spent 2 years on the extreme side of code trying to make every single line as clean as possible and stick to already set guidelines, I was thinking that I will have to learn completely different guidelines and conventions, but I was wrong.

My first tasks were to add features on an old project that haven't change a lot since its creation 3 years ago. But as devs, we all know things kind of project that seems like a "no-rule zone".

But before that day, I wasn't realizing how frustrating it can be to have to work on this kind of project when you are new on it.

I realize how important it is to have rules and guidelines that you must stick to when you code. However, I do think that you can't realize that before you had to work on this kind of "no-rule-zone-projects".

I also have to say that it was highly exciting because I had the permission to demonstrate to my colleagues the power of conventions and what I've learned in the past 2 years.

But as everyone has a different vision of what is perfect and what is not, you have to set rules with your team!

These rules aren't necessarily fixed, you can change them through days, weeks, years. The only important thing is to have everyone contributing!

Every developer has a different approach to his work. And it is extremely rare to find someone that has the same one that you. And by "rare" I mean "impossible".

If you want a well running and beautiful project, you have to discuss with all the members of your team and try to find, together, a perfect way of doing what you want to do. Everyone has good ideas. The perfection that I am talking about is the moment when you find rules that suits the need of all your team.

Even if it can seem like a loss of time when you are starting your project, it is not. You will earn a lot of time when you will return on this project after a 3 months break or when you will have to add a feature to an old piece of code.

We all know that refactor isn't the most pleasable thing to do in our job (even if I like it a lot).

And when a new team member will start to work on this project. He will be very happy to have rules and conventions that will guide him in his work.

As I love clean code, I will soon upload articles on examples of guidelines that you can follow if you want to start to make beautiful and clean code.

However, here is a list of incredible links that I use, and that you can already read and try. (you will see, it is magic !!!!)

- https://github.com/airbnb/javascript -> Airbnb's javascript guidelines

- https://guides.github.com/features/wikis/ -> Github guide on how to make a perfect readme

- https://buzut.net/cours/versioning-avec-git/bien-nommer-ses-commits -> A perfect commit guide ( in french )

- https://blog.trello.com/trello-board-best-practices -> An amazing guide to master Trello boards

See you soon and keep coding (well)!

Thomas.