The venerable master Qc Na was walking with his student, Anton. Hoping to prompt the master into a discussion, Anton said "Master, I have heard that objects are a very good thing - is this true?" Qc Na looked pityingly at his student and replied, "Foolish pupil - objects are merely a poor man's closures."
…
On his next walk with Qc Na, Anton attempted to impress his master by saying "Master, I have diligently studied the matter, and now understand that objects are truly a poor man's closures." Qc Na responded by hitting Anton with his stick, saying "When will you learn? Closures are a poor man's object." At that moment, Anton became enlightened.
By moving from classes to hooks React simply moved from one stateful system to another - from objects to closures.
Interestingly the Elm community has pretty much come to the conclusion that "components" don't work in a functional system - i.e. Model, Update, and View are three separate systems. While each can be broken down into smaller units, it's a mistake to throw a little piece of model, update and view into an aggregating whole.
Evan Czaplicki
@evancz
1) Components are objects!
components = local state + methods
local state + methods = objects
14:41 PM - 31 Aug 2017
So React's claim to being functional is only skin deep - at its core it's still object-oriented even if it prefers to use closures.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Quote:
By moving from classes to hooks React simply moved from one stateful system to another - from objects to closures.
Deep dive: How do React hooks really work?
Interestingly the Elm community has pretty much come to the conclusion that "components" don't work in a functional system - i.e. Model, Update, and View are three separate systems. While each can be broken down into smaller units, it's a mistake to throw a little piece of model, update and view into an aggregating whole.
So React's claim to being functional is only skin deep - at its core it's still object-oriented even if it prefers to use closures.