Tech Lead/Team Lead. Senior WebDev.
Intermediate Grade on Computer Systems-
High Grade on Web Application Development-
MBA (+Marketing+HHRR).
Studied a bit of law, economics and design
Location
Spain
Education
Higher Level Education Certificate on Web Application Development
A style guide contains general rules about how to write code. They could include a better way to indent, where to place a function etc.
I'd better define them like that:
Style guides contain general rules about how the code should look like.
Those rules are opinionated with few to zero basis on anything. They are not meant to solve any issue other than having a project's entire codebase looking the same way, thus reducing the fatigue of devs involved on it.
As personal opinion on that, you should just stick to what the project states for the reason above, use Prettier (VSCode extension) with format on save enabled to avoid having to learn the style guides on each project you jump into, thus being released of that styling job which can be automated easily.
This way you code once with your own style and it gets formatted when saving according to the defined styles (usually in a Prettier.rc or an ESLint.rc file).
i.e. If your opinion is that using tabs is better than using spaces then use tabs always, if the project has spaces in the config, prettier will handle that for you. In your own projects you can set it to tabs and code the same way.
Didn't bring a linter but a lantern π€·π½ββοΈπ
Gloria Asuquo is a Developer Advocateπ₯ and Front-end developer. She is passionate about sharing her knowledge of open source, web development and encourages the adoption of tech as a career.
I'd better define them like that:
As personal opinion on that, you should just stick to what the project states for the reason above, use Prettier (VSCode extension) with format on save enabled to avoid having to learn the style guides on each project you jump into, thus being released of that styling job which can be automated easily.
This way you code once with your own style and it gets formatted when saving according to the defined styles (usually in a Prettier.rc or an ESLint.rc file).
i.e. If your opinion is that using tabs is better than using spaces then use tabs always, if the project has spaces in the config, prettier will handle that for you. In your own projects you can set it to tabs and code the same way.
Didn't bring a linter but a lantern π€·π½ββοΈπ
Thank you for sharing