> For the complete documentation index, see [llms.txt](https://johnkazer.gitbook.io/core-web-dev-concepts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://johnkazer.gitbook.io/core-web-dev-concepts/app/code-design-paradigms.md).

# Code design paradigms

You can tell from my [DEV posts](https://dev.to/johnkazer) 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 ([Ramda ](https://ramdajs.com/)yes, [FantasyLand ](https://github.com/fantasyland/fantasy-land)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 [React](https://reactjs.org/), [Vue ](https://vuejs.org/)etc. using [state and props](/core-web-dev-concepts/app/state.md).

In either case, my approach, React and Vue have a common feature - the virtual DOM (see [later content](/core-web-dev-concepts/hyperapp-and-pug-vdom.md)).

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 [this repository](https://github.com/johnkazer/hyperapp-xstate-demo) 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 <https://cheesecakelabs.com/blog/functional-programming-game-js/>
  * How FP functions might work <https://medium.com/dailyjs/functional-js-with-es6-recursive-patterns-b7d0813ef9e3>
  * A great book to start with <https://github.com/getify/Functional-Light-JS>
  * A slightly more advanced book <https://github.com/MostlyAdequate/mostly-adequate-guide>
  * And this one too is excellent <https://leanpub.com/javascriptallongesix/read>
  * James Sinclair's blog posts **before** the series "*Things I wish someone had explained to me about functional programming*", in particular the "A g*entle introduction to functional Java*S*cript"* <https://jrsinclair.com/web-development/>
* FP 'level 2' includes algebraic structures, fantasy land and related concepts:
  * A great blog series on web development from a functional JavaScript perspective <https://jrsinclair.com/web-development/> (try his series "*Things I wish someone had explained to me about functional programming*" and also his articles on monads)
  * Fantasy land specification <https://github.com/fantasyland/fantasy-land>
