Re: a pre-beginner's question: what is the pros and cons of .net, compared to ++

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Daniel O'Connell [C# MVP] (onyxkirx_at_--NOSPAM--comcast.net)
Date: 01/17/05


Date: Mon, 17 Jan 2005 07:53:32 -0600


> > C# code is very fast
>> as well, since it is compiled to the machine level by the framework.
>
> Yes, but what about the FrameWork objects themselves? How many of them are
> just wrappers around COM objects?

Less then one might expect. I would wager that in the average window app the
amount of COM interfaces being called would be roughly equal between
framework wrappers and C++ templates, with the C++ code potentially
producing more COM interfaces(for example if you write an ActiveDocumentHost
or the like, pretty sure one of the standard windows templates does...just
forget if its MFC or WTL).

Also, out of curiosity, how does wrapping a COM object change cause code to
not be machine code?

<snip>

> I notice you avoided the question about writing a video capture (or video
> editing) application with .NET - will this be ready for Longhorn?
>

Actually, you can do both now, although video editing is more complicated as
there are no clean, predefined interfaces to access DirectShow or any of the
rest of the windows codec framework. That doesn't mean tehy cannot be, it
just means you would have to do some work to do it(similarly, if the C++
headers from DirectX didn't expose any DirectShow types you'd have to
manually define the interfaces and provide classes to call them, not really
fun stuff eh?). Don't mistake the functionality not being there in the
standard package as an impliciation the function cannot be achieved. If so
C++ is pretty weak in and of itself as well.

Simple capture is maybe 200 lines of code(plus some generated interface
definitions), but only works with WIAs video acquisition mode, and thus only
with WIA capable input devices. The more complicated, DirectX capture
mechanisms would require considerably more...probably somewhere along the
lines of what you'd have to write in C++ without templates for COM support.

Now, video encoding and decoding is not something that is appropriate in
managed code as it stands now. The current JITs don't deal with SIMD
instructions well, if at all, and the runtime currently has no way to
express the concepts SIMD uses(note that C++ really doesn't nativly either,
the compiler adds extensions). Without this type of support in the runtime,
the JIT has to guess when its appropriate to attempt such work...its just
not fesible.

However, the only thing this shows, and the only thing much of your
arguments have shown, is that it is maturity, not inherent capability at
question here. C++ and x86(or any other existing CPU architecture, excluding
IA64) are quite mature, C# and the .NET VM is not(although the .NET VM was
based off java's VM, java's VM seems to have gone to great lengths to avoid
maturing its instruction set, lest incompatibilities come about).

The VM needs certain features, like a more controllable garbage collecter
and a better way to express paralelled or paralellable code. The languages
need certain features as well, including better ways to manage resources.
However the need for those features will be solved.

Anyway, as for video tools, I know of only one app written in managed code
and that only provides its UI and some other bits(I can't say I understand
exactly whats managed and whats not, most of the unmanaged stuff looks like
codecs), but that would be CleanerXL, by Discreet:
http://www4.discreet.com/cleanerxl/cleaner.php?id=124



Relevant Pages

  • Re: a pre-beginners question: what is the pros and cons of .net, compared to ++
    ... since it is compiled to the machine level by the framework. ... interfaces still should be written in C++. ... IBM wanted the new OS to have all the newest technology and a better ... Microsoft produced two lines of Operating systems that allowed ...
    (microsoft.public.dotnet.general)
  • Re: a pre-beginners question: what is the pros and cons of .net, compared to ++
    ... Framework is filling in a very large number of the useful calls that were ... Web controls will run on newer ... XML and various CGI/ISAPI interfaces. ... > certainly don't need .NET to run web services. ...
    (microsoft.public.dotnet.general)
  • Re: SP3 potential problem
    ... I uninstalled the last of the MSN.net framework files. ... I then reinstalled the video driver. ... download the Net framework updates. ...
    (microsoft.public.windowsxp.basics)
  • Re: AJAX Toolkit 3.5 on VS.NET 2008 RTM?
    ... All the projects in the solution are set to the Framework 3.5 and there ... Assembly versions are correct except "TemplateVSI" Assembly and when I go to ... Thanks for the info for the video, however I have installed AJAX tool kit ... Toolkit Web Site" template when I create a new web site or I can just ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.NET and .NET Framework 2.0
    ... anything to say about the framework interferring with video drivers or video ... This is why you may need to uninstall all releases of the framework. ... installing/uninstalling programs in my pc as some people do, ...
    (microsoft.public.dotnet.framework.aspnet)