DEV Community

Discussion on: On typical naming anti-pattern in Java

Collapse
 
simonhaisz profile image
simonhaisz

class PeopleEater implements HasEyes, HasHorns, CanFly, HasColor {
...
}

Interfaces: not just for polymorphism.

A related beast is the method name that references it's parameters and/or class.

class Foo
// Why do this...
public void addBarToFoo(Bar bar);
// ...Instead of this?
public void add(Bar bar);
}

Collapse
 
voins profile image
Alexey Voinov

Exactly! :)