What Am I?
by in Representative Line on 2019-11-21Object oriented programming is the weapon of choice for many programmers, and when wielded properly, you can often rely on a mix of convention and strong types to make it clear what type of object you’re working with. Sometimes though, you need to check. In a language like Java, you have the instanceof
operator, a boolean comparison which answers if obj instanceof SomeClass
. Seeing a lot of that in a codebase is a clear code smell.
Sometimes, though, not seeing it is the code smell.