DEV Community

JavaScript Joel
JavaScript Joel

Posted on • Edited on

8

Code and a Poem about Software

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

function alwaysLeft(left) {
  return function(right) {
    return left
  }
}
Enter fullscreen mode Exit fullscreen mode

Test coverage,
gives confidence,
still can be busted.

alwaysLeft('L')('R') === 'L'
Enter fullscreen mode Exit fullscreen mode

Code abused,
ways unimagined,
leaving you disgusted.

function I(x) {
  return x
}

alwaysLeft(I)('L')('R') === 'R'
Enter fullscreen mode Exit fullscreen mode

@joelnet

Cheers!

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay