Skip to content

Instantly share code, notes, and snippets.

@waterswv
Last active November 18, 2019 18:37
Show Gist options
  • Save waterswv/4d29db017a8101c7f22b85063fa02eb7 to your computer and use it in GitHub Desktop.
Save waterswv/4d29db017a8101c7f22b85063fa02eb7 to your computer and use it in GitHub Desktop.
Today I...

Today I learned about...

  1. Closures and how fundamental they are to mastering Javascript.
  2. Currying
  3. Did a refresh on Programming Paradigms
  4. NodeJS Error Types

Detailed descriptions below

Things I'm curious about today:

  1. Websockets
  2. Memoization in React
  3. Why SSR is so important
  4. Are Semantic HTML5 tags really important
  5. Practicing writing Promises using async/await

Closures:

  • Helpful article The Javascipt Scene
  • It provided a succint example of why & how they are important.

Mainly that they control what is and isn't in scope and focus on ensuring Object Data Privacy

...

Currying:

  • Syntax:
const curried = fn1 => fn2 => fn1 + fn2
  • A great way to use function composition in order to build a new function from an old function by just passing arguments
  • Use Cases: memoization | 1st Class Functions | Catching multiple Errors for Validation

Programming Paradigms

  • Imperative: Follow a 'How to Do' directive; ex: OOP, Parallel Processing
  • Delcarative: Follow a 'What to Do' directive; ex: Functional, Database Processing
  • Javascript is a combination of both with elements of OOP & Functional being at its core.
  • Great Example of Imperative vs Declaritive

NodeJS Error Types

  • Node has 4 types of Error contexts ⋅⋅⋅ Synchronous ⋅⋅⋅ Asynchronous ⋅⋅⋅ Event ⋅⋅⋅ Promise
  • Errors: A non fatal condition that can be caught and handled typcially with error 1st callback pattern
  • Exceptions: A serious error that a sane environment should not ignore or try to handle i.e. Trigger process restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment