Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Nah, that's a massive code smell. Usually I see it when people start abstracting their code ok, but then aren't sure how to achieve something later on while keeping the same abstraction - so they bodge it (or just don't know better), and you end up with this mess.
-
@Brolls yeah, interfaces are there. And yet the implementstion ir queried via instanceof
-
@7Raiden I think he meant virtual classes in c++. Sort of interfaces in java world [? Correct me if I'm wrong]
-
7Raiden8786y@netikras Well yeah, I was kidding 😂! I was imagining the reaction when one actually told this guy that it should use virtual 😂
What's the point of abstraction layers if you're riddling all the code with
if (AbstractionLayer.SomeType instanceof ImplemantationLayer.SomeTypeIml1) {
// do stuff
} else if (AbstractionLayer.SomeType instanceof ImplemantationLayer.SomeTypeIml2) {
// do stuff
} else if (AbstractionLayer.SomeType instanceof ImplemantationLayer.SomeTypeIml3) {
// do stuff
} else if (AbstractionLayer.SomeType instanceof ImplemantationLayer.SomeTypeIml4) {
// do stuff
}
???
Seriously.. Guys. Am I missing some point here?
rant
thats jacks shit imo
instanceof