Skip to main content
4 events
when toggle format what by license comment
Jan 12, 2018 at 16:00 vote accept TheCatWhisperer
Dec 11, 2017 at 18:52 comment added Berin Loritsch you could simplify the check like so: (account as IResettable)?.ResetPassword(); or var resettable = account as IResettable; if(resettable != null) {resettable.ResetPassword()} else {....}
Dec 11, 2017 at 18:45 comment added TheCatWhisperer I also very much prefer compositional typing. +1 for making me see that this particular example is not leveraging it properly. Although, I would say computational typing (like traditional inheritance) is more limited when capabilities vary widely (as opposed to how they are implemented). Hence the interfacing approach, which solves a different problem than either compositional typing or standard inheritance.
Dec 11, 2017 at 18:32 history answered Alex CC BY-SA 3.0