4 ms·
> Nitpick, but why "m = new Math() s = m.sin(x)" would be "the OOP way" instead of "x.sin" ? Because you can't do the latter post-hoc. You can't add hyperbolic
by dozzie 9y ago
> Nitpick, but why "m = new Math() s = m.sin(x)" would be "the OOP way" instead of "x.sin" ?
Because you can't do the latter post-hoc. You can't add hyperbolic functions
by yourself if your standard library didn't anticipate them. Well, in Ruby you
can and it's a standard practice to pollute this way classes at random, and in
Python you can as well, though it's frowned upon, but certainly you cannot in
C++ or Java.