← Back to context

Comment by tobyhinloopen

4 months ago

I feel like these functional GUI renderers are all trying to make JS something it is simply not.

I want to render my view with instances of classes as a model.

> I feel like these functional GUI renderers are all trying to make JS something it is simply not.

I wholeheartedly agree.

I liked React's support for function components and hooks are quite a treat, but still I think class components are a far better fit for complex components that have logic and state. I'm seeing all this complex logic being expressed as a convoluted mix of hooks and I can't help myself thinking it would be far cleaner to have a class where this logic was handled eith plan old inversion of control.

Please keep OO away from web dev. The mess is bad enough and adding OO will only increase coupling.

  • Calling OO to increase coupling is a weird take in a world where React's "functional components" and similar patterns encapsulate their state and rendering pipeline.

    • Sorry, wrong word. I meant “complecting” but as no one outside of Rich Hickey’s talks will understand that I reached for the wrong word.

      OO conflates data and methods, which makes systems harder to test, reason about, and debug, because functions are less pure due to the “hidden” internal state of an object.

      It also encourages heavy constructs that can often be replaced with trivial data structures that are much easier to work with.

      Let’s not get started on inheritance.

      I think OO is widely discredited now, although I do see a few experienced programmers still using it.