3 ms·
When possible, I prefer to do away with objects and have functions with types. X in, Y out.
by mejutoco 4y ago
When possible, I prefer to do away with objects and have functions with types. X in, Y out.
- diarrhea 4y agoA style I like as well, but methods are exactly that as well, only that `X` is implied, and there's a danger of abusing state (`f(X) -> Y` can and often is pure, whereas the entire point of methods is to be impure (modifying instance state)).
- mejutoco 4y ago> methods are exactly that as well, only that Exactly, except for implicit types and modifying state, indeed. Those are the reasons why I prefer the above.