DEV Community

Cover image for 9 rules for writing (better?) code

9 rules for writing (better?) code

Jimmy Klein on February 28, 2024

Like many developers, I like learning new things. And one thing that interests me a lot is code quality and how to write code. In order to practic...
Collapse
 
fpaghar profile image
Fatemeh Paghar

The article underscores the importance of maintaining consistency across development teams by following standardized coding practices. Consistent coding styles and adherence to the outlined rules contribute to better collaboration and understanding among team members. When everyone follows the same set of principles, it becomes easier to review, contribute, and maintain code collectively. This consistency not only enhances code quality but also fosters a cohesive and efficient development environment. Emphasizing team-wide adherence to these principles can lead to a smoother and more productive coding experience for everyone involved. πŸ‘₯πŸ’»

Collapse
 
klnjmm profile image
Jimmy Klein

I agree with you πŸ‘ It is important to follow coding standards across a team.

But it can be complicated to go to these level of details. Each developers has its own habits (he can share some of them with the other members of his team).

Collapse
 
altesack profile image
Marat Latypov

Great article!
Sadly I have to use setters/getters every single day. In Symfony world it's highly hard to avoid it

Collapse
 
klnjmm profile image
Jimmy Klein

Thank you πŸ™ !
Have you ever try to don't generate getter and setter in your doctrine entity ?
I would say that it is not mandatory.
But it is a difficult rule, we are so used to have getter and setter.

Collapse
 
altesack profile image
Marat Latypov

Yes, I know Doctrine doesn't require it. I'm pretty sure some Symfony package does Don't remember exactly... Forms maybe ...

I have to try it on some home project