#1
  1. Person everyone wants to hate.
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    211
    Rep Power
    27

    Which C is good for game development?


    When i start classes in C, I think we are going to touch on all 3 variants, but from the rumors i've been hearing, it sounds like most of the class will be programming under C#.

    The most I got out of anyone about the differences between the 3, was that they are just on different levels (C being the lowest) What im curious about, is which variant is ideal for programming games? (big games, like FPS, RPG's stuff like that)
  2. #2
  3. Permanently Banned
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2006
    Location
    In a whale
    Posts
    4,147
    Rep Power
    0
    I say start with C++. C++ is used in alot of games. Its OPP, I think C# is too. C++ offers more I think than C or C#. But thats my opinion. You can go with any language for games. BASIC, VB, Java, etc. But go with which ever one you feel best with. Look at some code and decide which feels better.
  4. #3
  5. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    I'd definitely go with C#. C++ can program on the same level as C (C can't do the same level as C++ however; C cannot imitate things like OO or templates), however C++ has a much larger variety of free (as well as your commercial) libraries and other code to use for your applications. However, C# also offers this. C# has the whole .NET framework along with many other libraries out there for various different tasks you may need accomplished. You may be thinking that C++ is a better language because it works on more systems (OS's and processor architectures), but in reality it really isn't. I consider it very difficult to write perfect/near-perfect C++ code in your applications. I know of some people who write very impressive C/++, including some on these forums. However, C# aids you in writing better and safer and cleaner code. C++ can often be very easy to write sloppy and inefficient code in. Not to say that this is not possible to do in C# as well, but C++ seems to make it easier. The C# language from what I see is just much more cleaner, safer, and easy to understand than C++.

    In what the language supports, I'd definitely say that C# is the more powerful language. It is easier to write cleaner and clearer code using C#. The language also includes quite a few language features not found in C# (these features can be found on the Wikipedia/Answers page for 'C# programming language' (no quotes)). You should also find that maintaining the code to your very large applications is easier using C# than C++, but this might just be a matter of preference from one person to another.

    One downside to C# is that code execution isn't quite as fast C++, but the difference really isn't too noticeable if noticeable at all. Another disadvantage is that C# programs (along with VB6, IIRC) can be decompiled into their original code (the actual C# language code, not disassembled code). I know of at least one software that performs this operation, I will not mention its name. However, most people have no knowledge of such softwares and probably wouldn't bother decompiling your program(s) in most cases (would actually depend on what your application does, a game might actually cause people to want to find out how it works more than other types of softwares (to find cheats, exploits, etc.)).

    I'm going to just take a guess that you use Windows. If so, C# development will work out great for you and you should be able to use the .NET Framework gracefully (provided you have the proper system requirements). However, if you use maybe a Mac, or a *nix system, or something else, you can try working with Mono (http://www.mono-project.com/Main_Page). Quoting from their main page:
    Mono provides the necessary software to develop and run .NET client and server applications on Linux, Solaris, Mac OS X, Windows, and Unix.
    Anyways, I hope this has helped you out some. Good luck in choosing the correct language. Don't just pick something because you think it is "faster" or can "get the job done" sooner, because languages that just "get the job done" as fast as possible are never the more efficient of languages (unless someone can show me one that is?). Visual Basic gets the job done faster than any language I can think of; it is by no means an efficient language.

    Well, good luck!
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2006
    Posts
    2,270
    Rep Power
    1736
    When i start classes in C, I think we are going to touch on all 3 variants, but from the rumors i've been hearing, it sounds like most of the class will be programming under C#.
    C, C++, and C# all share the look and feel of C, but they are vastly different languages. It's unlikely you'll be doing all three.

    The most I got out of anyone about the differences between the 3, was that they are just on different levels (C being the lowest)
    Technically, saying C, C++, and C# are on different levels is accurate, something I probably would say, but is quite an over simplification. C and C++ are very old languages. C++ was revised in 98/99 to what we might call "modern C++". C# is even more different from C. First, it is a pure .NET language. C and C++ compile down to machine code, but C# compiles to an intermediate language called MSIL. Other .NET languages can also compile down to MSIL. C# works with the .NET platform, and as a language it shares only some similarity to C++. In short, I would put quite a bit of separation between C# and C/C++.

    What im curious about, is which variant is ideal for programming games? (big games, like FPS, RPG's stuff like that)
    All three are suitable. C and C++ are cited for game making, yes, but soon C# will be as well. C and C++ are very high performance languages suitable for making operating systems, and also have been around for such a long time. This means that they are supported in a variety of fields with various tools and libraries: graphics (DirectX/OpenGL), audio, networking, game libraries, etc.

    Don't fool yourself on C# though. It's been around for a few years but it has taken off with quite a start. The number of solid useful libraries is quite respectable, it has the DirectX library from Microsoft (Graphics, sound, networking, i.e. everything for making games), and because of its popularity you'll find many popular tools and libraries either already supporting C# or eventually doing so.

    An aside. C# is very Microsoft. Yes, there is the open-source Mono, but it is a very poor cousin. So if you want to do something like game making on Linux and Macs, etc., C# won't be in for a while.
    When you ask a question, be prepared to tell us: what have you tried? If you think you don't need to try anything, we will never be interested in helping you. If you agree with the link, and you refuse to answer that question, you are being a hypocrite.

    Need help with broken code? Your question should be like a good bug report: (1) It has the smallest number of steps to reproduce the problem you see (2) It tells us precisely what you expected to see and (3) It tells us what you saw and how it differed from what you expected. We need all three to help you.
    Want better answers? Tell us what you Googled for and what steps you took to answer your own question.
  8. #5
  9. Person everyone wants to hate.
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    211
    Rep Power
    27
    Originally Posted by Oler1s
    C, C++, and C# all share the look and feel of C, but they are vastly different languages. It's unlikely you'll be doing all three.
    Well, that is what i heard, but i know the class description includes all 3.

    Anyway, It sounds like, for the level of game development I want to do, that C++ is, for the moment, the best way to go. I should point out, that because I want to make large games, I am not looking for the fastest way to code it, but rather the most efficient, fastest Running, code. So when the final game is done, it will run as quickly as possible. It would also be good in that, to start with, i want to make mods for current games, which i believe are in C/C++.

    C# sounds more like it would be suitable for the smaller tasks, such as making support programs for the games (like character builder or something) It would concern me making a major title in C# if it can be decompiled so easily. That is a major security concern as people can do that to get around security such as cd checking, and key validation. Not to mention the hack programs that could be done.

    As far as VB goes, Im finishing up the first class this semester of that. Which is what is required to go into the 2 C classes ill need to take. VB is ok, but I can see how high level it is, and wouldn't want to program a major game with it.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2006
    Posts
    2,270
    Rep Power
    1736
    Originally Posted by Lyian
    I am not looking for the fastest way to code it, but rather the most efficient, fastest Running, code. So when the final game is done, it will run as quickly as possible.
    Just so you know, MSIL code is JIT compiled. That's pretty fast. Faster than C++ if the machine code isn't optimally compiled for target machine.

    C# sounds more like it would be suitable for the smaller tasks, such as making support programs for the games (like character builder or something)
    C# is usable for games themselves.

    High level languages are preferable. Well, there's tons of posts where I and others have talked about choosing a language. Point is, if you can actually state reasons why a certain piece of code needs to do something in 1000 cycles as opposed to 1050, you're pretty advanced. Most of the time, you want fast application development.

    Just don't want you to dismiss C# so fast. It is a very impressive language for some very good reasons.

    Comments on this post

    • Yegg` agrees : Yes, C# is very impressive.
    When you ask a question, be prepared to tell us: what have you tried? If you think you don't need to try anything, we will never be interested in helping you. If you agree with the link, and you refuse to answer that question, you are being a hypocrite.

    Need help with broken code? Your question should be like a good bug report: (1) It has the smallest number of steps to reproduce the problem you see (2) It tells us precisely what you expected to see and (3) It tells us what you saw and how it differed from what you expected. We need all three to help you.
    Want better answers? Tell us what you Googled for and what steps you took to answer your own question.
  12. #7
  13. Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2004
    Location
    Switzerland
    Posts
    1,152
    Rep Power
    1901
    I think most game development is still done with c++. I don't think you'd want to concentrate on c because c++ can do anything c can and more. While c++ is a relatively low level programming language and has some things that can give you headaches (* and & for example) i believe it to be the one of the most suited programming language for game development.

    c# not really that comparable to c. It's syntax is mostly java based and the idea of the framework certainly was inspired by java as well. It is high level and allows for faster development than c++ but i have my doubts about it's suitability for game development. Especially if you want to go for multiplatform games .NET is not the way to go. Yes there is MONO but i do not believe they will ever be as good as .NET on windows simply because MS does not want that.

    And VB. I wouldn't choose a language which says "beginner's" in it's name for game develpment. It was nice to start with and good for macros but it's just uber-verbose and just not as clean as java or c#.
    - Hugh of Borg

    The first thing young borg are taught: Keep away from Microsoft software!
  14. #8
  15. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    154
    Originally Posted by Hugh of Borg
    Yes there is MONO but i do not believe they will ever be as good as .NET on windows simply because MS does not want that.
    Just to point something out, Microsoft isn't going to stop Mono from adding more to their implementation of .NET just because Microsoft doesn't want that to happen. Mono will do what they like unless there is a lawsuit that forbids them. Mono is also not the only .NET implementation other than Microsoft.

IMN logo majestic logo threadwatch logo seochat tools logo