Click here to Skip to main content
14,304,027 members
   

C#

 
GeneralRe: Is the "using" statement really a good idea? Pin
Dave Kreskowiak30-Jul-19 8:21
mveDave Kreskowiak30-Jul-19 8:21 
GeneralRe: Is the "using" statement really a good idea? Pin
MSBassSinger30-Jul-19 8:47
professionalMSBassSinger30-Jul-19 8:47 
GeneralRe: Is the "using" statement really a good idea? Pin
Dave Kreskowiak30-Jul-19 13:16
mveDave Kreskowiak30-Jul-19 13:16 
AnswerRe: Is the "using" statement really a good idea? Pin
OriginalGriff30-Jul-19 8:06
protectorOriginalGriff30-Jul-19 8:06 
GeneralRe: Is the "using" statement really a good idea? Pin
MSBassSinger30-Jul-19 8:19
professionalMSBassSinger30-Jul-19 8:19 
GeneralRe: Is the "using" statement really a good idea? Pin
OriginalGriff30-Jul-19 9:44
protectorOriginalGriff30-Jul-19 9:44 
GeneralRe: Is the "using" statement really a good idea? Pin
MSBassSinger30-Jul-19 9:50
professionalMSBassSinger30-Jul-19 9:50 
GeneralRe: Is the "using" statement really a good idea? Pin
Dave Kreskowiak30-Jul-19 13:19
mveDave Kreskowiak30-Jul-19 13:19 
MSBassSinger wrote:
But easier does not always lead to better, more reliable, or less buggy. For the small amount of extra effort to use try-catch-finally, it seems to me to be worth the effort. I've run into objects created via the using statement that left me with odd behavior that could not be stepped through in a using statement. But once I did away with the using statement, and used try-catch-finally, I found the problem and corrected it within minutes. So to avoid these unnecessary, but rare issues, I don't take shortcuts like the using statement. I realize the responsibility is 100% on me to cleanup the objects I create, and I am OK with that.

Then don't use a using. It's your preference.

You seem to be looking for someone to refute your case for avoiding using. That's not going to happen.

AnswerRe: Is the "using" statement really a good idea? Pin
MSBassSinger30-Jul-19 10:09
professionalMSBassSinger30-Jul-19 10:09 
AnswerRe: Is the "using" statement really a good idea? Pin
Gerry Schmitz31-Jul-19 4:32
mveGerry Schmitz31-Jul-19 4:32 
Questioncapture the screenshot of desktop using C# Pin
Member 1454529529-Jul-19 22:41
memberMember 1454529529-Jul-19 22:41 
AnswerRe: capture the screenshot of desktop using C# Pin
OriginalGriff29-Jul-19 23:26
protectorOriginalGriff29-Jul-19 23:26 
AnswerRe: capture the screenshot of desktop using C# Pin
Afzaal Ahmad Zeeshan30-Jul-19 5:29
mveAfzaal Ahmad Zeeshan30-Jul-19 5:29 
QuestionCreating a struct dynamically Pin
Member 1452625729-Jul-19 21:48
memberMember 1452625729-Jul-19 21:48 
AnswerRe: Creating a struct dynamically Pin
OriginalGriff29-Jul-19 22:06
protectorOriginalGriff29-Jul-19 22:06 
AnswerRe: Creating a struct dynamically Pin
BillWoodruff31-Jul-19 14:28
mveBillWoodruff31-Jul-19 14:28 
SuggestionRe: Creating a struct dynamically Pin
Richard Deeming1-Aug-19 1:40
mveRichard Deeming1-Aug-19 1:40 
GeneralRe: Creating a struct dynamically Pin
BillWoodruff1-Aug-19 8:47
mveBillWoodruff1-Aug-19 8:47 
QuestionError when i try to add my control to form1 Pin
_Q12_29-Jul-19 8:30
member_Q12_29-Jul-19 8:30 
AnswerRe: Error when i try to add my control to form1 Pin
Richard Deeming29-Jul-19 9:10
mveRichard Deeming29-Jul-19 9:10 
GeneralRe: Error when i try to add my control to form1 Pin
_Q12_29-Jul-19 10:10
member_Q12_29-Jul-19 10:10 
GeneralRe: Error when i try to add my control to form1 Pin
Richard Deeming30-Jul-19 1:52
mveRichard Deeming30-Jul-19 1:52 
GeneralRe: Error when i try to add my control to form1 Pin
_Q12_30-Jul-19 7:58
member_Q12_30-Jul-19 7:58 
GeneralRe: Error when i try to add my control to form1 Pin
_Q12_29-Jul-19 10:34
member_Q12_29-Jul-19 10:34 
GeneralRe: Error when i try to add my control to form1 Pin
_Q12_29-Jul-19 22:10
member_Q12_29-Jul-19 22:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.