Is a Cow an Animal?
0
Read article here.
Some people view covariance as an exception; so the run-time type check like mulptiple dispatch or type switch statement is inevitably required. It is true that reality has exceptions, no matter how we don't like them. But are all covaraince exceptions? No. Exceptions are only the properties of a few individual objects and subclasses. Exceptions cannot be in majority, otherwise they are not exceptions. If we find that almost all subclasses are exceptions of a superclass whose argument type needs to be redefined, the definition of the superclass must be wrong. Remember that programming is an art to formalize the reality to computer. In formalization, we always try to establish a mathematic model in which all objects are arranged in a certain pattern and behaves according to certain rules. Exceptions should be eliminated as possible as we can.
Discuss
0
TheDarkStarAlchemist
Requests Moderator
kenjiharima wrote...
No she's a cartoon.
Shit. The 90's are taking over.
