Are the paradigms of ReactJS and Redux worthwhile for things other than web-development

development-processfunctional programmingparadigms

I'm a bit fascinated by the current paradigms shift libraries like ReactJs and Redux have caused in web development. Apart from computer science classes, I wasn't much affected by functional programming, immutability and so on, and I've yet to develop something in a purely functional language.

While there are a lot of projects that offer a bridge between the more traditional frameworks/languages and React, they all are concerned about web development. I've googled a bit around, but I've not found anything related to applying the new methods to other areas in development (besides React Native), especially in languages that are not considered as purely functional.

Would applying their methods be a worthwhile endeavour in other areas and languages like Java, C# or Python? Do such question stem from a fundamental misunderstanding on my part?

Best Answer

  • React is using a functional approach for creating interfaces: given some state, it produces rendered page fragments using only pure functions. Aside from technical details (like its virtual DOM), there's nothing special about that. In languages like Haskell it's the most natural way to do that, and it's just about that time when guys from JS community (including myself) finally start understanding, using and appreciating the beauty of functional programming
  • Redux, as described in it's documentation, leverages CQRS and event sourcing architectural patterns to perform state mutations in a predictable and manageable way.

In both cases, their basis ideas existed long before those frameworks were created. Applied to web development, these ideas produce very interesting results, like hot reloading, time-travelling debuggers, etc. So these ideas are not new, but their applications are.

As for your question: yes, you can use these paradigms/patterns in other languages and frameworks.

  • FP as a paradigm is obviously used in many languages
  • You can do event sourcing and CQRS in Java, C#, etc., because these are patterns, so they are not specific to some language or framework