gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > C#?

#142573 - Mayne - Wed Oct 10, 2007 2:44 pm

I see that all these games are made with C/C++. Well, why not C#? C is so old & C++ is slower & harder than C#.


Are the libraries not made for C#?

#142574 - Vich - Wed Oct 10, 2007 2:55 pm

Mayne wrote:
I see that all these games are made with C/C++. Well, why not C#? C is so old & C++ is slower & harder than C#.



I could think of a few reasons why:
- It's a relatively new language
- C++ is the standard way of doing things in gamedev world
- In general any code written in C# is managed code, while with DS development, it's nice to have direct memory access for many reasons.

http://www.meshplex.org/wiki/C_Sharp_Tutorial also says:
Quote:

Although C# programs can be written as little as a text editor and compiled using command line, it still needs the .NET framework to be present on the system, which cripples down the portability in the development of C# programs by a large amount, and makes it more Microsoft Windows dependent. There?s an alternative version of the .NET framework produced by the FOSS (Free and Open Source Software) community called the ?Mono? project which brings C# to the Linux variants.


C++ is definitely not slower than C# ... maybe you mean slower to learn?

Quote:
Are the libraries not made for C#?

Nope. Plus, you need a compiler also, not just libraries.
_________________
[project website] [personal website]

#142581 - kusma - Wed Oct 10, 2007 4:20 pm

Mayne wrote:
Well, why not C#?

Because C# runs in a virtual machine which basically require more memory and resources to run. Even though JIT-compiled code in theory can generate faster code by looking at the context (but rarely do in practical cases), doing so requires too much memory to be practical for the already memory-hungry DS. Besides, the effort required to write a good JIT-compiler is pretty huge.

#142591 - Miked0801 - Wed Oct 10, 2007 6:04 pm

I love it that C is now an "old" language :)

In reality, a good portion of C++'s abilities aren't all that useful on DS due to platform limitations and not worth it at all on GBA. C#, like java, is great for multi-platform, multi-thread, type coding. One needs hardware level tinkering to make the DS do anything worth while.