What language did you code in?

Discussion in 'Public Game Developers Forum' started by yourofl10, Feb 3, 2009.

  1. yourofl10

    yourofl10 Well-Known Member

    Dec 11, 2008
    4,176
    43
    38
    Hi, I'm wondering what type of language you used to code your game. Whether it me C++,C,Xcode,etc......

    I'm a future wanna be iphone and ipod touch developer soo I'm just wondering which code you used.
     
  2. Little White Bear Studios

    Little White Bear Studios Well-Known Member
    Patreon Silver

    Aug 27, 2008
    2,572
    0
    0
    Objective C, which is what you'll find most people using. And you have to use XCode, as it's the only environment you can create the app and interact with the iPhone with.
     
  3. Diablohead

    Diablohead Well-Known Member

    Jan 19, 2009
    1,553
    1
    0
    Freelancer, PC game developer
    If you use a pre-made engine like Unity you can use some other languages like javascript but it's limited to that game engine so it will never be as pure as direct code.

    It's a easier way to start at least.
     
  4. I have just started learning Objective C without any knowledge of C, and am doing just fine. Just so you are aware, Xcode is not a language. As mentioned above, it is the app/environment that you use to create your iPhone or Mac apps. There is also another app that comes with it called Interface Builder. Xcode is used for all the coding, such as what buttons do, and what the app actually does. Interface Builder is used to create your views/screens such as menus etc.
     
  5. yourofl10

    yourofl10 Well-Known Member

    Dec 11, 2008
    4,176
    43
    38
    Ohh thanks!!!

    (I'm new to this) Sorry
     
  6. Don't apologize. I had to learn all this too only a couple of weeks ago.
     
  7. Hippieman

    Hippieman Well-Known Member

    Nov 6, 2008
    433
    0
    0
    Senior Producer, Designer
    San Francisco
    We use a mixture of Obj-C, C++ and XML to power our games.
     
  8. Out of interest, is speed affected when applying different languages- for example, could a function, depending on what it does of course, run faster with Objective C than with C++?
     
  9. bovinedragon

    bovinedragon Well-Known Member

    Sep 20, 2008
    98
    0
    0
    I guess I'm one of the only people that uses only C++( apart from a few unavoidable objective-c functions to interface with the OS ). They will both run at the same speed, as they are both compiled to machine code.
     
  10. Thanks for the confirmation. So it boils down to personal preference then, yes?
     
  11. jonaswills

    jonaswills Well-Known Member
    Patreon Gold

    Nov 11, 2008
    403
    3
    18
    Game Developer
    Washington
    Most of our code base is in c++ so your not the only one :D
     
  12. bovinedragon

    bovinedragon Well-Known Member

    Sep 20, 2008
    98
    0
    0
    You can get both work just as good, but be aware that all of the OS functions are in Objective-C, which gives you a little more work to get your C++ code to talk to the system.

    If you are using Interface Builder or any of the Objective-C API's like Quarts a lot, it may be easier to just work in Objective-C to keep the language consistent. I just use OpenGL, which is a just plain C, so C++ works fine for me.
     
  13. Manta Research

    Manta Research Well-Known Member

    Jul 28, 2008
    189
    0
    0
    Toronto, Canada
    Well very generally speaking Obj-C with its message passing mechanism will typically be slower than C++, which in turn will typically be slower than C, and this will in turn be slower than writing in asm directly.

    For the most part it really doesn't make much of a difference, because so many of the bottlenecks are outside of your control. Usually, making smarter choices in choosing/designing your algorithms tend to give much larger gains than the decision of which language to use.

    I personally write all my code in C and use Obj-C where necessary.
     
  14. Interesting. Thanks guys!
    I'll stick to just learning Objective C for the moment. It's nice to know where it stands in the speed department though.
     
  15. Anders

    Anders Well-Known Member

    Feb 3, 2009
    1,634
    0
    0
    Co-owner and CTO at Color Monkey
    Sweden
    Mostly C/C++/OpenGL/OpenAL and as little ObjC/Cocoa as possible.
     
  16. MetaNick

    MetaNick Well-Known Member

    I use Objective-C for just about everything.

    Objective-C is a true superset of C, so it's pretty unlikely that you won't be using both in your app/game. The OpenGL ES API is made in C. And even if you are just doing apps and things, most of the Core Graphics types are just C structs like CGPoint, CGRect, and so on.
     
  17. daniglue

    daniglue Well-Known Member

    Oct 12, 2008
    85
    0
    0
    in Korean.
     
  18. currymutton

    currymutton Well-Known Member

    Oct 16, 2008
    4,430
    1
    0
    I use mostly Java and VB, well, in the past, so Obj-C is a whole new species to me. Still struggling with the "strange" syntax and the "delegate" model.

    Another newbie, just out of curiosity. Can you just put C++ or C into your project and XCode will compile them just fine?
     
  19. bovinedragon

    bovinedragon Well-Known Member

    Sep 20, 2008
    98
    0
    0
    Yes it can compile plain ".cpp" files. Or you want to mix C++ and Objective-C together, change the file type to ".mm".
     
  20. InsertWittyName

    InsertWittyName Well-Known Member

    Nov 26, 2008
    202
    1
    0
    Bugz was coded with about 5% Obj-C, 95% C++.

    I personally prefer C and Obj-C over C++.
     

Share This Page