DEV Community

Babak Karimi Asl
Babak Karimi Asl

Posted on

4 2

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 .

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

If this article connected with you, consider tapping ❤️ or leaving a brief comment to share your thoughts!

Okay