4 ms·
Classes are fine so long as: - They're small and single-purposed - They don't inherit (or at the very least, extremely light inheritance) - There's a very cl
by bluepnume 5y ago
Classes are fine so long as:
- They're small and single-purposed
- They don't inherit (or at the very least, extremely light inheritance)
- There's a very clear relationship between the state and the methods (e.g. a counter class, or a future/promise)
For example in JavaScript, I think you can still uses classes and end up with functional-ish code: https://bluepnume.medium.com/functional-ish-javascript-205c05d0ed08 https://bluepnume.medium.com/functional-ish-javascript-205c0...