2 ms·
Although the core libraries in .NET are huge, many are also very shoddy. There are also a few great API's, but the overall quality and usability is pretty unev
by emn13 14y ago
Although the core libraries in .NET are huge, many are also very shoddy. There are also a few great API's, but the overall quality and usability is pretty uneven. This is mostly a problem with API's back from version 1.0 - however, unfortunately, those API's often haven't been updated. Documentation is also not always equally good; MSDN has lots of pages that describe a method Bar.Foo() as "Fooing a Bar", which is next to useless. I get the impression the java APIs are often better documented.
NuGet might really turn things around; here's to hoping...
- mattmanser 14y agoYeah, the worst ones are the stream ones, some what ironic given that he singles one out over Java. The IO one may have `ReadToEnd`, but it's still nowhere near as simple as Python or Ruby, it just shouldn't have to take that many lines of code to read a file. And these days I include RestSharp pretty much straight away if I'm going to be doing any HTTP calls, the native HTTPClient API is horrible. But even that's not got the greatest API, there's absolutely no good reason to have to declare a `RestClient` before doing a `RestRequest`, it's just a waste of lines of code. You always end up just writing a wrapper round it.
- eel 14y agoThere are ways in the .NET framework to read an entire file with one line: File.ReadAllText("file.txt"). And the System.Net.WebClient class provides ways to make simple HTTP calls in much fewer lines than WebRequest does. Likewise, Python has ways for interacting directly with streams.
- emn13 14y agoWebClient's API is essentially buggy; it cannot support encoding properly since the order of operations of the API is different from in HTTP, and further the response headers aren't properly exposed to let you work around the limitation. It's fine for a quick hack, it's useless for a reliable web client.