News for hackers. Stuff that matters.
Re:Tuples goodness in .NET 4.7.1 by Someone1234 on Monday March 12, 2018 @12:25PM (#16569214)
List<Type> or similar means you're creating a lot of types in a large project.

Specifically you're making a ton of Dtos or similar objects just to bundle values together and transfer them between layers. You can use anonymous objects, but then the return type is simply "object", which isn't descriptive enough. Plus anonymous objects are flagged to not cross assembly boundaries without wild hacks.

Tuples work in situations where you'd otherwise use a small Dto, which is then combined with a larger Dto further up the food chain. And since it is self-descriptive you're not losing much clarity over the small Dto.

There are no comments on this comment yet.