From the course: Software Design: Code and Design Smells

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Limit application-level smells

Limit application-level smells

From the course: Software Design: Code and Design Smells

Start my 1-month free trial

Limit application-level smells

- [Instructor] At the application level of a program, there are only a few stand out code smells that don't infringe on design smell territory. Two of which we've already discussed, as they're interconnected. Duplicate code should be avoided at all cost as it screams inefficiency. But even more so, it leads to a severe code smell called shotgun surgery. Shotgun surgery is when you have so much duplicate code that updating it is really a losing battle of efficiency and development time. When you have to make changes in multiple locations throughout a code base, there's always the possibility that you'll miss one and put your program at risk. Now both of these smells can be avoided by the solution we already discussed. Mainly breaking out the repeated code into a single location and eliminating the need for future shotgun surgery completely. Now those two smells aside, the most threatening code smell at the…

Contents