Comment

Comment by jugjug

Lately, I have been struck by pragmatism of approaches discussed in https://clojuredesign.club/

For example, one can start separating pure functions from side-effects, aiming for aggressively minimal side-effecting functions. Applying this approach to calling REST APIs, one would first create a full request (including the http method, body, headers, etc) in a pure function, and only then send that request to the wire. With such a split, one can easily unit-test the request construction (it's a pure fn), and also explore the request.

It was mind-bending to me when I first heard it. The podcast is full of such approaches and it seems that Chris and Nate, the hosts, have quite some battle scars to source from.

parent jugjug 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton