DEV Community

Discussion on: Declarative Gibberish in React

Collapse
 
gypsydave5 profile image
David Wickes • Edited

cracks open my copy of The Structure and Interpretation of Computer Programs ...

Programming without any use of assignments, as we did throughout the first two chapters of this book, is accordingly known as functional programming.

and

In contrast to functional programming, programming that makes extensive use of assignment is known as imperative programming.


The horror of React development for me is that it is full of people who are quite happy to bandy around big words without knowing their meaning or value. I guess they think that functional programming means using arrow functions, and must be better because it's new. And the nauseating over use of chained ternaries? Sheesh.

Maybe OO will be cool again next month?

Collapse
 
macsikora profile image
Pragmatic Maciej • Edited

Yes this is good comment. FP has its high now, I think amount of hype is huge. But there is truth that besides definition you make, FP is also about piping data through functions, and this is a product of lack of assignment. Even though in JS you cannot make a program without assignment (and you should not even try), React quite nicely represents data piping through components/functions. And yes most of these functions are not functions in mathematical sense, as whenever u use hooks, you get into environment state, but most of FP languages also makes runtime tricks like IO Monad or Elm Architecture.

You think you write "functional" and stateless, but only the high abstraction make this magic possible. React is a runtime, programming in React is React programming, what is some composition of many styles. Programming in React is different than any other.