Use GitHub Copilot to Match the Style Conventions of a Repository
Crafting code can be considered a form of art. It is a way to express yourself and your ideas, writing elegant solutions to solve people’s needs.
We, as developers, tend to be quite opinionated on how to solve a specific problem. We often have our own way of doing things. This isn’t necessarily bad, as sharing different points of view helps getting the best out of each one of them and also identifies potential flaws and pitfalls.
The majority of the time you will not be by yourself. Coding is a social and collaborative activity where many individuals cooperate together to achieve a common goal, be it the next AI tool or a successful ecommerce platform.
The Problem
Even though each of us should have freedom to determine how a specific problem is solved, as long as technical and business requirements are met, there is still one more nuisance to take into account: the style of the code.
The reason for that is quite simple: code is not meant to be written but to be read.
At some point, someone will have to read your code in order to fix a bug or add a new feature and when it’s you reading someone else’s code, you will want to understand it as quickly as possible. This also applies when getting back to our own code after a few months or even years, which means solo projects are not an exception.
There might be a dozen different (and some of them pretty valid) ...
Get Use GitHub Copilot to Match the Style Conventions of a Repository now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.