Hacker News new | ask | show | jobs
by Coder1996 925 days ago
I disagree re: React.

To me, class-based has one advantage over functional. A component is an object and therefore perhaps ought to be represented by a class.

That being said, functional maybe is a bit simpler.

1 comments

> A component is an object and therefore perhaps ought to be represented by a class.

That's what those who ditch inheritance altogether when designing languages challenge and it turns out not much of value is lost :) 'Component is an object' is something you'd hear from an OOP practitioner which isn't exactly convincing to people thinking functionally.

I actually use a little bit of both OOP and functions.

What I don't understand, I suppose, is if a Component isn't an object that acts, then what is it?