DEV Community

Dinesh S
Dinesh S

Posted on

Why do we need coding standards?

Why do we need coding standards?

Many beginner developers ask me why they should worry about coding standards when their code works as expected.

Here are a few important points. ๐Ÿ‘‡

1. Consistency

Using similar coding styles throughout the codebase is a win for everyone on the team. It reduces the time to think & to decide how to name a variable/class/function or how to structure code. Every developer who codes doesn't have to spend time thinking.

2. Maintainability

Codebases are mostly contributed by a lot of developers and that keeps changing. Maintaining a constant standard throughout makes it easy for anyone to get started and contribute without friction. Having a set standard helps to keep code complexity in check.

3. Clean code

The code looks clean. Imagine opening a codebase just to find code written haphazardly. It would be a nightmare to work on such a codebase. This eventually becomes tech debt.

Coding standards that are enforced, have a cleaner codebase than others.

4. Developer sanity

If every developer follows their own standards, the codebase would be a mess. It would be very frustrating for another developer to fix bugs or complete features started by others, because of different coding styles.

5. Reduced development time

When there is a consistent standard, the code is readable and familiar, which saves a lot of time. Developers can start coding right away.

Reviewing Pull Requests becomes easier as well.

Top comments (0)