Advertisement

C++ versus C#

Started by September 29, 2002 09:04 AM
2 comments, last by cyssis 22 years, 1 month ago
Although this isn''t really a newbie question, I didn''t want to flood the other forums. I''ve been programming in C and C++ for about 4 years now and have them, as well as DirectX and COM, down pretty well. I was wondering if anyone has any experience with C#, and if it''s worth the work learning the new structure. Specifically: Does it offer good support for the low-level functions like C and C++ does? Is it backwards compatible with current C and C++ libraries (eg. do I have to reprogram all of my current code libs?) Hmm... guess that''s pretty much it. Thanks a lot.
If you''re talking about programming games in C#, don''t even bother. It doesn''t support DirectX (in its current version), and it is somewhat slower due to its garbage collection features.

On the other hand, it''s very cool to make Windows apps with it. It acts exactly like Visual Basic, except with a simplified version of C++ as the code. So, if you''re tired of writing Windows apps in C++ and don''t like VB, you could give C# a shot.
Advertisement
Learning new languages (not just C# ... and not just programming languages) is ALWAYS a good thing, as it opens your mind to new techniques and ways of thinking. And gives you the freedom to decide what language suits your needs in a specific situation.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
I suggest you read this thread from the MS C# ng initiated by Tim Sweeney(lead programmer on Unreal): http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&safe=off&th=9e460068ff5d4080&rnum=1

Some of the highlights:


Philip Taylor - Microsoft Program Manager - DirectX:
> Does Microsoft take the possibility of using C# for game development
> seriously? It seems like it could be considered either as a gameplay
> scripting language or as a full-blown development language once DirectX9
> ships with full .NET support.

Yes to both.

We hope our wrapper layers'' perf is such that folk would consider using
Managed DX for full blown development, not just tools and scripting.

--

note that M(anaged)D(irect)X avoids managed types, and thus avoids the managed heap and the
GC so we dont have this non-determinstic perf behavior.

I have also seen a statement by some official(the same Phil Taylor, I believe) saying that the performance of MDX would be over 95% of that of ''raw'' DirectX(eg - used from C++).


The world holds two classes of men -- intelligent men without religion, and religious men without intelligence. - Abu''l-Ala-Al-Ma''arri (973-1057; Syrian poet)
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]

This topic is closed to new replies.

Advertisement