© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Sergio
Web Developer & curious mind
If you have a long switch maybe it's a bad signal that the inheritance it's not correct, or a lot of if/else concatenated.
@sdecandelario Can you explain the inheritance with respect to a switch a bit more please?
Well, sometimes you make a lot of switch/case instead of split functionallity in different classes and make every class have their functionallity.
Here is better explained (https://refactoring.guru/smells/switch-statements)