Click here to Skip to main content
15,891,905 members

Survey Results

Writing C++ on the .NET CLR   [Edit]

Survey period: 30 Jul 2001 to 5 Aug 2001

The .NET CLR provides you with a lot of convenience, but for a C++ programmer that may not always be good. When writing C++ code on the CLR, what feature is most important for you (submitted by Walter Sullivan, Microsoft)

OptionVotes% 
Fastest code execution10827.91
Control over object lifetime369.30
Complete ISO C++ implementation16542.64
Keep me from leaking memory4511.63
Make my code verifiable184.65
Other153.88



 
GeneralAfraid of real work..? Pin
AlexMarbus4-Aug-01 14:14
AlexMarbus4-Aug-01 14:14 
GeneralRe: Afraid of real work..? Pin
Christian Graus5-Aug-01 14:42
protectorChristian Graus5-Aug-01 14:42 
GeneralWhat is a CLR? Pin
Jason Douglas30-Jul-01 8:00
professionalJason Douglas30-Jul-01 8:00 
GeneralRe: What is a CLR? Pin
Tomasz Sowinski30-Jul-01 9:13
Tomasz Sowinski30-Jul-01 9:13 
GeneralFastest code execution vs Control over object lifetime Pin
Farhan Noor Qureshi29-Jul-01 20:00
Farhan Noor Qureshi29-Jul-01 20:00 
GeneralRe: Fastest code execution vs Control over object lifetime Pin
Chris Maunder29-Jul-01 23:01
cofounderChris Maunder29-Jul-01 23:01 
GeneralRe: Fastest code execution vs Control over object lifetime Pin
Alvaro Mendez30-Jul-01 6:20
Alvaro Mendez30-Jul-01 6:20 
GeneralRe: Fastest code execution vs Control over object lifetime Pin
AlexMarbus30-Jul-01 6:37
AlexMarbus30-Jul-01 6:37 
GeneralRe: Fastest code execution vs Control over object lifetime Pin
Alvaro Mendez31-Jul-01 7:59
Alvaro Mendez31-Jul-01 7:59 
GeneralRe: Fastest code execution vs Control over object lifetime Pin
AlexMarbus4-Aug-01 14:05
AlexMarbus4-Aug-01 14:05 
GeneralRe: Fastest code execution vs Control over object lifetime Pin
Alvaro Mendez4-Aug-01 16:52
Alvaro Mendez4-Aug-01 16:52 
GeneralRe: Fastest code execution vs Control over object lifetime Pin
Farhan Noor Qureshi30-Jul-01 9:37
Farhan Noor Qureshi30-Jul-01 9:37 
GeneralRe: Fastest code execution vs Control over object lifetime Pin
Chris Maunder30-Jul-01 13:35
cofounderChris Maunder30-Jul-01 13:35 
Do you feel that writing managed C++ doesn't give you control over 1, 2 and 3?

I've been thinking about your answer and a few questions have bubbled up in response.

How does having control over all 3 make for code that is easier to maintain? How does that ensure that you have a small memory footprint? How does not having those 3 mean a large starting footprint, that resources leak, and that memory is fragmented?

My thinking is this: if you write managed C++ and accept the use of the garbage collector, then you

1) still have full control over the (non-memory) resources an object uses
2) you still decide *when* an object will use memory resources (you just can't decide when that memory is free'd, unless you call for a global garbage collection)
3) You have no idea when an object is destroyed - but is this important (a serious question, not a rhetorical one)

Using the GC to handle memory means that you code is simpler and you won't have memory leaks, so it's easier to maintain and debug. The footprint size may be bigger because memory will hang around longer. This doesn't mean (necessarily) it will slow down over time (as compared with a comparable non-managed app). The slowdown will be at GC time. The time spent in garbage collecting will be the interesting factor here - but MS are aiming for it to take the same time as a page fault. Who knows.

Also, using a GC means that you still only allocate what you need, when you need (point 3.1). You still have to be careful with resources (which you allocate and release normally), and freeing references to memory so the GC can reclaim them - which means resource and memory leaks will (should!) not occur (point 3.2), and allocating memory on the managed heap actually means that fragmentation is vastly reduced, so page faults will be less and caching higher (and memory allocation much faster) (point 3.3).

[Note to MS: Please make out my 'covert salesman' paycheck to Chris c/- CodeProject]

cheers,
Chris Maunder (CodeProject)
GeneralRe: Fastest code execution vs Control over object lifetime Pin
Fazlul Kabir30-Jul-01 15:29
Fazlul Kabir30-Jul-01 15:29 
GeneralRe: Fastest code execution vs Control over object lifetime Pin
Chris Maunder30-Jul-01 17:17
cofounderChris Maunder30-Jul-01 17:17 
GeneralRe: Fastest code execution vs Control over object lifetime Pin
Farhan Noor Qureshi31-Jul-01 7:29
Farhan Noor Qureshi31-Jul-01 7:29 
GeneralRe: Fastest code execution vs Control over object lifetime Pin
Chris Maunder1-Aug-01 4:31
cofounderChris Maunder1-Aug-01 4:31 
GeneralISO... Pin
Pavlos Touboulidis29-Jul-01 18:43
Pavlos Touboulidis29-Jul-01 18:43 
GeneralRe: ISO... Pin
Christian Graus29-Jul-01 18:59
protectorChristian Graus29-Jul-01 18:59 
GeneralRe: ISO... Pin
Chris Maunder29-Jul-01 19:23
cofounderChris Maunder29-Jul-01 19:23 
GeneralRe: ISO... Pin
George29-Jul-01 19:37
George29-Jul-01 19:37 
GeneralNo new and delete? (was Re: ISO...) Pin
Andrew Peace31-Jul-01 11:06
Andrew Peace31-Jul-01 11:06 
GeneralRe: No new and delete? (was Re: ISO...) Pin
Chris Maunder31-Jul-01 12:22
cofounderChris Maunder31-Jul-01 12:22 
GeneralRe: No new and delete? (was Re: ISO...) Pin
2-Aug-01 4:22
suss2-Aug-01 4:22 
GeneralRe: ISO... Pin
Nemanja Trifunovic3-Aug-01 11:37
Nemanja Trifunovic3-Aug-01 11:37 

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.