O
Ollis
Christophe Lephay said:Most of the exceptions i have to deal with are because of broken invariants,
and i definitely don't want to catch them.
I'm not sure what your point really is : if you catch all exceptions, it is
poor coding. If you don't write production code like the one you posted,
then you shouldn't assume it was different for Peter, and qualifing his code
as being poor coding was pointless.
I never said anything about catch all exceptions. That came from you not me.
And all that was stated by me is what was that not knowing about all
exceptions in a given situation was *poor* programming. I guess you'll make
of it what you want in the defense of this other person.
Nobody said finally was always needed...
That's not how I read it.
...it is just needed when you use unmanaged resources, asp.net or not.
I don't have much use of finally either, because most of resources are
managed and i prefer using(...) otherwise. However, finally and using are
equivallent (as long as the class is IDisposable), but the code you posted
was not.
That's not true. You use a USING statement on an ADO.NET connection to a
databse server like Oracle and it blows with the connection open. The
application is keeping state while contiiously coming back to open a new
connection in the process. All that's going to happen is the database server
is going to run out of connections, unless one does something to close the
connection during the abort each time, because that USING is not doing it.