THOUGHT LEADERSHIP ARTICLE
The Coding conventions: explanations, rules, guidelines…
Linh, Senior iOS Developer, discusses about the use and best practices of the Coding conventions. Discover his article.
Code style, Programming style, Coding conventions, Code guidelines, Coding standards… — you must have heard or seen these words plenty of times and since years. Rules, guidelines, best practices… grouped together for the ultimate goal of helping the team build a professional and well-readable code base. That sounds promising, right? I myself find it not easy, however, to apply fully a code style in a real-life project.
Coding conventions are really useful and important
We developers try our best to make the code work, that is without question the highest priority for us. Code optimization and styling are the remaining steps before we can consider the task done. Without these two, it is likely that we will ship shitty code. All team members (including our future selves, how ironic!) and newcomers as well would then suffer the consequences.
I myself was in a such situation. Some years ago, I was placed in an old project to do some bug fixes and to add some new features. Just a few hours after checking out the code, I wanted to throw it right away! The app had been developed by four or five developers in several phases. Apparently, none of them cared about refactoring and naming. What they left me was spaghetti code in distinctive programming styles, plus hundreds of warnings. Since then I have been paying much more attention to the code readability in my projects, believing that would improve my code quality.
Good naming, good use of the language’s features help to reduce the amount of code to read and understand code better. A unique code style among team members makes the project code "clean"-er, hence allows one to read others’ code more easily and facilitates new member integration.