WinFX: An All-Managed API
Subject:   .NET, Windows API and C
Date:   2004-04-13 15:48:48
From:   Eric_Mutta
Response to: .NET, Windows API and C

Your post was an interesting read. Hope you dont mind me throwing in my 1.3 cents (inflation adjusted 2 cents)

(Unless you really are working with that volume of data in your calculations, in which case a C application would use just as much memory.)

This is not entirely true, because C data types don't have as much overhead as some C# data types. E.g if the volumes of data were being represented by many individual objects, you pay (N * MinimumObjectSize) more in C#, ontop of the cost for the actual data itself.

I've got a .NET windows forms application running right now that I wrote. (It's a utility that takes syntax coloured code in RTF format and converts it into HTML.)...It's taking 14MB of memory, which is normal.

14MB for that kind of app is normal? Hmmm. I have a copy of Visual Studio.NET open on a C++ project with a hundred or so files. 20 of those files are open in the editor which does syntax colouring, code folding, smart indenting etc. All that along with the VS.NET GUI itself and its only using 16MB.

I have Adobe Acrobat Reader running within Netscape 7. Its rendering a 44 page PDF file complete with coloured fonts and some graphical elements. Total memory consumption? 20MB...This tells me that "a utility that takes syntax coloured code in RTF format and converts it into HTML" and consumes 14MB is definately not normal.

(It does automatic resizing of all the content, and interacts with the system clipboard. These are certainly more than 5 minute jobs in C. They are utterly trivial in C#.)

No - utterly trivial in .NET. You are comparing frameworks to languages. How long would the app take to build using the C subset in Managed C++? ;)

To give you a recent example, I worked on a rewrite of a system from VB6 to C#. It took three months to rewrite the system that had taken 3 years to write in VB...

Well, if you are rewriting a system you cant expect it to take the same time it took to write the system initially can you? Naturally it would take shorter because the design, algorithms etc are already in place and you are not starting from scratch, so the comparison of 3yrs to 3 months doesn't mean much.

You almost invariably end up writing far less code to get anything done. Less code means less initial work, fewer bugs, and lower maintenance costs.

Amen to that :-)