Why Developers Still Write if/else When match Feels Better
When you first discover functional-style pattern matching in JavaScript or TypeScript — something like:
match({
A: (a) => handleA(a),
B: (b) => handleB(b),
})(props)
—it’s hard not to wonder: why are people still writing endless if/else or switch statements? The elegance of a declarative match approach can