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

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


Date: Thu, 20 Jan 2005 10:43:09 -0600


"Gerry Hickman" <gerry666uk@yahoo.co.uk> wrote in message
news:eVJiDkn$EHA.3596@TK2MSFTNGP12.phx.gbl...
> Hi Daniel,
>
>>>OK, try deleting all the COM interface CLSIDs from the registry of a test
>>>workstation, then run a full-featured fully managed .NET application on
>>>it. Does it work?
>
>> Likely not, as the windows forms architecture wraps a number of activex
>> controls,
>
> OK, now we're getting somewhere.
>
> > if memory serves(also, fwiw, on some systems the system may well
>> be using COM to host the CLR). Outside of that, a pretty large portion of
>> code can be run without using COM,
>
> OK.
>
>> Now, tell me, does what one would call a full featured C++ app run? Not
>> one written to avoid using COM,
>
> No, but the difference is that C++ does not pretend to be "new" or
> "different" or "cutting edge" or "independent of COM", whereas .NET does.
> Someone recently commented in this group "COM must die", so I just want to
> get the facts straight.

C++ cannot pretend to be new...but I'd bet that it did years back when it
was new. Every single app in existance that claims to be written in C++
actually interfaces with C and assembly code somewhere within the operating
system(and windows apps using COM may well be accessing VB6 or using dlls
may be calling into delphi). So are you sure it actually doesn't pretend to
be something?

Also, where did you hear the .NET framework is independent of COM? .NET is
the next step of COM and if you dig deep enough into the .NET runtime you'll
find references *to* COM3, as .NET was once known. The two are entirely
inseperable.

Classic COM has some huge weaknesses: VARIANT, no overloading, and it was
hell to write without either alot of knowledge or alot of templates to do
the work for you. .NET fixes all of those, increases portability(no
recompilation for 64 bit systems, most of the time(it is possible to compile
for 32 or 64 bit processors in some circumstances for performance reasons)),
and retains backwards compatibility with both COM and the classic Win32 api.
What disgusts me most about your claims is that while C++ is accessing
librarys and COM for functionality, you seem to think that that is ok and
means that functionality is only available to C++, while no other language
shoudl be allowed to access it. That really smacks of a level of arrogance.
>> (I mean come on, half of the STL is a facade for underlying interfaces as
>> well).
>
> Again, the difference is, that it does not claim to be otherwise...

Nor does .NET, it certainly isn't my fault if you think it does. I would bet
most people think the STL isn't a facade either.

>> I don't recall if there are any examples or not, I was toying with it
>> ages ago and I'm pretty sure I got managed code to work with it. Again,
>> if your definition of "pure" is no COM interop,
>
> Yes of course I'm excluding COM interop! If you say "C#.NET can do this
> and C#.NET can do that", then obviously we're talking about what Nick

Which, frankly, is stupid, and this argument is losing its point quickly. If
your standards are this high the only way any language but C++ can be
relevent would be to entirely throw C++ away and start from scratch...I
don't know about you but I'm not interested in
> The bottom line is back to where we started. .NET is "limited". It can't
> do video capture and it can't manage Local Security Policy and it would
> not surprise me if v2.0 is just as bad.
>

Neither can C++...without access to a library. Its not like C++ inherently
has the ability to modify your local security policy, it has to call a
system API, period. C++ lacks this ability as well.
C++ cannot inherently do video capture either, since you have to import COM.

>> PURE as in no unmanaged code? If that is your definition of pure a
>> managed executable couldn't even execute, since the JIT is written in
>> unmanaged code.
>
> Obviously I'm talking about "within the .NET environment", not what goes
> on behind the scenes. What use is it, if you have to keep making calls to
> COM and unmanaged code everytime you need to do something useful? There's
> also too much of it that's dependent of certain operating systems being
> installed (e.g. WIA on XP).

I guess our opinoins of useful are different. I know your examples are
blindingly obviously designed to get the answer you want. No, I cannot write
anything in .NET without calling the API, since it has to call VirtualAlloc
or CreateFile eventually to do something. However I can do plenty of useful
stuff without accessing COM, I do it every day.

> You mean reverse engineer it? I actually received Cleaner with Adobe
> Premiere but quickly uninstalled it as I disliked it in quite a serious

It doesn't take much, the version stamp would have been enough to figure it
out.

> way. I prefer open source tools for encoding/decoding.

Not a surprise, can't say I expected any different(you strike me as an open
source guy)

>
>> developers had for a long time, the concept of C++ ever becoming
>> irrelevent was pretty far fetched up until right about the 2ghz barrier
>> was broken(atlesat for me). At this point you can see that eventually it
>> will die off, perhaps even in your lifetime
>
> That's fine with me if it dies off, provided we have a viable
> alternative - at present we do not. For example do you think we'll be
> seeing the next version of Adobe InDesign or Photoshop written in .NET, or
> how about Quake v4?? You are claiming that .NET is just as powerful and
> just as fast so the above should work just fine...
>

I never claimed either, and if you recall I told you that video encoding
wouldn't be valid because of runtime deficencies. That goes equally well for
other high performance apps....(also, since you consider DirectX off limits,
its pretty hard to write a game since you can't draw to the screen).

However, heres the rub. I use photoshop about 1/100th as often as I use
Outlook or Word or IM programs, each of which would run in managed code
without much of an issue. So why is C++ that important if its usage is only
needed in an app I run less often than I run anything on my machine?

>> Anyway, the question is not can .NET operate without C++, but can .NET
>> replace C++ in some of its old domains(in other words, is it relevent?).
>
> I think it was really good for server side web, but even that's becoming
> more of a mess than it should be, due to disparate framework versions and
> certain features being tied to certain o/s versions.
>

Again I do wonder if you have any real knowledge of the system or just
preinclinations.

And, like Nick before me, I am finished with this conversation. You have
quite clearly already made up your mind(despite your protests you'd like to
be convinced) and I don't believe this discussion will get anywhere. You
will refuse to see any point I make.

I must say I have been disappointed in your arguments...they range from
irrelevent to wrong.



Relevant Pages

  • Re: Windows CE API hooking in C# or .NET CF
    ... exported functions in a DLL to accomplish this and managed code on Windows ... of course you can do that from managed code. ... Windows CE API Interceptor" by Dmitri Leman in Dr. Dobbs Journal, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Customizing Windows with C#
    ... IMHO even in cpp and native programing this is done via hooks there is no ... I doubt it can be done from pure managed code. ... You would have to do some heavy API work> though. ... >> Thank you for response, but the question is "How to change ALL e.g dialog>> boxes in current Windows installation, not just in my project". ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: newbe about API
    ... Emne: Re: newbe about API ... > I found all these API-CALL strings are finally compiled to ... more than that...and Windows simply takes this to an extreme that this ... DLL, when a weak point is found (which, with Microsoft, is something ...
    (alt.lang.asm)
  • Re: In the Shallow End
    ... When a document claims how an API is supposed to be used and then gives the user examples that actually work, ... Vague in your instance means you have no context to VMS or UNIX of that era. ... Windows offers lots of this stuff. ... That's why Apple had to dump a whole paradigm to plunge ahead and take the lead. ...
    (comp.sys.mac.advocacy)
  • Re: Interpreting a BAS module
    ... unicode and ansi strings. ... applications make calls out to Windows to ask it to do something (e.g. ... you have to utilize an API that is designed to ... AddressOf is also used in subclassing. ...
    (microsoft.public.vb.general.discussion)