DEV Community

[Comment from a deleted post]
Collapse
 
revskill10 profile image
Truong Hoang Dung • Edited

I always try to find a way for composition. I mean, if your code is not compositional, it's not good enough. And always prefer composition to inheritance.

Secondly, try to separate concerns of your code, it makes it easier to find bugs, update or adding feature.

In general, if your code has less moving parts that you have to manage, then all is good.

Collapse
 
realshadow profile image
Lukáš Homza

I agree. However, the question was more in the direction - how do you force them to code like this when they refuse to do on their own and you have to repeat it every day

Collapse
 
revskill10 profile image
Truong Hoang Dung

Ah, i see. In this case, if you have an already-good-to-go architecture, then it's hard to break it with bad code style.
But without any architecture, it's really a hard task to force code style.

You need to find an agreement among devs to find out the good way anyway.