2 ms·
These kinds of edicts don't work because they fail the most important rule of programming: do what's simplest and most clear for the code you're writing. Your l
by pfraze 4y ago
These kinds of edicts don't work because they fail the most important rule of programming: do what's simplest and most clear for the code you're writing. Your language is going to have constructs for this kind of thing (polymorphic inheritance, discriminated unions, multi dispatch, etc). Pick the language-native construct that works best. In the case of Typescript this would arguably be polymorphic inheritance, but if you don't have a scenario that benefits in multiple ways from writing classes then using them would be overkill.