My reading journal for Code Fellows.
Functional programming is a style of building the structure and elements of programs. It treats computation as the evaluation of math functions and avoids changing-state and mutable data.
A pure function is one that returns the same result if given the same arguments and does not cause any observable side effects. A function is pure if it meets this definition.
A benefit of pure functions is that they are easier to test.
Immutability means that something does not change over time and that it cannot be changed. For data, this means that its state cannot be changed after it is created.
If a function consistently yields the same result for the same input it is referentially transparent.
Modules are similar to React Components. They are small pieces of code that serve a single purpose and are therefore reusable just like components. You can modularize your code to organize it the same way that you can componentize a React app.
Require is like Import in React. It allows you to bring in code from another module.
You must require it by specifying the file path of the module you want to access.
You have to export what you want to send out of that module so that it can be accessed elsewhere via require.
I am excited to get practice using Export and Require. Nesting components was a big way of organizing and reusing code in React and that seems to be the same case here with modules.