🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: try catch question

#639
From: Rudy Velthuis [TeamB]
Date: Tue, 20 Jul 2004 19:47
33 lines
2711 bytes
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: <xn0dl07ajkmedb043-moderator@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!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> <40faddbc$1@newsgroups.borland.com> <xn0dkyerh1bs6700c-moderator@newsgroups.borland.com> <opsbga6xvjz4mody@tiwilhel>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,f80ee75cfac101b9
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Rudy Velthuis [TeamB]" <velthuis@gmail.com>
Subject: Re: try catch question
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>
Organization: TeamB
User-Agent: XanaNews/1.16.3.1
Date: Tue, 20 Jul 2004 21:47:22 +0200
Message-ID: <xn0dl07ajkmedb043-moderator@newsgroups.borland.com>
X-Realname: Rudy Velthuis (TeamB)
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr
 p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
X-Ref: newsgroups.borland.com ~XNS:0000407F
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 80.135.220.97
X-Trace: newsgroups.borland.com 1090352553 80.135.220.97 (20 Jul 2004 12:42:33 -0700)
Lines: 33
X-Authenticated-User: rvelthuis
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail