What’s so great about functional programming anyway?
I&#x27;m a fan of functional programming but I&#x27;m pretty sure this post would do a terrible job of convincing anyone to try FP out. There&#x27;s a very bad pattern of replicating very specific language features and control flow structures just to make them more similar to point-free Haskell, which is not going to win anybody over.<p>The author begins by replacing a language feature, the . operator, with a pipe() function. After that they swap out exceptions for Result, null&#x2F;undefined for Maybe, Promise with Task, and the final code ends up becoming an obfuscated mess of wrapper functions and custom control flow for what you could write as:<p><pre><code>    fetch(urlForData)
      .then(data =&gt; data.json())
      .then((notifications) =&gt;
        notifications.map((notification) =&gt; ({
          ...notification,
          readableDate: new Date(notification.date * 1000).toGMTString(),
          message: notification.message.replace(&#x2F;&lt;&#x2F;g, &#x27;&amp;lt;&#x27;),
          sender: `https:&#x2F;&#x2F;example.com&#x2F;users&#x2F;${notification.username}`,
          source: `https:&#x2F;&#x2F;example.com&#x2F;${notification.sourceType}&#x2F;${notification.sourceId}`,
          icon: `https:&#x2F;&#x2F;example.com&#x2F;assets&#x2F;icons&#x2F;${notification.sourceType}-small.svg`,
        })
      )
      .catch((err) =&gt; { console.log(err); return fallback });
</code></pre>
...which is just as functional because doesn&#x27;t involve any mutation and it doesn&#x27;t require several pages of wrapper functions to set up, you can tell what it does at a glance without having to look up any other pieces of code, it&#x27;s gonna run faster, and it uses standard control flow which you can easily debug it using the tools you use for any other JS code.<p>This post has nothing to do with functional programming, this is a poor monad tutorial.