Re:Ask HN: Why is there a tendency in JavaScript to omit usi...
by sethc2 on Saturday March 13, 2021 @12:37PM
(#26448177)
I find classes in JavaScript just more tedious, and they’re really just syntactical sugar on top of a function anyways.
Working in react I’m always making things immutable, and I generally use typescript, and classes to me are just more painful to write then a function whose parameters act effectively as constructor arguments and the return statement which is the classes public API.
[ Parent
| on HN ]
Re:Ask HN: Why is there a tendency in JavaScript to omit usi...
by sethc2 on Saturday March 13, 2021 @12:40PM
(#26448207)
I should say though, I will use classes if I’m trying to do OOP, and using a lot of inheritance.
I find it easier for me to make “clean” in those cases, then doing the equivalent with functions, but that might just be old habits from when I only OOP