Code Smell 59 — Basic / Do Functions
sort, doSort, basicSort, doBasicSort, primitiveSort, superBasicPrimitiveSort, who does the real work?
- Bad Naming
- Low Cohesion
- Single Responsibility Principle
- Use good object wrappers
- Use dynamic decorators
We can instruct our static linters to find wrapping methods if they follow conventions like doXXX(), basicXX() etc.
We came across this kind of methods some time in our developer life, We smelled something was not OK with them. Now is the time to change them!
What exactly is a name? - Part II: Rehab
We all agree: a good name is always the most important thing. Let's find them. We all use names for programming, it…
A wrapper function is a subroutine (another word for a function ) in a software library or a computer program whose…
The primary disadvantage of Wrap Method is that it can lead to poor names. In the previous example, we renamed the pay method dispatchPay() just because we needed a different name for code in the original method.
This article is part of the CodeSmell Series.