Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

BKStoltman

Visual C++ .NET vs Visual C#

This topic is 5240 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So is visual C++ more powerful or equal with or less powerfull then C#. We all know Visual C# is easier for creating windows applications. But in every situation is is just as powerful or does it lack. Or even though C++ requires more code in most cases is it still the stronger one over all. Just curious. Can Visual C# work with directX at the same level as C++.NET Every aspect. LET THE WAR BEGIN... I am curious however.

Share this post


Link to post
Share on other sites
Advertisement
In Visual C++, you can compile your code to native code, which doesn''t require the .NET Framework and is usually faster. But if you want to use the .NET Classes, you have to compile to MSIL (similar to Java bytecode). In that case I don''t think it''s faster than C# anymore.

C# is not only easier for creating windows applications, but also easier for creating ANY kind of application. You don''t have to worry about memory management or other low-level programming you need in C++. It''s specifically designed to allow much easier programming.

DirectX: Microsoft has released Managed DirectX, which is a .NET Library to use DirectX in any .NET-language, including C#. Managed DirectX is totally object-oriented, and a lot easier to use than (unmanaged) DirectX in C++: you have to write a lot less code.

Longhorn: Longhorn (next major Windows-version) will be built around the .NET Framework, and developing Longhorn-applications will be almost exclusively in .NET (language-independent: use C#, C++, VB.NET, J#, ...), and .NET-applications will probably run as fast as native-code applications.

Security: .NET-applications are (supposed to be ;-) ) more secure than native-code applications: from the control panel, you can configure the security of an application: you can say what it can or can''t do. You can say: application X can''t connect to the Internet, it can''t access the registry, ...

---
tommy online: http://users.pandora.be/tommycarlier

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Is it C# that makes making applications easier, or is it .net?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Seems to me that all the advantages you have listed for VC# are present in VC++. You may think C# has a cleaner syntax, but that is a matter of preference.

Share this post


Link to post
Share on other sites
A matter of preference? You can''t deny that C#-code is cleaner, no matter what your preference is. Compare these samples:

Managed C++:
public: static Assembly* Load( unsigned char rawAssembly __gc[], unsigned char rawSymbolStore __gc[]); 

C#:
public static Assembly Load(byte[] rawAssembly, byte[] rawSymbolStore); 


---
tommy online: http://users.pandora.be/tommycarlier

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You do not need public: on the C++ function at all. You do not need to put a variable name there, you could make a


#define byte unsigned char __gc[]

static Assembly* Load(byte, byte);


which is cleaner?


Share this post


Link to post
Share on other sites
If you use some tricks, you might get some cleaner C++-code, but you still have the required * and &. These tricks just don''t make it as clean as C#-code.

You don''t need to put a variable name there? True, but that doesn''t make it cleaner. It rather makes it less descriptive. BTW: that is only true if you''re describing the class. If you implement the method, you DO need the variable names. In C#, the description and implementation of methods is one and the same thing.

Just face the fact that C++ is an old language that was not designed to have a clean syntax. It was designed to add object-orientation and other stuff to C, while still being compatible with the C-syntax. C# was designed to have a clean syntax. It was not designed to be compatible with some older language. It was however designed to look somewhat familiar to C/C++(/Java?)-programmers.

---
tommy online: http://users.pandora.be/tommycarlier

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You could equally argue that __gc[] and * and & make the C++ code more descriptive, its just a matter of opinion.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!