DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

JavaScript Joel
JavaScript Joel

Posted on • Updated on

Code and a Poem about Software

The best code,
without tests,
not to be trusted.

function alwaysLeft(left) {
  return function(right) {
    return left
  }
}

Test coverage,
gives confidence,
still can be busted.

alwaysLeft('L')('R') === 'L'

Code abused,
ways unimagined,
leaving you disgusted.

function I(x) {
  return x
}

alwaysLeft(I)('L')('R') === 'R'

@joelnet

Cheers!

Top comments (0)

Need a better mental model for async/await?

Check out this classic DEV post on the subject.

β­οΈπŸŽ€ JavaScript Visualized: Promises & Async/Await

async await