Re:Using the .NET HttpClient class wrongly can destabilize s...
by Analemma_ on Tuesday August 30, 2016 @11:50AM
(#12391192)
I once attended a course on the .NET memory management and GC model taught by Jeffrey Richter, who was on the CLR team for some time. His opinion was that you should never use "using", and that he opposed adding it to the language at all, but was overridden. At the end of the day I think that's a little excessive, but I do try to avoid "using" unless I know the surrounding object has a long lifecycle and the IDisposable utilizes a very limited resource.
[ Parent
| on HN ]
Re:Using the .NET HttpClient class wrongly can destabilize s...
by nextweek2 on Tuesday August 30, 2016 @03:47PM
(#12393276)
You'll need to explain the reasoning behind why he doesn't want people to use using.
I've not found a drawback and found it shortened my code. Only downside is the extra indentation.
The original article just pointed out a basic coding flaw of having new within a loop. The using wasn't the bad part.
Re:Using the .NET HttpClient class wrongly can destabilize s...
by scotty79 on Wednesday August 31, 2016 @11:54AM
(#12399218)
I tried to reuse entity framework context as if it was db connection and it ended in eveything working but occasionally producing bizzare errors that went away only when I created at least one context per method.