reading-notes

Read: Class 09

Reading

Functional Programming Concepts

  1. What is functional programming?
    • a programming paradigm -a style of building the structure and element of computer programs- that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data
  2. What is a pure function and how do we know if something is a pure function?
    • it returns the same result if given the same arguments (it is also referred as deterministic)
    • it does not cause any observable side effects
  3. What are the benefits of a pure function?
    • deterministic & predictable
    • no side effects
    • improved testability
    • reusability
    • concurrency and parallelism
    • caching and memoization
  4. What is immutability?
    • a characteristic of an object or data structure that cannot be modified after creation
  5. What is Referential transparency?
    • production of the same output for the input without side effects
    • simplifies reasoning, allows for equational reasoning / optimization, and testing

Videos

Node JS Tutorial for Beginners #6 - Modules and require()

  1. What is a module?
    • a reusable block of code that encapsulates related functionality
    • organize code into logical and reusable units
  2. What does the word ‘require’ do?
    • used to include and import modules
  3. How do we bring another module into the file the we are working in?
    • by using the ‘require’ function
  4. What do we have to do to make a module available?
    • export the desired functionality from the module