|
|
|
|
|
by raymondh
750 days ago
|
|
Numeric towers are indeed a sore point. * There are more 64-bit integers than C floats/doubles. But in math, reals are a superset of the integers. * Because floats are rounded, `x < x + 1`, is not an invariant. * The possibility of a `NaN` value means that the assignment `y = x` does not guarantee that x and y are equal. * Floats are implemented as binary fractions, so they are actually rationals. I disagree with the OP that OOP is entirely flawed. The core ideas of encapsulation and messaging are a really useful organizing principle. And polymorphism beats maintaining giant case-statements. Only when inheritance is added to the mix does it get dicey. As a tool for code reuse, it is not a bad idea. I think the central problem is that people want more from inheritance that it has to give (especially if you expect that children are always substitutable for their parents). |
|
Does OOP actually do encapsulation, messaging or polymorphism better than other languages though?