DEV Community

Babak Karimi Asl
Babak Karimi Asl

Posted on

only one simple rule for clean code

just make sure each one of your files has less than 100 lines of code.

that's it. everything else just falls into place, and your project becomes easier to grow,change and maintain.

have a good day.

Top comments (2)

Collapse
 
kanebarton profile image
Kane Barton

It’s not always that simple. While a useful guide code rot (degradation over time as changes are made) can cause problems. You’d be better off sticking to more established principles like SOLID.

Collapse
 
babakkarimiasl profile image
Babak Karimi Asl

yes this rule is better for startups and fast-paced/side/personal projects where you don't have much time to stick to SOLID neither you see the full picture to provide good abstractions .

but sticking to this one simple rule is easy and it can provide a better future for yourself dealing with the project .