I'm with you on most of that. The problem I'm running into right now is trying to access a child class from a parent. Specifically, `static create() { return new this() }` doesn't seem to work.

Reply to this note

Please Login to reply.

Discussion

I use zero inheritance except for the class component in Preact. Therefore, I can't feel your problem.

Do you use typescript? I feel like typescript nudges you toward classes. I have a very clojure-like programming style (functions and structs) which typescript hates.

"typescript nudges you toward classes" I believe this is only a reflextion on many existing projects migrated to TS from 2017ish JS when class was a new thing.

TypeScript has lots of compile time utilities to actually write code more like a statically typed functional language.

I really like clojure's design philosophy and Blowater is mostly functions, object literals and channels.

But I actually end up loving class component for them maintain their state locally and I don't use hooks at all.

I still use functional component for pure statelss UI. But stateful UI is all written with a mix of class components and global states.

I use class mostly just for runtime namespaces. Yeah, probably only used 10% of what a JS class can do but I feel the 10% is the good parts.

Becuase I also write unit tests and integration tests. Having a strong compiler can reduce the amount of tests that I need to write.