Click here to Skip to main content
15,906,645 members
Home / Discussions / C#
   

C#

 
GeneralRe: MeasureString bug or feature Pin
16-Aug-01 7:40
suss16-Aug-01 7:40 
GeneralC# Tutorials Pin
8-Aug-01 1:10
suss8-Aug-01 1:10 
GeneralRe: C# Tutorials Pin
David Cunningham4-Sep-01 15:32
cofounderDavid Cunningham4-Sep-01 15:32 
GeneralSending images in html mail Pin
Henk3-Aug-01 23:35
Henk3-Aug-01 23:35 
GeneralRe: Sending images in html mail Pin
Steve Maier5-Aug-01 3:52
professionalSteve Maier5-Aug-01 3:52 
GeneralA problem about "ResourceManager" Pin
fwy_beyond2-Aug-01 21:08
fwy_beyond2-Aug-01 21:08 
General.NET Control, OCX and Java Applet in HTML Pin
chenzhu29-Jul-01 20:24
chenzhu29-Jul-01 20:24 
GeneralC# and destructores Pin
Joaquín M López Muñoz26-Jul-01 5:00
Joaquín M López Muñoz26-Jul-01 5:00 
It is my understanding that C#, being a garbage collected language as Java is, does not have destructors.
What's funny about this is the not so commonly acknowledged fact that destructors are a programmer's friend cause they assure proper releasing of resources acquired during construction, regardless of the flow of control (exceptions included). So, not having to worry about memory leaks (which is what garbage collection is for, and what forces the absence of destructors) imply having to worry too much to avoid other types of leaks. Have you ever seen a robust snippet of code in Java (C# should look alike) managing with say SQL connections dealing with proper shutdown of those connections? Man, you got to put all the closing code on a finally statement, and moreover every closing statement wrapped by try{...}catch(Exception e){} things.
Lacking destructors often results in classes with open/close methods with which the programmer has to mimick what a compiler could achieve with constructor/destructors (and not forgetting to invoke a destructor method as a programmer is likely to).
In C++ nothing of this type happens, provided you are reasonably disciplined (or use properly destroyed classes) and stick to the Stroustrup's motto resource acquisiton is initialization (RAII).
Just wanted to know your opinions on this subject of C# lacking destructors because of the alleged merits of garbage collection. Also, as I'm no expert in this language some of you might know of additional techniques in C# to achieve the effects of RAII.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: C# and destructores Pin
Eric Gunnerson (msft)30-Jul-01 10:06
Eric Gunnerson (msft)30-Jul-01 10:06 
GeneralRe: C# and destructores Pin
Uwe Keim21-Aug-01 3:53
sitebuilderUwe Keim21-Aug-01 3:53 
GeneralRe: C# and destructores Pin
21-Aug-01 7:36
suss21-Aug-01 7:36 
GeneralRe: C# and destructores Pin
3-Sep-01 21:01
suss3-Sep-01 21:01 
GeneralProgramming C# - O'Reilly Pin
26-Jul-01 1:04
suss26-Jul-01 1:04 
GeneralRe: Programming C# - O'Reilly Pin
31-Aug-01 14:38
suss31-Aug-01 14:38 
GeneralRe: Programming C# - O'Reilly Pin
Mr. Tibbs26-Dec-01 6:21
Mr. Tibbs26-Dec-01 6:21 
Questionhow to compare string in C# Pin
25-Jul-01 11:44
suss25-Jul-01 11:44 
AnswerRe: how to compare string in C# Pin
Eric Gunnerson (msft)30-Jul-01 10:03
Eric Gunnerson (msft)30-Jul-01 10:03 
GeneralRe: how to compare string in C# Pin
fadi7-Dec-01 4:48
fadi7-Dec-01 4:48 
GeneralRe: how to compare string in C# Pin
Eric Gunnerson (msft)7-Dec-01 5:46
Eric Gunnerson (msft)7-Dec-01 5:46 
Generalc# and asp.net Pin
vrajesh shah25-Jul-01 2:35
vrajesh shah25-Jul-01 2:35 
Generalc# and asp.net Pin
vrajesh shah25-Jul-01 2:32
vrajesh shah25-Jul-01 2:32 
QuestionWhat is C#? Pin
iamhcj24-Jul-01 16:45
iamhcj24-Jul-01 16:45 
AnswerRe: What is C#? Pin
Christian Graus24-Jul-01 18:21
protectorChristian Graus24-Jul-01 18:21 
GeneralRe: What is C#? Pin
Paul Watson24-Jul-01 21:44
sitebuilderPaul Watson24-Jul-01 21:44 
GeneralRe: What is C#? Pin
Alexander Berthold24-Jul-01 23:38
Alexander Berthold24-Jul-01 23:38 

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.