Tagged Questions
8
votes
7answers
598 views
Best practice regarding returning from using blocks [duplicate]
Which way is better practice: return a value from a method inside an using statement or declare a variable before, set it inside and return it after?
public int Foo()
{
using(..)
{
return ...
7
votes
5answers
252 views
A question of style/readability regarding the C# “using” statement
I'd like to know your opinion on a matter of coding style that I'm on the fence about. I realize there probably isn't a definitive answer, but I'd like to see if there is a strong preference in one ...
6
votes
2answers
1k views
Use of Process with using block [duplicate]
Possible Duplicate:
What happens if I don't close a System.Diagnostics.Process in my C# console app?
As System.Diagnostics.Process inherits from Component which implements IDisposable, ...
2
votes
2answers
1k views
Using Statement with more than one system resource
I have used the "using" statement in both C# and VB. I agree with all the critics regarding nesting using statements (C# seems well done, VB not so much)
So with that in mind I was interested in ...