C# vs C++

Started by
20 comments, last by Washu 13 years, 2 months ago
Hello everyone,
How come XNA was made in C# not C++? Many people know that C++ is much stronger than C# due to the fact that it is a lower level language. Also DirectX was originally made for C++ so using it in C# would mean that parts are begin cut off. So why C#?
Advertisement
Why C#? Because the following statement is false:


C++ is much stronger than C# due to the fact that it is a lower level language.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

C# is considered a more forgiving language. XNA was developed to enable hobbyist and indy game developers to compete with native games written for Microsoft platforms by the big(ger) studios.

Hobbyists/indies are more likely to trade things like full resource utilization for convenience and rapid development. For instance, using a garbage collected language vs managing memory explicitly.

DirectX is an API more than it is a language implementation of the API, you'll find bindings for many languages (including c#) that give you all the bells and whistles without "cut offs"
This topic reminds me of an old joke, "In C++ it's harder to shoot yourself in the foot, but when you do, you blow off your whole leg." — Bjarne Stroustrup

The comparison made was to C. Idea being that C is even lower level than C++, thus easier to make a mistake in.

I wonder if a similar statement can be made about C# and C++.

Actually if you read Bjarne Stroustrup's FAQ (on his homepage), he mentions C# and how he's not a fan of a languages closely integrated with a proprietary OS, but he doesn't really comment on the language's functionality.





Hello everyone,
How come XNA was made in C# not C++? Many people know that C++ is much stronger than C# due to the fact that it is a lower level language. Also DirectX was originally made for C++ so using it in C# would mean that parts are begin cut off. So why C#?


DirectX was not originally made for C++; it was made for C, and in fact the first few versions of DirectX were published before C++ was even officially a language. Doesn't that mean that using it from C++ would mean that parts are "begin cut off"? So why C++?
Mike Popoloski | Journal | SlimDX

...in fact the first few versions of DirectX were published before C++ was even officially a language.

That's not even close to right.

[quote name='Mike.Popoloski' timestamp='1296843943' post='4769634']
...in fact the first few versions of DirectX were published before C++ was even officially a language.

That's not even close to right.
[/quote]

Was it not standardized in 1998?
Mike Popoloski | Journal | SlimDX
C++ existed as a programming language long before it was ever made an ISO standard. The first commercial release of C++ was in 1985 which was the same year that the first C++ book "The C++ Programming Language" was published. Unless, you're claiming that it requires an ISO standard to be an official programming language, in which case you're saying that Java isn't officially a programming language.
Well I think XNA originally started as a replacement to managed DirectX, so the idea was for it to be managed code to begin with. A couple things fell out of this: letting Indies program for the XBOX 360, and XNA has become the 3D graphics API for the Windows phone.


Many people know that C++ is much stronger than C# due to the fact that it is a lower level language.
[/quote]

Well I disagree that C++ is much stronger. In fact, the language barely evolves while C# and .NET makes my life easier every couple of years. In the end, you want to unload work to the GPU, so small amounts of overhead from a managed language are pretty negligible.
-----Quat

in which case you're saying that Java isn't officially a programming language.


That wouldn't bother me at all B)
Mike Popoloski | Journal | SlimDX

This topic is closed to new replies.

Advertisement