🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: try catch question

#640
From: Joe Mayo
Date: Wed, 21 Jul 2004 02:46
47 lines
3057 bytes
Rudy,

I'll bet you don't use foreach either out of fear that someone didn't
implement the IEnumerator type properly. ;)

Joe
-- 
Joe Mayo, Author/Instructor
Need C#/.NET training?
visit www.mayosoftware.com
C# Tutorial - www.csharp-station.com

"Rudy Velthuis [TeamB]" <velthuis@gmail.com> wrote in message
news:xn0dl07ajkmedb043-moderator@newsgroups.borland.com...
> At 21:31:35, 20.07.2004, Tor Iver Wilhelmsen (TeamB) wrote:
>
> > On Mon, 19 Jul 2004 12:57:58 +0200, Rudy Velthuis [TeamB]
> > <velthuis@gmail.com> wrote:
> >
> > > So, we know that because it is documented and because we can see the
> > > source. But that is an implementation detail.
> >
> > But the "detail" is important enough to warrant a separate language
> > feature (the "overloading" of the using keyword - the syntactic sugar
> > for try/finally). I'd say that is guarantee enough that it actually
> > will  clean up resources - including calling Close(). After calling
> > Dispose(),  after all, the object should be a candidate for garbage
> > collection.
>
> I can close items like streams or StreamWriters without actually
> disposing of them. I could reuse and reopen them, I guess.
>
> And I can't really say if I can do the reverse, i.e. disposing of a
> StreamWriter without closing it. That depends on what Close is supposed
> to do.
>
> So generally, one can't use one for the other. And I would not make an
> exception in this case. I think that would make code less maintainable
> and less enhanceable.
>
> So practically, it may not make a difference. But from a pure design POV,
> I think it is basically wrong to use one for the other.
> -- 
> Rudy Velthuis [TeamB]
>
> "Small minds run in the same gutter."
>  -- Alfred E. Neuman
Technical Details
Message-ID: <40fdd914$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!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> <40faddbc$1@newsgroups.borland.com> <xn0dkyerh1bs6700c-moderator@newsgroups.borland.com> <opsbga6xvjz4mody@tiwilhel> <xn0dl07ajkmedb043-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> <40faddbc$1@newsgroups.borland.com> <xn0dkyerh1bs6700c-moderator@newsgroups.borland.com> <opsbga6xvjz4mody@tiwilhel> <xn0dl07ajkmedb043-moderator@newsgroups.borland.com>
Subject: Re: try catch question
Date: Tue, 20 Jul 2004 20:46:50 -0600
Lines: 49
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: <40fdd914$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1090378004 67.176.122.65 (20 Jul 2004 19:46:44 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail