A little guidence needed

This is a discussion on A little guidence needed within the Game Programming forums, part of the General Programming Boards category; So C++ is an upgrade from C, that has been accepted by so many, and still people say C is ...

  1. #16
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717
    So C++ is an upgrade from C, that has been accepted by so many, and still people say C is better? o.O ...
    I'm not getting it, one bit :P
    Currently research OpenGL

  2. #17
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    > And yet so many a great a things are designed for C, still. Utter foolishness.
    I'd say it's foolish to use C++ for an API or library. Well depending strictly on the case of course...

    1) Most libraries don't need a OO design
    2) You can easily write a wrapper to make it OO
    3) Ensures that people with C and C++ can use it

    If however you write it in C++, then you've chopped off the people who want/need to use C.

  3. #18
    chococoder
    Join Date
    Nov 2004
    Posts
    515
    C++ was designed to accept C source code as valid compiler input. It's not strictly an "upgrade", rather it was designed like that to make for an easier transition by the uncouth hordes of C programmers left over from the Hippy era of programming

    Neither C nor C++ is "better" overall, it's just what you're used to and what programming model you prefer, as well as the specific purpose you have in mind.
    Procedural C code can in theory compile to faster executables compared to Object Oriented C++ code because of the higher overhead involved with things like virtual functions, but in practice this difference is often negligable because it's easier to write efficient C++ code as compared to efficient C code.
    Thus 2 programmers with comparable levels of expertise will probably produce roughly equally efficient code, one writing C and the other C++.
    The C++ code however will be (in general) easier to maintain and expand/reuse than the equivalent C code (again, from a specific level of expertise on the part of the authors and given comparable levels between the authors), making it a better choice to use in a commercial environment.

  4. #19
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,622
    Quote Originally Posted by zacs7 View Post
    > And yet so many a great a things are designed for C, still. Utter foolishness.
    I'd say it's foolish to use C++ for an API or library. Well depending strictly on the case of course...
    Yes, I'm not talking about embedded stuff. I'm referring to typical PC stuff.

    If however you write it in C++, then you've chopped off the people who want/need to use C.
    Then they have chosen a poor language and the wrong tool for the job, if it is not demanded by the platform they work for.
    Which creates an evil cycle. Programmers use C, thus they need libraries written in C. As demand increases, more libraries are written in C, leaving C++ programmers in the cold, merely because C++ is backwards compatible.
    And, of course, since there are more C libraries, there becomes more C programmers. And so the cycle begins again.

    Today is a modern world where C really should have no place, especially in PC software.

    1) Most libraries don't need a OO design
    2) You can easily write a wrapper to make it OO
    3) Ensures that people with C and C++ can use it
    1) Nothing says it does not. Besides that, C++ has more features than merely classes, although it is of great boon.
    2) ...Which instead could have been written into the library in the first place. Thin wrappers and not necessarily better than its C counterpart.
    3) Brings me back to the point about C above...
    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.

  5. #20
    Registered User
    Join Date
    Jan 2008
    Posts
    66
    Quote Originally Posted by Matty_Alan View Post
    I was always under the impression that those API's (OpenGL, DirectX, SDL) were a little to advanced for begginers :s
    SDL is not hard at all, even for beginners, if you start learning it, you'll realize how easy it is.
    I recommend to look at this sites, because they have very good tutorials about SDL for beginners.

    http://lazyfoo.net
    http://www.sdltutorials.com

  6. #21
    Registered User
    Join Date
    Jan 2008
    Posts
    66
    Quote Originally Posted by Matty_Alan View Post
    I was always under the impression that those API's (OpenGL, DirectX, SDL) were a little to advanced for begginers :s
    SDL is not hard at all, even for beginners, if you start learning it, you'll realize how easy it is.
    I recommend to look at this sites, because they have very good tutorials about SDL for beginners.

    http://lazyfoo.net
    http://www.sdltutorials.com

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. free needed or not?
    By quantt in forum Linux Programming
    Replies: 3
    Last Post: 06-25-2009, 09:32 AM
  2. C Programmers needed for Direct Hire positions
    By canefan in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 09-24-2008, 11:55 AM
  3. Battleship Game (Win32 EXP Needed)
    By ElWhapo in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 01-15-2005, 09:10 PM
  4. C++ help needed
    By Enkindu in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 08-31-2004, 11:24 PM
  5. Help Needed With Windows GUI
    By edselman in forum Windows Programming
    Replies: 5
    Last Post: 08-22-2002, 09:38 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21