|
|
|
|
|
by joeatwork
1159 days ago
|
|
I know it isn’t really appropriate to the spirit of the article, but it seems like in this case there is a right answer, and it’s “Fully separate object types” - it’s explicit, prevents errors, is complete, and while it requires a lot of typing to implement it doesn’t require much complexity. |
|
In defining the implementation, it's easy enough to do something like this (if the implementation really is common):
which you can also use macros to help generate if you want to.