View Full Version : Leaving BASIC - Need help
Garry
2006.09.05, 07:19 AM
Hello,
I am a seasoned user of the BASIC language. I have been using REALbasic for many years but I now feel that I would like to learn on of the more 'traditional' languages, like C.
I had originally settled for REALbasic because it is cross-platform but I have found that (a) it isn't truly and (b) I only really develop for the Mac anyway. I have become frustrated with lack of Universal Binary support in many of the BASIC Mac languages and so I would like to learn another Mac-native language.
I have installed Xcode 2.4 onto my Intel Mac. I understand that Xcode is merely a development environment that is essentially an editor and compiler for several languages such as ObjC and Java. I am also presuming that Interface Builder does what it says on the tin (if I am asking really simple questions, forgive me, REALbasic had one window which was an editor, interface builder, etc).
If I wish to write simple games and apps what language should I learn? Is ObjC suitable for my needs. Will it be difficult to learn given my background in BASIC? Can you point me in the direction of any good resources for (a) using Xcode and (b) learning ObjC (if you think that is the best language of course!)?
Oh, what's the difference between Cocoa and Carbon apps whilst we're on the subject?
Many thanks,
Garry
diordna
2006.09.05, 11:00 AM
You are absolutely correct about Xcode and IB. I really don't know of any good tutorials to show you the ropes of ObjC or Java, and I think it's going to be pretty hard for you to go right into making games. Once you get ObjC's *extremely* un-Basic-like syntax down, you have to learn Cocoa, which takes more brain-warping if you're used to REALbasic. (Cocoa is probably the best way to write apps (not games) for the Mac. It gives you a lot of functionality for free - think font selection menus, copy/paste, etc. I'm going to assume you're not going to learn Cocoa for C/C++, because I've heard bad things. Someone please correct me if I'm wrong.)
Java isn't for games either...unless you know where to look. You could first start writing some simple apps, and once you're familiar with the syntax and the way the language works, you could install the LightWeight Java Game Library (LWJGL) and learn OpenGL on top of Java. OpenGL is probably the best way to draw graphics on the Mac, and it can be used in all the major languages. (C/C++, Java, ObjC, BlitzMax, Python (with an extension), and more.) This is a path I'm currently pursuing myself.
As for Cocoa vs Carbon - when Apple was trying to wean developers off of OS 9, it had to make a way for us to port things to OS X easily. Carbon is a set of APIs that are almost identical in use (but not in implementation) to the old OS 9 APIs. They can be accessed only from C/C++ IIRC. Cocoa is "the new thing," as I explained above, and can be accessed only from ObjC/C++, or Java if you're a bit of a wizard. But no one uses Cocoa with Java. One of the big bonuses of Cocoa is that you get to use Interface Builder to make your GUIs.
My final recommendation is this: You want to make games. You're familiar with REALbasic. You want to get into more complex stuff. I say, try BlitzMax. It'll get you familiar with object orientation and standard ways of doing things. Once you get the normal libraries down, start learning OpenGL in BlitzMax. Then it'll be easy to go to almost any other language, because the syntax across the major languages (except ObjC) is similar. Your knowledge of OpenGL will allow you to write games in most languages, provided you can figure out how to use the input libraries (and BlitzMax makes that last part easy). If you ever need sample code, there's plenty on the Blitz web site, or I can give you a boost. The only real downside to this part is that BlitzMax costs money. $60 if I remember, but I think it's worth it, for me at least.
There is one other option you could pursue. You could learn Python, which is a relatively easy language, and use PyGame with it, which is essentially SDL with extra functionality. This means that you can make cross-platform games without much trouble. Python has its quirks, but so does everything else. Also, it has a huge user base, so you'll have no lack of help, both here and on various Python forums. Once you've got PyGame down, you'll also have most of the basics of OpenGL down too, and can move on to a "bigger" language.
I leave you to choose between these options, or the options of others. I also direct you to this thread: http://www.idevgames.com/forum/showthread.php?t=11896
OneSadCookie
2006.09.05, 06:51 PM
diordna: Cocoa is only accessible from ObjC, Java (now deprecated; don't go there), Python (via the third-party PyObjC) and Ruby (via the third-party Ruby-Cocoa). Note the absence of C & C++ :p
But yeah, search the boards -- this kind of question comes up a lot, and the kinds of answers don't vary very much.
Leisure Suit Lurie
2006.09.05, 06:55 PM
FWIW, working with Interface Builder is not such a shock coming from REALbasic (although its not nearly as slick.) Might as well learn Objective-C.
diordna
2006.09.05, 10:25 PM
OSC, Google says:
Mac OS X 10.1 Objective-C++ Release Notes
Thus, Objective-C++ allows you to use C++ class libraries directly from within your Cocoa application, or to use Cocoa or Foundation objects directly from ...
developer.apple.com/releasenotes/Cocoa/Objective-C++.htm
OneSadCookie
2006.09.05, 10:45 PM
ObjC++ lets you mix ObjC and C++ code within one source file. It does not let you access Cocoa from C++, though.
Taxxodium
2006.09.06, 04:33 AM
Like OSC said, all Cocoa classes can only be accessed via ObjC, but you're free to mix C/C++ in your project.
diordna
2006.09.07, 04:20 PM
Okay, new plan. Discard my old recommendations and go check out Processing. (http://www.processing.org) It's sheer awesome for beginners, and for people like me who just like to mess around. It also lets you write pure Java if you want.
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.