which programming language is best? - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Programming Languages & Scripting (/forum-8.html)
+--- Thread: which programming language is best? (/thread-6227.html)
Pages: 1 2
which programming language is best? - petr6534 - Sep 24, 2004 11:22 AM
I am an intermediate c++ programmer and want to start to develop games and applications for mac OSX. Which language is the best to learn- Carbon, Cocoa, or is there another language that is better?
which programming language is best? - Skorche - Sep 24, 2004 11:35 AM
Carbon is a C/C++ API, and Cocoa is an API for Obj-C. I'd recommend going the cocoa route, it's far easier to learn. Carbon pretty much just around for porting C/C++ programs and for those who did Mac programming in the pre-OSX days.
which programming language is best? - Taxxodium - Sep 24, 2004 11:48 AM
And let's not forget you can integrate Carbon in a Cocoa application. So yes, I second going for Cocoa.
which programming language is best? - Nick - Sep 24, 2004 11:54 AM
I don't think I really use either Carbon or Cocoa. Technically I use Cocoa for SDL but other than that I'm just using C++. I would recommend Cocoa however as there are some very useful functions to use when reading/writing files as well as other things. The downside to Cocoa is the inability to be easily ported.
which programming language is best? - sealfin - Sep 24, 2004 11:55 AM
Or you could just keep your C++ knowledge and use a combination of SDL and OpenGL, and that way target any platform which supports those (Mac OS X, Linux, Windows, and lots of more obscure others...)
which programming language is best? - codemattic - Sep 24, 2004 03:06 PM
Cocoa/Obj-C if you plan on writing Mac applications
If you are writing a game - look at all the free/open libraries available to you. If you are making a 3d game look at Dim3. If you are making a 2d arcade game look at SDL. Look at cross-platform libraries for your image and audio needs.
which programming language is best? - DoG - Sep 24, 2004 03:07 PM
ObjC and Cocoa is definitely the way to go for regular user interface programming, and Carbon is the API of choice to access the OS from C/C++. There is no general best way to go, always get the right tool for the job.
which programming language is best? - skyhawk - Sep 24, 2004 04:03 PM
I use the diagonalization principle, and for each of their arguments, I take the opposite of what they say, I form a programming language you should use based on that. Since no such programming language exist, you should either:
a) not program
b) program in whatever you damn well please cause I know that most of the time, whatever we say in regards to what a person should program rarely ever changes what they eventually program in.
which programming language is best? - Vertizor - Sep 24, 2004 07:35 PM
Everyone has posted some really good advice thus far. All I'll say is:
I'm in the same boat as you, C/C++ is my primary language for over 5 years (4 of it professionally). When I started learning Cocoa, it took me a lot longer to get use to that style of coding than it did to actually learn the concepts, syntax, and Cocoa API. Often I would try to do things that weren't legal in objective-c, or just not how it's suppose to be done.
I then went to learn Carbon for a while. I felt a little more comfortable there because it's at least a language I'm more familiar with. But my stumbling block was the fact that I've been a Windows programmer for so many years, the most notable difference was the way message and event handling was done.
So whatever your background is, if you can let go of old habits it'll be easier. I've done Windows programming, PalmOS, Linux, BeOS. But MacOSX is an entirely new beast to me.
which programming language is best? - Vertizor - Sep 24, 2004 07:48 PM
One more thing:
Specifically with game development, I often hear that using the C language is better because there's less overhead. The "overhead" is in regard to object-oriented languages and data structures. Using smaller, tigher, "struct" data types rather than entire classes may yeild more performance than making everything a class. On the other hand, it does limit you feature-wise, of what you can do in code. If you have a good handle on inheritance and code reuse, C++ might be very useful and almost if not as fast a C code.
There's been a lot of talk about which is better performance-wise: Carbon on Cocoa. I use to hang out in other Mac forums and I notice that there's a lot of misconceptions out there. Many Mac users still don't understand that Carbon has been updated for OSX and the Mach-O executable format. Long story short, the binaries are equally fast. But the more you rely on the API and framework, that's where I believe the differences start to be more clear. For example: I wouldn't consider using too many Cocoa classes that encapsulate data types. Like if I wanted to convert a string of text into a float or an int, the C runtime has functions for that type of operation which I'd gladly use over the NSString object to do the conversion.
With Carbon, I'm a little annoyed when it comes to strings. There's a difference between a Carbon string and a C string, and they're not always compatible. So that involves a string conversion routine before the 2 can be interchanged, and that costs time and memory.
which programming language is best? - ThemsAllTook - Sep 24, 2004 08:51 PM
Vertizor Wrote:With Carbon, I'm a little annoyed when it comes to strings. There's a difference between a Carbon string and a C string, and they're not always compatible. So that involves a string conversion routine before the 2 can be interchanged, and that costs time and memory.
I'm curious what you mean when you say "Carbon string". There's CFStringRef, Str63, Str255, HFSUniStr255, char * (which I assume is what you mean by C string), UniChar *, and probably a few others I'm forgetting...
which programming language is best? - Vertizor - Sep 24, 2004 09:24 PM
I believe it's the CFStringRef vs. char* that I'm complaining about. Most Carbon functions that take a string argument, such as creating a window and setting its title text, take a CFStringRef. I just remember it being kinda tedious having to convert a char* into a CFStringRef then pass that to the function.
which programming language is best? - blobbo - Sep 25, 2004 09:54 AM
start with java. truly, it's very easy to learn, and the concepts are easily applied to objective c or c++. learn c after java, though - then you'll be able to deal with memory management (very important).
which programming language is best? - skyhawk - Sep 25, 2004 11:26 AM
blobbo Wrote:start with java.just ask him to be stupid why don't you.... seriously, java is absolutely the WORSE thing you could start someone with. I would suggest basic or assembly over java ANY day.
which programming language is best? - blobbo - Sep 25, 2004 01:08 PM
skyhawk: Java is an excellent choice for learning how to program. It's very intuitive, and the library is large and strong. I found it very easy to learn - certainly easier than any other language I ever tried to learn on prior to it. Just speaking from experience.