Get started with code cleanup

1. Pick a feature to implement and see which part of code will it deal with. The best time to cleanup a piece of code is when you are adding a feature to that part of the code.

2. Break the code into smaller methods, rename variables to more meaningful names.

3. Is there duplication? Can we extract a common method to remove duplication of logic?

4. Simplify complex conditional statements, break loops into smaller ones.

5. Look for one of these three problems —

  • One class is calling another for everything: The logic needs to be in that class.
  • Too much code in one class: There might be scope for a new domain object.
  • Complex if conditions: Could possibly be solved with polymorphism.

If you liked this article, please share it on social media.

View my courses on Udemy —
Subscribe to us on Linkedin —
View all our Youtube Videos —
Join our Facebook Group —

Subscribe to us on Youtube for an awesome video every Wednesday!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store