C# and C++ Past, Present, Future :: Software Engineer

G

Guest

Hello

I am a C++ programmer with limited experience (design) using C#. From my experience, C#, like Java, is a derivative of C++. However, Microsoft is able to blend C# and C++, getting the best out of the Java design

With the recent settlement between MS and SUN, I think that MS will remain the top desktop software company. Bottomline: C# should surpass Java given that it is in fact platform-independent

I have some basic questions on the C# language.

Currently, does a C# application run on a non-Win32/Win64 platform (UNIX, Mac, wireless)

How does C# compare to C++ in terms of object-oriental design (inheritance, template, etc) on a large-scale project

How does C# compare to C++ for client/server applications including various IPC concepts, multithreading, multiple processes, etc

How does C# compare to C++ for processor-intensive applications including games, 3D-render, multimedia, etc

I read some reviews on two books on C# by Jeff Prosise and Charles Petzold. In general, readers find the books GUI-oriented. How good is C# for performance-imperative applications

Thanks

Kuphryn
 
A

Adam W Root

What you need to recognize about C# over C++ is that it is managed. Managed
means overhead. C# is not derived from C++, no matter what anybody says. The
syntax has similarities, that is about it.

Performance is much slower than a C++ app, the footprint is much larger (in
terms of RAM and executable size). The benefit is that many of the complex
problems of software programming have been solved for you. That means higher
productivity. You can write games in C# and get decent results, but you
won't see any C# in Doom 3 or Half Life 2.

Yes, .NET apps can be run on Unix, etc. (http://www.go-mono.org/ or
http://www.go-mono.com/) I also saw an article awhile back about Microsoft
releasing a version of the framework for Unix-flavor OSes (don't quote me,
but someone has to be able to verfiy that).

..NET has many of the IPC problems solved as well. It is extremely (relative,
i know) easy to write client/server apps, n-tier apps, etc.

As far as OO, it is all in there. You mentioned templates... C# does not
support something like C++ templates, but (at a high level) this is supposed
to be addressed with generics in version 2 of the language.

So once again, you are trading productivity and mantainability for
performance when switching to C# from C++ (there are other tradeoffs, too,
you can explore those later).

Disclaimer: this is not a comprehensive list of features/pros/cons of the
language. Just wanted to give you an idea.

Adam

kuphryn said:
Hello.

I am a C++ programmer with limited experience (design) using C#. From my
experience, C#, like Java, is a derivative of C++. However, Microsoft is
able to blend C# and C++, getting the best out of the Java design.
With the recent settlement between MS and SUN, I think that MS will remain
the top desktop software company. Bottomline: C# should surpass Java given
that it is in fact platform-independent.
I have some basic questions on the C# language.

Currently, does a C# application run on a non-Win32/Win64 platform (UNIX, Mac, wireless)?

How does C# compare to C++ in terms of object-oriental design
(inheritance, template, etc) on a large-scale project?
How does C# compare to C++ for client/server applications including
various IPC concepts, multithreading, multiple processes, etc?
How does C# compare to C++ for processor-intensive applications including
games, 3D-render, multimedia, etc?
I read some reviews on two books on C# by Jeff Prosise and Charles
Petzold. In general, readers find the books GUI-oriented. How good is C# for
performance-imperative applications?
 
J

Jon Skeet [C# MVP]

Adam W Root said:
Performance is much slower than a C++ app, the footprint is much larger (in
terms of RAM and executable size).

Could you state what you mean by "much slower" here? For *certain*
tasks C# will indeed be significantly slower than C++. For many other
tasks, it will be about the same speed.

As for the footprint size: there's the hit of the CLR itself and the
libraries it needs, but after that the footprint shouldn't end up being
much larger in terms of data. Of course, garbage collection means it'll
usually be a bit bigger, but I don't *think* .NET types themselves take
up particularly more data than C++ types. The typical overhead in .NET
is 8 bytes per object - any idea what it is in C++? (I don't know, but
I doubt that it's less than 4, and wouldn't be surprised if it's 8
again.)

In terms of the actual executable size itself, I think C# ends up much
the same as C++, really.
Yes, .NET apps can be run on Unix, etc. (http://www.go-mono.org/ or
http://www.go-mono.com/) I also saw an article awhile back about Microsoft
releasing a version of the framework for Unix-flavor OSes (don't quote me,
but someone has to be able to verfiy that).

Yes, it's called ROTOR. See
http://www.pobox.com/~skeet/csharp/faq/#operating.systems
 
Q

q

C# lacks templates which C++ has.
Also missing is multiple inheritance.
C# supports ONLY single class inheritance,
but supports multiple interface inheritance.
However, you must implement the interface functions
yourself.

So far I found the lack of templates and multiple inheritance
major negatives about the language.
 
G

Guest

I often read about fully OO feature in languages including Java and C#.

How important is object-oriented paradigm?

Nonetheless, the good things seem to point to platform-independence rather than the OO paradigm.

How would you evaluate fully OO paradigm (C#, Java, etc) to a flexible programming language like C++ that gives the developer unsurpassed control without going to ASM?

Kuphryn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Seeking C# Engineer 1
Recommended C#/.NET Book 6
C/C++ programmer seeks C# book recommendation 3
C# vs. C++ 4
ASP, ASP.net, and C# 7
.NET/C# vs MFC 3
Replacing the c: drive 19
Future of C++ and .NET/WinFX 9

Top