ReasonML - Making types have your back
Submitted by Chirag Jain (@chirgjn) on Wednesday, 9 January 2019
Learn about some core concepts about functional programming and type systems which help you become a better developer even if you choose to never use ReasonML.
A large chunk of the code we write is to keep different parts of the UI consistent with the state. It’s impossible to keep track of all the possible states and the paths between them, inside your brain. It doesn’t help that as the application grows the number of possible combination of states increase exponentially.
Imagine not having to keep track of all the places you need to make a change when a new state is introduced. What if there’s a system to help you consider all the cases and make it impossible to represent invalid states inside your code, ReasonML’s type system does exactly that when leveraged correctly.
I’m a frontend developer with 3 years of industry experience. I have worked on varied range of codebases both in terms of tech stack (from backbone and jQuery to React & Vue) and size (from a single file project to projects containing 80+ components). I have recently started exploring ReasonML and have a beginner’s perspective on the same and would love to share my learnings with everyone.