DEV Community

Discussion on: How do you ensure your Team's code is consistent?

Collapse
 
pradeepradyumna profile image
Pradeep Pradyumna • Edited

I would lay down a list of standards that every member of the team should follow before committing the changes to the repository. The list could include stuff like:

  1. Setting naming convention for variables, class, method, etc, so that code written by every member looks the same.
  2. Fixing code alignment
  3. Making the team aware of OOPS and SOLID principles when writing code. This makes a developer think thoroughly what part of the code belongs to what other parts.
  4. Writing simple and readable code segments. Breaking down a complex/ a tall method into simple blocks can enhance readability and avoids potential bugs.
  5. Code review on a timely basis. Making it a practice among team members is important.

Writing clean and consistent code is an art.