Visual C++.net vs Visual C#.net

Started by
49 comments, last by Drilian 16 years, 11 months ago
Quote:Original post by RyanZec
Also, One point about what I do like about C++ is that you do have more control and have the ability to add ASM code with in your project to gain a little extra speed.
The option is there, yes. But I'll be very surprised if you can show me any assembly you've written which turns out to run faster than C/C++ code generated by the compiler (Not MSVC 6, don't even go there) [smile]
Advertisement
Should be ...
Quote:Original post by Evil Steve
The reason I use C++ rather than C# is that C# doesn't run on anything but Microsoft operating systems (Except Mono). That means no consoles except the 360, and even then the C# code is much less efficient.


I would completely recommend C++, simply due to the sheer amount of support, libraries, IDEs, APIs, and sheer amount of information available for it that don't exist in C#.
Bah! All this talk about speed, more control, efficiency...

Isn't there more people like me, who choose to code in C++ because they simply *love* C++ ?
Yes, you heard me right! I *love* C++!
Quote:Original post by Evil Steve
Quote:Original post by RyanZec
Also, One point about what I do like about C++ is that you do have more control and have the ability to add ASM code with in your project to gain a little extra speed.
The option is there, yes. But I'll be very surprised if you can show me any assembly you've written which turns out to run faster than C/C++ code generated by the compiler (Not MSVC 6, don't even go there) [smile]



I could not because I can't write ASM code but from what other programmers tell me they can write math libraries in ASM that would be faster than C++, not much faster minf you, but faster.

Quote:Original post by Paulius Maruska
Bah! All this talk about speed, more control, efficiency...

Isn't there more people like me, who choose to code in C++ because they simply *love* C++ ?
Yes, you heard me right! I *love* C++!

I'm like that. I love C++, but I think my addiction to template metaprograming keeps me from picking up a C# book. I need to learn it, but I find the flexibility of C++ much more alluring than the ease of C#. It probably doesn't help that I tend to be masochistic when it comes to working on projects.

I also have invested much more time into it and have just gotten into using Boost. The fact that you can only us MS constructs to program C# turns me off. I don't like MFC at all, Direct X code look overly convoluted to me, and I don't trust MS to make an interface that respects any standards other than their own. I'd prefer to use libraries whose design influences entail the largest group of brilliant minds. Thus far, C# is only derived from MS thinking with zero room for any outside input.

If I need to make ordinary Windows applications or program a web server running windows, then C# is what I would look into. Else wise the motivation for me, is lacking.
Programming since 1995.
Quote:
why do industry professionals use c++ when c# seems much easier? almost all the programming job advertisements want c++. is the reason simply because there's a lot of legacy code and people don't want to reinvent the wheel? will most professionals choose c# if they can start all over again?

The reasons are generally (a) legacy code, (b) lack of platform support (CLR implementations for consoles), (c) fear and resistance to change due to the nature of the industry and skepticism about the viability of C# (mainly due to bad benchmarks since C# is relatively young), and (d) lack of expertise (not all knowledge, idioms, and techniques that are valid and efficient in C++ transfer to C#, which partially accounts for the poor benchmarks noted in (c)...) and so on.

Quote:
C# isnt crossplatform and/or the code is not as secure as C++

Wrong and wrong. C# is (arguably) more cross-platform as it compiles to an intermediate language that is JIT-compiled; this results in many cases in an executable that can run on multiple platforms without recompiling the C# code (this is not possible with C++, you must recompile for each target). Furthermore, C# is vastly more secure, supporting code security features in-language and providing automatic handling of potentially dangerous scenarios (memory management) and sandboxing environments.

Quote:
The fact that you can only us MS constructs to program C# turns me off.

You can write complete C# applications without touching a single bit of Microsoft's products (although, yes, Microsoft's tools for C# development are still the most robust and powerful).
With C# and XNA, what Microsoft call Cross Platform is just that you can write a game that can be run over windows and Xbox 360. More info at:

http://msdn2.microsoft.com/en-us/xna/default.aspx

The .NET technology was develop by Microsoft, it runs only on Windows and Xbox 360 and they have a variety of projects with it. You need MONO to be able to use it on other systems. The Mono Project is an open development initiative sponsored by Novell to develop an open source, UNIX version of the Microsoft .NET development platform. So, it can't be 100% compatible. More info at:

http://es.wikipedia.org/wiki/.NET

http://www.mono-project.com/Main_Page

You have more control over C++, you can make unmanaged and managed code with it.

And if you want to use C# with XNA you'll be tied with Microsoft C# Express Edition. Is good, but you don't have more choices.
Shrek2: First rule of deciding a language is good or not: try them both and see what you think. If you ask 10 other people what their favorite languages are, you'll get 10 different answers.

In regards to a few of the comments made so far: people seem to be pretty Xna crazy these days. Not that that's a bad thing mind, it is a very nice api. But lets not forget that managed directx is still supported by microsoft, and you can use opengl from the .net languages. So you're hardly limited in how many platforms you can support with c#, and Xna is hardly the only graphics solution for c# out there. Arguing that you can support consoles other than the xbox 360 with c++ is kind of moot, as 99% of the people here will never be able to develop for them, at least not legally.

Anyways, here's my 2 cents: I'd use c++ if I were a professional programming half life 3 or doom 4, but c# is perfectly adequate for just about anything else. There's absolutely no reason for a hobbiest to not use c#.

[Edited by - gharen2 on May 16, 2007 6:45:11 AM]
where can i find good tutorials on c#.net for game programming? i looked at Game Institute. i think they only use c++.
If you want to use C#, use XNA.
You can find enough tutorials if you google for "xna tutorials" or on www.xna.com.

This topic is closed to new replies.

Advertisement