reading-notes

Code Fellows courses Notes

This project is maintained by QamarAlkhatib

FUNCTIONAL PROGRAMMING

Functional Programming Concepts

  1. What is functional programming?

    • is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions that map values to other values, rather than a sequence of imperative statements which update the running state of the program.
  2. What is a pure function and how do we know if something is a pure function?

    • The definition of a pure function is: The function always returns the same result if the same arguments are passed in. It does not depend on any state, or data, change during a program’s execution. It must only depend on its input arguments. resource
  3. What are the benefits of a pure function?
    • One of the major benefits of using pure functions is they are immediately testable. They will always produce the same result if you pass in the same arguments. They also makes maintaining and refactoring code much easier. resource
  4. What is immutability?
    • it means that Immutable data cannot change its structure or the data in it resource
  5. What is Referential transparency?

    • means that given a function and an input value, you will always receive the same output. resource