You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's figure out an alternative approach than using instanceof. While it sounds a little bit silly it really can be a PITA and I know that the pain ain't mine only - I've seen Ben Lesh and Jay Phelps mentioning this stuff on Twitter once.
It's just that with complex-enough applications/monorepos it's somewhat easy to end up with multiple copies of a library - and even though the structures created by one of the copy and handed out to the other one should be compatible, they are not if we end up using instanceof. Even though the class itself in each of copy might be 100% the same the runtime can't tell that and will fail on every executableAction instanceof ExecutableAction in each such situation
Let's figure out an alternative approach than using
instanceof
. While it sounds a little bit silly it really can be a PITA and I know that the pain ain't mine only - I've seen Ben Lesh and Jay Phelps mentioning this stuff on Twitter once.It's just that with complex-enough applications/monorepos it's somewhat easy to end up with multiple copies of a library - and even though the structures created by one of the copy and handed out to the other one should be compatible, they are not if we end up using
instanceof
. Even though the class itself in each of copy might be 100% the same the runtime can't tell that and will fail on everyexecutableAction instanceof ExecutableAction
in each such situationOriginally posted by @Andarist in #2484 (comment)
The text was updated successfully, but these errors were encountered: