473,811 Members | 4,039 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Poll" Has C# Generally Replaced C++

Is it your general opinion that C# is generally designed/intended/ready to
replace C++? I know the answer is not black and white but please repond YES
or NO (add any comments if you would like)

I just thought it might be interesting to get a tally. This is related to a
previous thread. So far we have two NOs from "aa" and Bo Persson.

--
Greg McPherran
www.McPherran.com
Dec 10 '05
71 3189
Bo Persson wrote:
"Tamas Demjen" <td*****@yahoo. com> skrev i meddelandet
news:uZ******** ********@TK2MSF TNGP09.phx.gbl. ..
Bo Persson wrote:
[...]
So, I claim that ISO C++ is not C, because it adds a lot and changes
some parts of the language. So does Java, and so does C++/CLI. They
all have some parts in common, but a lot of differences too. That
makes them all separate languages.


I have another point to add to the Java compiler comparison:

The Java compiler cannot compile C++ code, the C++ compiler cannot
compile all C code (C99 e.g.), but the same executable which holds the
C++/CLI compiler can compile all C++ code, if the language extensions
are not enabled by a compiler switch.
Not the same language (perhaps - as I already stated in the other
thread) but the same compiler ;-) - meaning the same executable holds
the C++/CLI compiler and the C++ compiler.

ISO C++ != ECMA (ISO in near future) C++/CLI, but
a C++/CLI compiler must also be a C++ compiler that can compile all C++
code if the C++/CLI extensions are not used for a certain piece of code.

Perhaps we have just different viewpoints ;-) - a C++/CLI compiler with
disabled C++/CLI extensions isn't a C++/CLI compiler anymore for you.
For me (and Tom) it's still a C++/CLI compiler with disabled extensions
and therefore 100% compliant to the C++ compiler.
Bo Persson


Andre
Dec 17 '05 #61
How about:

typedef int[] Int_Array_A ;
typedef std::vector<int > Int_Array_B ;

How about those syntactical apples (vs. syntactical oranges?)!!! lol

[==P==]

"Greg" <gm@mcpherran.c om> wrote in message
news:94******** *************** ***********@mic rosoft.com...
"Bo Persson" wrote:

std::vector<int > x;


std::vector<int > x;

vs.

int[] x;

I rest my case :-)

Dec 19 '05 #62
> And yet Microsoft experiments with a research operating system written in
C#.
The main difference between C++ and C# is that C++ is in the public domain
and C# is owned by MS. Is there any wonder why they will at least *try* to
do everything in C#? : )

[==P==]

"Andre Kaufmann" <an************ ****@t-online.de> wrote in message
news:e6******** ******@TK2MSFTN GP11.phx.gbl... William DePalo [MVP VC++ ] wrote:
"Greg" <gm@mcpherran.c om> wrote in message [...]
No, it is not.

In a few years it may be the language most often used to _build_
applications for Windows, but the operating system and its drivers will
continue to be written in C or C++ for the near term at least.


And yet Microsoft experiments with a research operating system written in
C#.
Regards,
Will


Regards,
Andre

Dec 19 '05 #63
> But nobody uses types like int[] anymore for function arguments -- you
simply pass int*.
You calling MS a nobody? : )

They use precisely this syntax with their Graphics class draw functions that
require a list of Point[]:

http://msdn2.microsoft.com/en-us/lib...awpolygon.aspx

[==P==]

"Tamas Demjen" <td*****@yahoo. com> wrote in message
news:Oh******** *****@tk2msftng p13.phx.gbl... Greg wrote:
e.g. int[] x; v.s. int x[];


int[] x;
vs
cli::array<int> x;

I agree, the original designers of C could have separated the type a
little bit better. But nobody uses types like int[] anymore for function
arguments -- you simply pass int*.
C# has the advantage of practical "non-rushed" thinking in its design.


And yet it doesn't support such basic features as constants and constant
member functions. No destructor (!!!) means no RAII, which is big problem
when an object holds a resource. You can't create a class on the stack. No
operator overloading, no templates. You can't even declare a pointer and
increment it. And so on, I could continue.

Tom

Dec 19 '05 #64
On Wed, 14 Dec 2005 16:25:01 -0800, "Greg" <gm@mcpherran.c om> wrote:
There are some cases where C++ is the only option: e.g. a pure native
Windows App with no .NET Runtime required.


I don't think this is the case any more. It appears that MS has not
provided any way to install the required DLLs for a native app without
forcing install of the runtime. I've run into several cases where
native apps won't run, even with the native DLLs in System32 as has
been the convention forever.

MS claims you have to use the correct installation ritual (see your
Windows\WinSxS folder).

So...it appears that installation of the .NET runtime is forced even
if it is not used. Anyone know of any workaround for this?

Dec 21 '05 #65

"Dave" <Da**@noemail.c om> wrote in message
news:fn******** *************** *********@4ax.c om...
On Wed, 14 Dec 2005 16:25:01 -0800, "Greg" <gm@mcpherran.c om> wrote:
There are some cases where C++ is the only option: e.g. a pure native
Windows App with no .NET Runtime required.


I don't think this is the case any more. It appears that MS has not
provided any way to install the required DLLs for a native app without
forcing install of the runtime. I've run into several cases where
native apps won't run, even with the native DLLs in System32 as has
been the convention forever.


This is incorrect.

I have no trouble running native apps on machines without the .NET
Framework. If native apps don't run, there is a reason, independent of the
..NET Framework. Usually one can use a tool like depends.exe to find out what
dependent DLL's are missing on the target system, and then install them
manually.

If one wants a more elaborate deployment with regards to VS2005, there are
some merge modules that can be used to install just the C++ CRT, or just the
ATL80 support, for example. Again, the .NET Framework is not required.

http://blogs.msdn.com/nikolad/archiv...02/460368.aspx
http://msdn2.microsoft.com/en-us/library/ms235317.aspx

I hope others aren't misled by the previous post.

Brian
Dec 21 '05 #66
Brian is absolutely right. It is absolutely possible with VS2005 to build
and deploy to another computer apps with only native code following
documented steps.

Nikola

--
Nikola Dudar
Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Suggestions? Bugs? Talk directly to dev teams using
http://lab.msdn.microsoft.com/productfeedback/
My Blog - http://blogs.msdn.com/nikolad/
"Brian Muth" <bm***@mvps.org > wrote in message
news:Ob******** ******@tk2msftn gp13.phx.gbl...

"Dave" <Da**@noemail.c om> wrote in message
news:fn******** *************** *********@4ax.c om...
On Wed, 14 Dec 2005 16:25:01 -0800, "Greg" <gm@mcpherran.c om> wrote:
There are some cases where C++ is the only option: e.g. a pure native
Windows App with no .NET Runtime required.


I don't think this is the case any more. It appears that MS has not
provided any way to install the required DLLs for a native app without
forcing install of the runtime. I've run into several cases where
native apps won't run, even with the native DLLs in System32 as has
been the convention forever.


This is incorrect.

I have no trouble running native apps on machines without the .NET
Framework. If native apps don't run, there is a reason, independent of the
.NET Framework. Usually one can use a tool like depends.exe to find out
what dependent DLL's are missing on the target system, and then install
them manually.

If one wants a more elaborate deployment with regards to VS2005, there are
some merge modules that can be used to install just the C++ CRT, or just
the ATL80 support, for example. Again, the .NET Framework is not required.

http://blogs.msdn.com/nikolad/archiv...02/460368.aspx
http://msdn2.microsoft.com/en-us/library/ms235317.aspx

I hope others aren't misled by the previous post.

Brian

Dec 22 '05 #67
Dave wrote:
On Wed, 14 Dec 2005 16:25:01 -0800, "Greg" <gm@mcpherran.c om> wrote:
There are some cases where C++ is the only option: e.g. a pure native
Windows App with no .NET Runtime required.


I don't think this is the case any more. It appears that MS has not
provided any way to install the required DLLs for a native app without
[...]


If you statically link the CRT you won't have any problems to run your
native executables on WinXP / Win2K.
If you want to deploy executables dynamically linked to the C runtime,
there's perhaps an interesting article for you:

http://www.codeproject.com/useritems/vcredists_x86.asp

Hope that helps.

Andre
Dec 22 '05 #68
I donīt think that C# will replace C++. As long as you need to deliver the
Redist with, I donīt know exactly how much but too much MBīs, for a simple
application with just about 10kB this thing canīt be used for all customers.
Another thing is this Garbage Collector, where MS says that they handle the
memory. But I can say that the memory isnīt handle correctly and when you
have a big Application (C#) with forms you can reboot your computer at least
every 2 days because the Memory Usage increases.
Mono is just half of the game unless they implement forms -> if you have to
work on other plattforms too, you have to use c++.

ElBarto

"Andre Kaufmann" <an************ ****@t-online.de> schrieb im Newsbeitrag
news:eN******** ******@TK2MSFTN GP10.phx.gbl...
Dave wrote:
On Wed, 14 Dec 2005 16:25:01 -0800, "Greg" <gm@mcpherran.c om> wrote:
There are some cases where C++ is the only option: e.g. a pure native
Windows App with no .NET Runtime required.


I don't think this is the case any more. It appears that MS has not
provided any way to install the required DLLs for a native app without
>[...]


If you statically link the CRT you won't have any problems to run your
native executables on WinXP / Win2K.
If you want to deploy executables dynamically linked to the C runtime,
there's perhaps an interesting article for you:

http://www.codeproject.com/useritems/vcredists_x86.asp

Hope that helps.

Andre

Dec 22 '05 #69
MasterChief wrote:
I donīt think that C# will replace C++. As long as you need to deliver the
Redist with, I donīt know exactly how much but too much MBīs, for a simple
application with just about 10kB this thing canīt be used for all customers.
Currently yes but, Windows Vista (will have) and Win2003 has the runtime
pre-installed.
Also if you have an ATI graphics card and are using the Catalyst Center
you will have the framework installed.

Another thing is this Garbage Collector, where MS says that they handle the
memory. But I can say that the memory isnīt handle correctly and when you
have a big Application (C#) with forms you can reboot your computer at least
every 2 days because the Memory Usage increases.
Perhaps you have a resource problem ? GC handles memory but not
necessarily resources.

Mono is just half of the game unless they implement forms -> if you have to
work on other plattforms too, you have to use c++.
C++ ? There are platform independent GUI frameworks for C++ as there are
for C#. WinForms surely not.

C# won't replace C++ (yet), but it will have also a huge user base and
regarding the .NET framework it doesn't matter (that) much in which
language you are developing.

And native code isn't necessarily faster:

E.g.: http://www.grimes.demon.co.uk/dotnet/man_unman.htm

ElBarto
[...]
Andre


Andre
Dec 22 '05 #70

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.