Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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-205c0...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: