OOP Functional React!

Written by - Saumya

30 January 2020

Developing with React is pleasant enough. I have worked with React from its beginning. When started it was as simple as a script tag in HTML file. And then create the components and it worked! It was so simple that I was thinking why other frameworks were so so complecated to start with!

React got complicated soon. Toolchains came up and different frameworks around React came up. Companies were slow to adapt but then got momentum. React changed its licensing and probably that was the turning point for the coporates. But whatever that may be the thing is it got complicated very soon. It was expected, when corporates were into the game. The same thing had happened when Flash became Flex and started pleasing corporates. Ultimately this made me think of switching to other frameworks.

React came up with Class and all the other OOP concepts. It started implementing them. The other frameworks around React also started doing the same. As an application developer it felt good at one level. But the fear was there, that the way it is moving. My applications also started using OOP concepts and developed some applicatioins like that. Somewhere I was thinking why it came this way!

Developing for a new application today, I took React for a test now. I am surprised that React has made some changes again. The fun part is with the new toolchains also one can write simple React applications. I have tested the new release of the framework in my old application and it worked! That is a big thing for adapting a framework. Even if it matures, it keeps the old applications running. With the new release, now React is promoting Funcational approach rather than the Classical OOP. Well, learning may be a thing. But then once I know the new approach, it made sense to me. Tried developing simple components and made an application to know whether it works fine! I found it did.

The hooks are actually simpler to understand and maintain than the lifecycle methods. I could made a Functional component with states with very few lines of code and still know what is happening where. First I thought, it might be difficult to understand the concepts of functional approach. Now it seems fine. Overall, I found it is interesting to work with React again.

Happy Coding.