Game Maker's Garage Forum

Game Creation => Other Languages & Tools => Topic started by: WarHampster on July 05, 2009, 08:43:33 PM

Title: C++, Objective C, and C#
Post by: WarHampster on July 05, 2009, 08:43:33 PM
Can someone explain the differences between these languages? I know that C# was made by Microsoft and Objective C is used mostly by mac stuff, but what are the functional differences between them?
Title: Re: C++, Objective C, and C#
Post by: HarryCaray on July 05, 2009, 09:02:29 PM
I've recently picked up C++ to prepare for college, to me its more of a data cruncher language.
Title: Re: C++, Objective C, and C#
Post by: GMG Hendo on July 06, 2009, 06:19:06 AM
Objective-C is just what it sounds like. It's an object-oriented extension of ANSI C.
It's tough to learn at first (I would know, I'm just starting) but apparently once you get it, it's really easy.
Title: Re: C++, Objective C, and C#
Post by: GMG Tim on July 06, 2009, 02:18:05 PM
Quote
I've recently picked up C++ to prepare for college, to me its more of a data cruncher language.
Yup.
Title: Re: C++, Objective C, and C#
Post by: alias on July 10, 2009, 09:48:35 PM
C++ is more number crunching oriented, C# is user event driven and objective C is more OOP than the others (although they are all OOP languages)
Title: Re: C++, Objective C, and C#
Post by: Telstar5 on August 04, 2009, 09:52:13 PM
So where does that put C?

I recently got a book called "C by Dissection". It's really good, and there's a bit on C++ as well, which is useful for moving up.

I could just go straight to Cocoa, but I'm used to RealBasic. I ought to start with C to get my head around the data crunching stuff.

So far I have failed to produce one working application, even the hello world app... I think I left something out, but I'm not sure.
Title: Re: C++, Objective C, and C#
Post by: GMG Hendo on August 04, 2009, 11:29:48 PM
My C is rusty but I believe something like this for Hello World



Code: [Select]
#include <stdio.h>
 
int main(void)
{
    printf("hello, world\\n");
    return 0;
}
Title: Re: C++, Objective C, and C#
Post by: WarHampster on August 05, 2009, 01:25:02 AM
<- That looks right to me.

c++ is

Code: [Select]
#include <iostream>
using namespace std;

int main ()
 {
  cout << "Hello world!\\n";
  return 0;
 }
Title: Re: C++, Objective C, and C#
Post by: GMG Tim on August 07, 2009, 06:37:11 PM
Start with C, and then move into object oriented stuff with C++. The benefit is that all C code is compatible with a C++ compiler, and to switch to C++ functions is just a minor syntax change.
Title: Re: C++, Objective C, and C#
Post by: j on August 19, 2010, 10:19:24 AM
iDevGames actually has a good explanation of the differences, with recommendations. Tim's answer is a great summary, but if you want a little more info:

http://www.idevgames.com/forums/thread-4383.html
Title: Re: C++, Objective C, and C#
Post by: WarHampster on August 19, 2010, 02:59:40 PM
You forgot to play your necromancy card, this thread is from around a year ago!

I subscribe to the "it's all about the final product" philosophy when designing programs, so I like to avoid C, C++, and Objective C. Micromanagement detracts from the larger picture, in my opinion, and the likes of C# and Java provide a nice balance between painstaking memory management and more traditional scripting languages like Python.
Title: Re: C++, Objective C, and C#
Post by: Gan on August 19, 2010, 04:10:51 PM
Programming Objective C on the mac has a feature called Garbage Collector. Takes care of memory management so you don't have to. Though of course, even without it... memory management is still a breeze.
Advice from someone who has built a game in Java and Objective C...
Objective C causes less hair loss than Java.


-Gan
Title: Re: C++, Objective C, and C#
Post by: Silverwind on August 19, 2010, 05:11:11 PM
Quote
Advice from someone who has built a game in Java and Objective C...
Objective C causes less hair loss than Java.


