• 0 Posts
  • 13 Comments
Joined 1 year ago
cake
Cake day: July 1st, 2023

help-circle







  • I think you’re missing a detail here, which is that before streaming was a thing writers would make significant amounts of their money by getting a show syndicated on a network, that was the whole deal. Streaming is being treated differently, effectively resulting in then receiving a very large pay cut because even if they make a successful show the payout doesn’t come.

    And it’s true they could structure things so that they don’t receive a secondary payout, but their base salary was negotiated with that later payout in mind. You and I don’t receive secondary payouts for our work, but our salary is also adjusted to recognize that.




  • Generally speaking the use case is writing tests. If your tests just call all the dependencies and new directly then it’s harder to write tests for your specific component while avoiding setting up a whole bunch of stuff (to make all those other classes work). By requiring all the dependencies to be provided to the class, you can swap them out at test time for something else that’s easier to work with.

    That said, IMO it’s a symptom of problems in language design. Using DI is only necessary because languages like C# don’t make it easy to mock out new or classes used directly, so we resort to wrapping everything in interfaces and factories to avoid those features and replace them with ones that are easier to mock. If the language was designed such that those features were easy to replace during testing then DI probably wouldn’t be a thing.