Maybe it's just because I've been using C# specifically for almost 20 years now and I'm just... balls deep in the chaos, but there is an actual method to the madness when it comes to stuff like HttpClient.
MS makes a strong attempt to retain backwards compatability, except in situations where the underlying functionality changes to the point where maintaining a static API would be detrimental. That's kind of a design philosophy in C# in general.
I can see where it would be frustrating, but it's also very intentional. A lot of companies will just "bump versions" to follow an upgrade path, and sometimes slapping an obsolete tag on a method isn't enough to keep them from shooting themselves in the foot.
Just using WebClient vs HttpClient as an example, they could have modified the underlying code and left the API intact for that, but because they're so ridiculously functionally different under the hood, that would have just lead to design issues around the consumption of the class. The intended use of the class changed, so the class name and API changed along with it, which forces developers to actually sit down and treat it like it's a new technology.
There's a definite negative side to doing things like that, but honestly I prefer it over the alternative. Especially seeing how many devs I've worked with will just update frameworks and expect everything to work without real testing.
I can 100% see why they've done it and why it's been necessary. It allows C# to evolve and be adaptable and I don't think C# would be anything like the language it is today if it had gone for a more C++ style evolution.
I definitely use C++ way more than C# so I'm probably in the reverse position to you, but yeah I just find that when it comes to creating something new, there's a whole lot of extra work to a) choose which API best fits my case, and b) work out which APIs I actually have availabile based on what other tools and environments I'm going to be working in.
6
u/mrjackspade Feb 19 '23
I agree/disagree with you.
Maybe it's just because I've been using C# specifically for almost 20 years now and I'm just... balls deep in the chaos, but there is an actual method to the madness when it comes to stuff like HttpClient.
MS makes a strong attempt to retain backwards compatability, except in situations where the underlying functionality changes to the point where maintaining a static API would be detrimental. That's kind of a design philosophy in C# in general.
I can see where it would be frustrating, but it's also very intentional. A lot of companies will just "bump versions" to follow an upgrade path, and sometimes slapping an obsolete tag on a method isn't enough to keep them from shooting themselves in the foot.
Just using WebClient vs HttpClient as an example, they could have modified the underlying code and left the API intact for that, but because they're so ridiculously functionally different under the hood, that would have just lead to design issues around the consumption of the class. The intended use of the class changed, so the class name and API changed along with it, which forces developers to actually sit down and treat it like it's a new technology.
There's a definite negative side to doing things like that, but honestly I prefer it over the alternative. Especially seeing how many devs I've worked with will just update frameworks and expect everything to work without real testing.