DEV Community

Discussion on: 10 CODING MISTAKES THAT MAKE YOUR CODE SMELL

Collapse
 
alexanderholman profile image
Alexander Holman

There are a few more than 3 ways to peel a potato! e.g. where the data owns the method, and the methods mutate the instance directly without any input, see the example below:

class Account {
    private LocalDate expires; // e.g. 2019-08-19
    public void renew()
    {
        this.expires = this.expires.plusYears(1); // now 2020-08-19
    }
}