When you start your business or simply working as a tech team, you always have a goal in mind, something great to achieve. Most of the time, the projects I saw failed did so not because they were bad, but because the team responsible for it was not able to get mature enough to everything would go smooth. In this article, I’ll try to describe my path to the maturity.
First thing first, you need to have your code clean. I personnaly always follow this rule :
I code the want I would want to read anyone’s code, and I code so that anyone would read my code
You could have a nice coding style, you’d never escape from mistakes. This best way to be extra careful is to version your code. This is not something I should try to convince you with, so go tackle it ! We use git through Github.
We humans do mistake, better get along with it, there is nothing you could do. It is the same with coding, you could be any sort of coding genius, you’d still do silly mistakes sometimes (or you are a robot). The best way to prevent so is to test you code in a smart way :
- Code coverage should be a goal, something you thrive for
- Try not to be stupid with code coverage : Having dumb tests just to achieve the right percentage is just stupid
I know it could get frustrating, and at the beginning you’d probably spend more time implementing test than coding, but believe me, when your project will be running in production, you’ll thank the tests for not having any regression from one version to the other.
That being said, you should now have quite a nice pipepline : You code is linted and tested, and you can follow your version. But as your project get bigger, all those tasks take you forever just to get one new version in production. This is when Continuous Integration comes ! Using tools such as circleci, as we do in Umanlife, will allow you to automate most of this, leaving you with the important job. I always follow this rule :
If it takes you more than 90 seconds and you need to do it more than once, automate it !
Secure and log
The last chapter of this article will be about security : For me logs are part of a secure system, they should allow you to spot directly what went wrong and quickly react. They are essential to your project. Here in Umanlife, when use a MQTT broker on which when send all sorts of events. Those events are then computed and analysed so we can give the best experience to our consumers.
Of course you won’t achieve maturity just by following all those rules, but I believe those are a nice first step. I’ll try to give you the rest in a next article.