Talin
1 min readApr 8, 2020

--

Most of my programming is done in TypeScript these days, which has a small number of build-in functional capabilities (map, filter, reduce) as well as a wealth of third-party libraries for managing immutable data.

I tend to use immutable data for simple, small-scale data structures such as arrays and sets, or for temporary short-lived values. Larger and more complex objects are more difficult to manage in a purely functional style, since changing any property requires reconstructing the entire object. This is even more true when objects are nested or organized in a tree structure.

So one possible ‘hybrid’ approach is to use mutable data structures for large, complex data models, with individual properties consisting of immutable collections.

My day job involves a lot of reactive programming using state management frameworks such as MobX (see my introduction here). These programming techniques fundamentally depend on mutable data, a purely functional approach will not work.

--

--

Talin
Talin

Written by Talin

I’m not a mad scientist. I’m a mad natural philosopher.

No responses yet