Skip to content

Analysis: Async Await Composition

Daniel Levy edited this page Aug 4, 2017 · 4 revisions

Meets requirements/goals?

  • Reads like a story
  • No ad hoc logic (if's tangled up with function calls inside other functions)
  • Uniform pattern/interface for synchronous vs. asynchronous code
  • Consistent async pattern (related to above)
  • Uniform Module/Function Interface (Monadic?)
  • Flat & Highly Modular
  • Function Complexity score less than 9 (w/ 1-2 exceptions)
  • Entangled Code Paths (related to previous)
  • Immutable (or treats values as immutable)
  • Mostly stateless

Despite missing my requirements, this mix of modular JS + async/await is still quite readable to an experienced developer. This pattern may be the best start for those already familiar with Object Oriented Programming. Essentially it gets really close to my design goals, without using an execution pipeline.

image