-Gan
I can easily believe it. I went bald from reading Java For Dummies, and I didn't even have any hair to begin with! (I'd just finished Assembly for Smarties)
Title: Re: C++, Objective C, and C#
Post by: j on August 19, 2010, 06:56:52 PM
Quote
You forgot to play your necromancy card, this thread is from around a year ago!
Sorry, I just showed up for my yearly lurk. =P

I didn't notice the date, and there's a bug or something with the forums for me, where everything will light up NEW, even right now after I went through and marked all read earlier this morning. Oh well.
Title: Re: C++, Objective C, and C#
Post by: Silverwind on August 20, 2010, 05:26:45 AM
That happens to me sometimes.
Title: Re: C++, Objective C, and C#
Post by: GMG Kurt on September 12, 2011, 04:48:35 PM
Quote
My C is rusty but I believe something like this for Hello World



Code: [Select]
#include <stdio.h>
 
int main(void)
{
    printf("hello, world\\n");
    return 0;
}

That'll work perfectly, but most C programmers return 1, to check their main exited correctly, and the only argument you want main to take is command-line arguments. Its implied that it taking void otherwise.

both C++, an Objective-C are built onto C, but C++ is made  by Bell labratories (same as C) and Objective-C was made by NeXtStep (which was aquiered by apple.) C++ is universal, and although obj-C isn't currently supported on pc there is a group that has found ways to compile an obj-C program for use on a windows machine (without emulation), they're only part done with it though.

I think this is it: http://cocoaheads.byu.edu/resources/cocotron
Title: Re: C++, Objective C, and C#
Post by: Gan on September 12, 2011, 05:46:49 PM
Yeah I've used Cocotron. It works, little slow and buggy but works.

Plus it's a huge migraine to set up.
Title: Re: C++, Objective C, and C#
Post by: GMG Kurt on September 13, 2011, 05:57:10 PM
I never tried it. Never got that far in development of an obj-C application worth that.
Title: Re: C++, Objective C, and C#
Post by: GMG Kurt on October 14, 2011, 03:13:21 PM
Hey this post saind there was a new post, but there wasn't weird.  ???
But I did re-read it and it brought up a question I have. Can C run on pc, and if not then why can C++?
Title: Re: C++, Objective C, and C#
Post by: Gan on October 14, 2011, 05:35:52 PM
C can. Though it depends on the frameworks. Some frameworks support only mac, others support only PC. It's cause PC and Mac do some things differently.

You could theoretically make an application for both Mac and PC, though you'd need to find universal frameworks or build your own and you'd need to compile your application in a way that'd run on both machines or compiler it twice, once for mac and other for pc.
Title: Re: C++, Objective C, and C#
Post by: GMG Kurt on October 14, 2011, 07:14:33 PM
ah i see like the #ifdef statement. But ho do i know what frameworks are mac only, and such? And does Xcode contain the windows frameworks?

SO are C++ frameworks all universal frameworks?
Title: Re: C++, Objective C, and C#
Post by: Gan on October 14, 2011, 07:49:19 PM
I'm not sure about the frameworks working on mac and pc, but I do know that Xcode does not contain windows frameworks. I might contain frameworks that are compatible with windows though.
Title: Re: C++, Objective C, and C#
Post by: GMG Kurt on October 14, 2011, 10:20:14 PM
cool, I don't think I'll use anything but Gm for computer game programming though, C++ for nD, and obj-C for iPhone. and C for operating systems, UNIX commands, and the like I would love to do :P
Title: Re: C++, Objective C, and C#
Post by: Connors on December 04, 2011, 12:13:45 PM
It does that to me when I haven't logged in for a while...
Title: Re: C++, Objective C, and C#
Post by: Gan on December 04, 2011, 12:47:52 PM
Hopefully that should be fixed now that the forums are updated.
Title: Re: C++, Objective C, and C#
Post by: GMG Kurt on December 14, 2011, 09:39:09 PM
how feasible is a translator C++ to Obj-C?
Title: Re: C++, Objective C, and C#
Post by: Gan on December 14, 2011, 10:11:02 PM
It would definitely be possible I suppose.