News for hackers. Stuff that matters.
Re:CUPID – the back story by stepbeek on Sunday March 21, 2021 @12:49PM (#26531772)
I’ve generally understood the criticism of DI to be levied at codebases where it was applied to literally every class. I’m not the author, but I don’t imagine that relying on interfaces to abstract between layers of an application or to avoid a concrete dependency on something like an external api to be what he was arguing against.
Re:CUPID – the back story by aszen on Sunday March 21, 2021 @01:06PM (#26531911)
There are two ways of abstracting out an external api, one is via an interface with a set of methods this is well understood but there is another option as well that is to focus on the core data types your application needs. Create those types and then revolve your whole application logic around them.

Finally create decoders that instantiate those types from different sources.

Re:CUPID – the back story by stepbeek on Sunday March 21, 2021 @01:27PM (#26532100)
This sounds interesting. Can you link to any examples?
Re:CUPID – the back story by aszen on Sunday March 21, 2021 @01:46PM (#26532286)
Go through

https://fsharpforfunandprofit.com/fppatterns/

And

https://fsharpforfunandprofit.com/posts/13-ways-of-looking-a...

I'm still learning on how to apply these ideas in my own work (which doesn't use f sharp or functional programming) but it's a rich source of ideas