Code design paradigms
Last updated
Was this helpful?
Last updated
Was this helpful?
You can tell from my that I've chosen a functional (declarative) approach to coding, in contrast to a procedural, object oriented etc. philosophy. I can't claim to be a purist or more than scratching the surface (yes, not yet...).
A functional approach also enables a powerful paradigm, which focusses on data rather than app constructs. This means that user data, app data and app state (e.g. button status) are all defined as data structures to be transformed by functions. This approach may or may not be in contrast to common architectures enabled by , etc. using .
In either case, my approach, React and Vue have a common feature - the virtual DOM (see ).
There are many articles and books explaining functional programming and why it's useful (and interesting!). I would say that my approach to FP as practiced in can be considered 'level 1' FP, whilst 'level 2' FP uses more advanced concepts. Here are some materials:
FP 'level 1' includes immutability, pure functions, map, reduce and related concepts:
A game, perhaps a more interesting way to see example code
How FP functions might work
A great book to start with
A slightly more advanced book
And this one too is excellent
James Sinclair's blog posts before the series "Things I wish someone had explained to me about functional programming", in particular the "A gentle introduction to functional JavaScript"
FP 'level 2' includes algebraic structures, fantasy land and related concepts:
A great blog series on web development from a functional JavaScript perspective (try his series "Things I wish someone had explained to me about functional programming" and also his articles on monads)
Fantasy land specification