From the course: Java Object-Oriented Programming

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Identifying code smells and anti-patterns in OOP code

Identifying code smells and anti-patterns in OOP code - Java Tutorial

From the course: Java Object-Oriented Programming

Identifying code smells and anti-patterns in OOP code

- [Instructor] When used correctly, object-oriented programming or OOP can be a great tool for writing maintainable and efficient code. However, developers may accidentally introduce issues known as code smells. Code smells are indicators or warning signs in your code that suggest potential problems. They do not necessarily indicate a bug, but rather areas where your code could be improved. One example of this is class bloat. Class bloat happens when a class becomes too large and handles many responsibilities. A large class can be challenging to maintain and understand because you might not understand the side effects it has or what could break by changing it. It's important to consider refactoring it into smaller classes when your team has bandwidth. This is also the case for long methods. A given software application should have many small components, each with their own independent responsibilities. Large components can…

Contents