Hi Dakotah,

Yes and no. It all comes down to what you are attempting to program,
what platform or platforms you intend to support, what APIs you need
to access, whatever. So I'd say when talking about advantages or
disadvantages of C++ verses C# you need to take into consideration the
project at hand.

In general terms I agree C# is a great all purpose programming
language for games and applications because the .NET Framework and
Mono Framework provide an extensive library of classes and libraries
that gives the C# developer a lot of power and simplicity not possible
in C++. However, that is not to say there aren't some large
disadvantages with .NET based applications you don't have with C++.

One is security. In order to be cross-platform and portable C# is
compiled to an intermediate language that gets run by the .NET or Mono
runtime. Since it is not compiled to binary and encrypted it is very
easy to run a C# executable through a disassembler and get back the
original C# source code, modify it, and recompile it in VS .NET..
There are obfuscation tools that try to obfuscate or scramble the MSIL
code to keep hackers from disassembling it back to working C# code,
but its not regarded as safe as an encrypted C++ binary by IT
professionals.

With C++ you can not only compile it to native machine code, binary,
but there are some very good tools out there that can run encryption
on that executable and encrypt it in such a way that it would be
extremely difficult for a cracker to disassemble the executable into
assembly.

Another disadvantage with C# is that if there isn't a managed wrapper
for some library you want to use and it doesn't have a Windows COM
interface you are going to get stuck writing one for your .NET or Mono
application just because there is no direct way to access that API. As
it happens I can think of a specific case where I ran into this very
issue.

On Linux there is a universal speech service called Speech Dispatcher
that provides a common API for using Espeak, Festival, FreTTS,
Dectalk, Eloquence, etc. There is a Python wrapper called SpeechD and
there is of course the C libraries. However, if I am attempting to
write an app in C# using the Mono Runtime for Linux I'm sort of
screwed because there isn't a direct way to use Speech Dispatcher. I'm
going to have to do the work to write a Mono wrapper for Speech
Dispatcher, probably in C++, just so I can use it in C! with Mono.

Obviously, with C++ this isn't an issue. Simply include the Speech
Dispatcher headers and libraries in my C++ project and away I go. No
need to write some specialized wrapper to access the API.

The last serious disadvantage I've found with C# is installing all the
necessary dependencies. Of course, this has gotten better now that the
.NET Framework comes with Vista, Windows 7, and Windows 8, but there
is still a lot of extra stuff that may need to be downloaded and
installed just to use the native libraries on your machine. If you are
using DirectX in your C#  application you will either need XNA or
SlimDX. If you use SDL you will need to install SDL .NET. It all
depends on what you use of course, but let's face it there is a lot of
extra stuff with .NET that a C++ application simply doesn't need.

If I write a game in C++ I can use DirectX, Sapi, and all the standard
Windows libraries directly without installing the .NET Framework,
SlimDX, XNA, which makes it easier on the customer as well as myself
as everything the customer needs should already be installed.

So the advantages and disadvantages between C# and C++ really depends
on what you the developer are looking for. It all depends on how
important security is to you in developing copyright protection, or
weather or not you want direct access to certain APIs etc. Its a
entirely subjective opinion which is better in my opinion.

Cheers!

On 7/21/13, Dakotah Rickard <[email protected]> wrote:
> In researching the various languages I could utilize, I found that C++
> doesn't seem to offer much in the way of advantage over C# in terms of
> what you can actually do with it, especially when you weigh it against
> the difficulties inherent in programming in that language.

---
Gamers mailing list __ [email protected]
If you want to leave the list, send E-mail to [email protected].
You can make changes or update your subscription via the web, at
http://audyssey.org/mailman/listinfo/gamers_audyssey.org.
All messages are archived and can be searched and read at
http://www.mail-archive.com/[email protected].
If you have any questions or concerns regarding the management of the list,
please send E-mail to [email protected].

Reply via email to