🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.language.csharp
Article #628

Re: try catch question

#628
From: Joe Mayo
Date: Sun, 18 Jul 2004 20:30
33 lines
2370 bytes

"Rudy Velthuis [TeamB]" <velthuis@gmail.com> wrote in message
news:xn0dkx9y9ftcjf013-moderator@newsgroups.borland.com...
> At 21:53:14, 17.07.2004, Lord Crc wrote:
>
> > On Sat, 17 Jul 2004 11:23:16 -0400, "Marc Rohloff [TeamB]" <"on
> > request"> wrote:
> >
> > > It is also incorrect.
> >
> > Why not use "using" ? it's SOOO nice for these type things.
>
> We discussed this before. Using calls IDispose.Dispose(), and not
> Close(). Technically there may be no big difference, but semantically,
> there is. I personally would not rely on the fact that both would do
> exactly the same, since both (or a descendant class) don't *have* to do
> exactly the same.


Sure, Close and Dispose are two different methods, but in the .NET
Framework, Close methods call the Dispose method.  That is the pattern, it
is fairly well known by now, and anyone that doesn't follow the Dispose
pattern properly needs to be educated.  IMO, the benefits of the "using"
statement in code clarity and maintenance far outweigh the small risk of
someone not implementing thier Dispose pattern properly.

Joe
-- 
Joe Mayo, Author/Instructor
Need C#/.NET training?
visit www.mayosoftware.com
C# Tutorial - www.csharp-station.com
Technical Details
Message-ID: <40faddbc$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <40f3748e@newsgroups.borland.com> <40F380DB.819CE161@midnightbeach.com> <40f934bb$1@newsgroups.borland.com> <s3am1jplg0p9$.dlg@marcrohloff.40tude.net> <is0jf0l76g610ajlns5154ij25vantsvp6@4ax.com> <xn0dkx9y9ftcjf013-moderator@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,f80ee75cfac101b9
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Joe Mayo" <jmayo@nospam.mayosoftware.com>
Newsgroups: borland.public.csharpbuilder.language.csharp
References: <40f3748e@newsgroups.borland.com> <40F380DB.819CE161@midnightbeach.com> <40f934bb$1@newsgroups.borland.com> <s3am1jplg0p9$.dlg@marcrohloff.40tude.net> <is0jf0l76g610ajlns5154ij25vantsvp6@4ax.com> <xn0dkx9y9ftcjf013-moderator@newsgroups.borland.com>
Subject: Re: try catch question
Date: Sun, 18 Jul 2004 14:30:10 -0600
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 67.176.122.65
Message-ID: <40faddbc$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1090182588 67.176.122.65 (18 Jul 2004 13:29:48 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail