Thread: Coding languages for video games?

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    3

    Post Coding languages for video games?

    Do you have to know anymore coding languages than C++?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    "have to" - possibly not.
    "useful to" - possibly yes.

    Compare a carpenter who only knows how to use a hammer, compared to one who knows about hammers, chisels, saws, planes etc.

    Mastery of one or two is a must, being familiar enough "to get by with the help of a manual" for several others.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    3
    Okay, thanks.
    What would be another good language to learn?

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    How about starting with C++? Are you quite familiar with C++?

    For another language, I might suggest C, Perl, or Python. It really depends on what you want to do.

    "Write video games!"

    With Perl or Python you'll probably be able to create programs more easily and with less code, but the performance of the code in the end probably won't be as good as it could be . . . .
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    Registered User
    Join Date
    Jul 2008
    Posts
    3
    Well I've just started with C++ but once I get farther I'll probably start doing C.
    Thanks for the info though.

  6. #6
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    If you've just started, don't try to learn too many languages at once. You'll just confuse yourself.

    Really. You'll accidentally type cout in a C program or something like that.

    [edit] Note my previous edit. I decided it would be best to recommend Perl or Python instead of C . . . C is good too, however, and very widely used. [/edit]
    Last edited by dwks; 07-16-2008 at 12:43 PM.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I would avoid C for anything that does not require it. The reason is that C is a very low-level language and a lot can go wrong. Plus you can use low-level C++ where low level is required, which is still safer than pure C (although I'm sure many would disagree here).
    Further, well written C++ is as fast or almost as fast as pure C.
    In today's place with big, complex games and security concerns, using C will be like shooting yourself in the foot.
    There are times and places for everything, but I don't think I would like to call games one of them (for C).
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Elysia View Post
    I would avoid C for anything that does not require it. The reason is that C is a very low-level language and a lot can go wrong. Plus you can use low-level C++ where low level is required, which is still safer than pure C (although I'm sure many would disagree here).
    C++ can do 99.9% of what you can do in C, so I agree with. I don't agree that C++ is in any way safer than C - they both have the same basic concepts, and the perceived safety of C++ comes from well-defined additional libraries, which can be done in C as well. Both languages have great big holes allowing a programmer to make mistakes that can crash the system - C++ has nothing to prevent you from doing
    Code:
     
    int *p = (int *)12345; 
    *p = 7;
    Further, well written C++ is as fast or almost as fast as pure C.
    Indeed - because, if the C solution is faster than the C++ solution, you can simply use th same solution in C++, and the compiler will generate the same code [assuming we don't change compilers - different compilers will do vary as to how good code they generate for a particular piece of source].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  9. #9
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by matsp View Post
    Both languages have great big holes allowing a programmer to make mistakes that can crash the system - C++ has nothing to prevent you from doing
    This is true, but C++ offers a great variety of tools and features that allows you to more safely write programs that are safe.
    Smart pointers kills most access violations there are (and we have std::tr1::shared_ptr, std::auto_ptr, std::tr1::weak_ptr to help us here).
    Bounds checking, encapsulated in a class, destroys most if not all out-of-bounds array access, and so on (we even have std::vector and std::tr1::array to do this for us).
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #10
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Elysia View Post
    This is true, but C++ offers a great variety of tools and features that allows you to more safely write programs that are safe.
    Smart pointers kills most access violations there are (and we have std::tr1::shared_ptr, std::auto_ptr, std::tr1::weak_ptr to help us here).
    Bounds checking, encapsulated in a class, destroys most if not all out-of-bounds array access, and so on (we even have std::vector and std::tr1::array to do this for us).
    But all of those examples are simply encapsulating good code, not parts of the language definition itself, and that is my boon with your constant repetition that C++ is safer than C - it is not the language itself that is safer. There are safe libraries for many things in C as well.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  11. #11
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Perhaps it stands as a matter of definition, but if you ask me, C++ is safer than C. The fact that it is much stronger typed is enough for me to call it safer.
    And the fact that you don't have to hunt for safe libraries (because they're standard!) makes C++ safer in my eyes.
    And don't forget that it's somewhat impractical (due to much code duplication) for safe code or safe libraries in C, whereas in C++, there's much less need for such things.

    It's all in how you see it.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #12
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    In my view C++ can be just as dangerous as C. Any tool in the hands of an idiot is a dangerous thing. When choosing which to use I don't consider basic memory management principles that every programmer should know as criteria in the decision.

  13. #13
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Bubba View Post
    In my view C++ can be just as dangerous as C. Any tool in the hands of an idiot is a dangerous thing. When choosing which to use I don't consider basic memory management principles that every programmer should know as criteria in the decision.
    Indeed - and if you don't want to worry about memory management and such details, then there are languages such as Java, Perl and Python that "does this for you". Those are excellent learning languages, but once it comes to high-performance production code, C and C++ beats them in most cases.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  14. #14
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    It could also be discussed as a matter of "semantics" or whatever you want to call it.
    If you use C code in C++, then by all means, it pretty much is C and not C++.
    If you use the standard library, classes, templates and stuff, then it's pretty much C++. The "safe" part of the language.

    Anyway, safe or not, it doesn't change the fact that C isn't really made for big projects and code reuse and such. It's very much low level.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  15. #15
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476
    IMHO, a little bit of assembly is needed. At least for performance optimization. Also a scripting language like Lua would come in handy sometimes.
    ERROR: Brain not found. Please insert a new brain!

    “Do nothing which is of no use.” - Miyamoto Musashi.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. When done right, PC games are amazing
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 08-13-2008, 05:32 PM
  2. Violent video games?
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 58
    Last Post: 04-26-2006, 01:43 PM
  3. what type of language(s) are used to develope games?
    By CwannaB in forum Game Programming
    Replies: 16
    Last Post: 03-08-2003, 02:52 PM
  4. Video Games Industry. 5 years left.
    By Cheeze-It in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 12-10-2002, 10:52 PM