Slide 19
Slide 19 text
Por onde começar? Maiores indícios de code
smell
- Fowler: Still one of the biggest ones for me is duplication. Spotting duplicate
code and figuring out how to remove it often leads me to an improved design. Like
anything, it can be overdone, but also like most things, it usually isn't done
enough.
-
- Kent Beck: Since Martin already picked duplication I'll choose complex conditional
logic. When I see an if statement inside a for loop inside an if statement, I am
immediately suspicious that there is a case that hasn't been considered. A slightly
more abstract smell I look for is violations of Composed Method, which states that
all the operations in a function should be at the same level of abstraction. For
example, if I see a bunch of bit twiddling operations in the same function with
calls to other functions, I'm pretty sure there is a better way to express the
computation.
https://www.infoq.com/articles/book-review-refactoring-second-edition/