If I need to call the VideoService to fetch some data, I don't want to spend time writing that and the tests that come with it. I'd rather outsource that part.
959 karma · joined December 26, 2011
If I need to call the VideoService to fetch some data, I don't want to spend time writing that and the tests that come with it. I'd rather outsource that part.
We might like one government administration and highly expect them to respect the privacy. But what about the next administration? We've just seen Trump say he will withhold funding for universities with "illegal protests". I'd fully expect his administration to abuse this tracking, in the name of law and order.
You're commenting on a post about how the author runs LLMs locally because they find them useful. Do you think they would run them and write an entire post on how they use it if they didn't find it useful? The author is seriously using them.
One benefit I like in the author's example, vs a static utility method, is you don't need to concern yourself about the implementation when it comes to tests.
Let's consider your example. The CheckoutService needs to call applyDiscount. So how do we get a discount to be applied? Well, we need to look at the source code of the static function to see that the order needs a CouponCode of "SUMMER2024". We may also need to see how much the order is discounted by so we can assert on the correct total value in the tests (or we can simple assert the total is less than the total we started with). That means that anytime we update the CouponCode (e.g. "WINTER2024") then we have to update a bunch of tests.
Now let's consider the example's change. I see that the constructor takes some DiscountService interface. So now I can create a fake implementation that's used in the tests. I don't need to dig into implementation code to see how to trigger a discount. I can create that fake implementation in the test itself so I can provide exactly how much discount will be applied and the test can assert that the total is discounted by the amount specified in the test itself, now we can see it's definitely being applied! Or I can create a FiftyPercentDiscountFake for all other tests to use.
The example is trivial of course and you likely don't need such an abstraction for trivial services. After all, this is for example purposes. But as code becomes less trivial or many teams are repeating the same thing if you're at a large enough company, then this a tool in our toolbelt to use to manage the complexity.
"The California Public Utilities Commission (CPUC) issued a ruling Thursday that requires taxi and ride-hail drivers who are carrying unaccompanied minors in the state to pass a fingerprint background check"
That said, I'd still make the same point that people who value art and the artist will buy from and support the artist. Those that don't value it, won't. But now we're on a larger scale.
I agree there will be winners and losers of some proportion here. But I also think the people that want to pay for art will continue to pay as their motives and values are different. There's plenty of cheap knock-off art, but people still pay premiums for art to support the artist and their work.
As someone else replied to you, it's similar to piracy. The people that pirate were never going to pay in the first place. To tie it back here, the people listening to AI generated <whatever> were never going to pay in the first place - which is why so many podcasts get their money from ads.
Servers cost money each month, as do the services they use.