News for hackers. Stuff that matters.
Re:How to Design Programs 2nd Edition by segfaltnh on Tuesday May 02, 2023 @07:08AM (#35785781)
I love this sort of approach for one-shot externalities but what about when your entire program is a conversation with external components? My current project coordinates software repositories and services within AWS and I find myself using a lot of mocks in testing.

I can return a tree of lambdas but then I have to resolve them against something and that's just replacing mocks with lambdas, really. Not sure it's any better in practice.

Re:How to Design Programs 2nd Edition by kmac_ on Tuesday May 02, 2023 @07:42AM (#35786057)
Great question! I worked with two approaches: 1. Sagas - a centralised place to handle bussines flows 2. Event system

Start with 1. and eventually (pun intended) move to 2. Both ways allow parallelized interactions with external systems, deferred decisions, etc. whatever the bussines will require.

Re:How to Design Programs 2nd Edition by segfaltnh on Wednesday May 03, 2023 @11:02AM (#35803224)
Sorry I wasn't clear, I'm talking about imperative code that coordinates multiple external actions. In a world where it's modeled as jobs in a distributed system, I agree that each job can be nicely functional (and I love this pattern).