Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@fullstackchris Function components are the same as class components, the only difference is that now we can replace the single language-defined state mechanism with a single library-defined state mechanism.
It would've cost nothing to pass the hooks API to the functional components as an object, and it would've been so much more flexible. -
Hmm I’ve always seen functional programming as a special way of working with state. Not the absence of state.
Like in functional programming you typically apply functions to state in order to create new state as the output.
Opposed to modifying the state as a side effect of a function call of an object.
Maybe I’m confusing state with data. -
@Lensflare These terms are fluid, a monad is typically considered to have state, but even if you're using CPS to represent side effects the instruction pointer is still without doubt a form of state.
-
@Lensflare A distinct property of state (in the context of object-oriented programming) in my opinion is that it's mutable and not copyable, that is, there may be operations that you can't undo. In FP though, operations are very flexible and you have many options for what you allow, so from that viewpoint these constraints feel a lot more arbitrary when we have things like comonads.
Q: Why do anarchists always use functional programming?
A: Because it has no state.
*bum tiss*
joke/meme