8 Replies - 3407 Views - Last Post: 11 February 2011 - 02:21 PM

beginner resources questions

Posted 05 July 2008 - 07:53 PM

Just a couple of questions that I hope are easy enough to answer.

first background on my knowledge: Mainly a web designer. I know html/php/mysql. I have recently decided as a hobby I am going to make small video games. I started object orientated programming with python/pygame. I have recently decided it might be fun to program some stuff for the iphone and downloaded the free sdk. I am currently using Mac OS X leopard and am going to be using xcode. I figured before I get ambitious and jump into iphone 2.0 apps. I would make a game using c++ compiled in xcode. That brought me here.

What I need:
The most recommending beginer tutorial for C++ online preferred of course I don't want to buy a book if I don't have to. I know there was a resources sticky and I did look there but honestly for someone so new I didn't know where to start.
I also need a tutorial on using xcode with c++ specifically. So far I can't find it. Just youtube videos which weren't that much of a help.

Also I have a few questions about c++
1) In python, python itself didn't create an interface. I had to use pygame which I think was referred to as a library(i had to type import pygame at the beginning of every script). with c++ do I need something like that? will it already come with xcode?

2) Are cocoa and c++ the same thing or at least similar. I keep seeing resources refer to cocoa as objective-c. If they are different then is cocoa only for mac? I know that c++ can be compiled to be used both on PC and Mac I was just wondering if Cocoa is the same way.

3) why does it say "carbon c++ application" in xcode when you try to start a new project instead of just c++ app. whats teh carbon mean?

Thanks for your help
-Tom

EDIT: also is openGL used with C++ and xcode or instead of? Thanks again!

Replies To: beginner resources questions

Re: beginner resources questions

Posted 05 July 2008 - 08:16 PM

Well we have many threads in the C/C++ forum listing plenty of resources. But I would STRONGLY advise that you buy a C++ book at some point because it is often the best place to get all the scoop on the language, syntax, and also for future reference since the language is vast.

As you can see from the last URL that we have a section to even request a tutorial to be made. We have plenty of programmers looking to share their knowledge and get "kudos" in return. They are often happy to have new topics to write tutorials on.

Now for your questions...

1) Interface design in C++ is usually done through extra libraries. The language itself was designed to be a console based language, but using compilers like Visual C++ 2005/2008 express will give you the chance to write both console as well as the whole windows graphical interface components... all for free. Check out the compiler at the url below...

Once you download and install, you can do the C++ as normal (by choosing an empty project) or you can do full visual c++ gui style windows applications and more.

2) Cocoa is not the same as C++. Cocoa is an API or an "Application Programming Interface" or "framework" which you write code in. Think of it like the .NET framework is to Microsoft languages like VB.NET or C#. You write objective C (that is C boosted with Smalltalk style features) and is typically written to target Mac computers. Now saying this, you can write objective C code that doesn't use the Cocoa library and thus works with any gcc compatible system. But once you use Cocoa you limit your compatibility.

3) With the answer to number 2, you write Objective C using an API like Cocoa or you could use another one of the five major libraries... one being Carbon. Again Carbon is typically for the Mac (as is Cocoa). So once you use functions from that framework/library you limit your applications for being Mac.

So if you want to develop straight ordinary C++ applications you need to get a compiler that supports "ANSI C++". That is straight C++ and is standard compliant. Microsoft C++ can do ANSI C++ as well a slew of other open source and commercial compilers.

Re: beginner resources questions

Posted 05 July 2008 - 08:30 PM

wow that was a lot of good information. I guess my last question is how openGL fits into all this. If I choose to use Cocoa thats an API so it can be used to create 3d graphics down the road? meaning I don't need openGL because its the same thing?

so the three things I need while programming is language/library/api.
language of course being C++.
does cocoa cover both library and api?
also I guess I don't know what an IDE is then. I was under the impression I think that IDE and API were the same thing maybe?

sorry I am so noob. In the last few days I actually started looking into local colleges to take classes on this stuff lol. What I thought I could learn with the internet I am thinking I might need to go to school for now. lol.

Re: beginner resources questions

If I choose to use Cocoa thats an API so it can be used to create 3d graphics down the road? meaning I don't need openGL because its the same thing?

Cocoa is the Framework for creating Mac applications with Objective-C (thatís not the same as C++). As such, Cocoa also provides some hook-ups for OpenGL. though it might be that you can make 3D graphics without using OpenGL (never did that myself, though).

savepoint11, on 06 July 2008 - 03:30 AM, said:

does cocoa cover both library and api?

The Cocoa Framework provides you with several APIs.

savepoint11, on 06 July 2008 - 03:30 AM, said:

also I guess I don't know what an IDE is then. I was under the impression I think that IDE and API were the same thing maybe?

Re: beginner resources questions

Posted 27 October 2010 - 05:43 AM

savepoint11, on 06 July 2008 - 12:30 PM, said:

wow that was a lot of good information. I guess my last question is how openGL fits into all this. If I choose to use Cocoa thats an API so it can be used to create 3d graphics down the road? meaning I don't need openGL because its the same thing?

What I thought I could learn with the internet I am thinking I might need to go to school for now. lol.

I'm not sure if you 'need' to go to school but for most people it is good way to accelerate the early learning process. Some 'naturals' can get all this into their heads by self-learning but most of us do benefit from someone helping us through the early stages.

Another good place to look for stuff is iTunesU. There are some great lecture series there from MIT and Stanford and the like so you get to access some amazing teaching resources for free. Definitely worth a look.

Re: beginner resources questions

I know you said you didn't want to buy a book, but I would suggest the iPhone Programming book by Big Nerd Ranch. I used it, and it really makes understanding the basics much easier.

Ed.

I checked out the iphone programming book and found it very interesting. One Question though, could this book help program apps. for the iPad or does the iPhone and iPad utilize two different languages?

Re: beginner resources questions

Yes completely different.
Completely different Operating Systems.
Completely different programming languages.
That's why apps written for the iPhone will not work on the iPad.

Just to be clear, every statement above is completely false.

Did you think to try any research of your own before asking strangers on a web forum for the answer to a trivial question like this? As shown in the first part of this post people may get it wrong or even lie to you on purpose. Always worth doing your own research before and after anything a random stranger tells you.

If you really couldn't answer this one for yourself after 10 minutes on Google you may find you have a very very tough time ahead as you find you need to research how to actually write your apps.

Re: beginner resources questions

Posted 11 February 2011 - 02:21 PM

I am fairly new to Objective C as well. I have learned that the Apple Development center has GREAT tutorials on how to get started. They cover everything from basic Objective C, xcode, OOP, and all the Cocoa libraries. Also there is a great class from Stanford that you can take for free through iTunes U. It is complete with homework assignments and everything. This is how I got started and honestly, it gave me a pretty decent foundation to start with and it didn't cost me a dime. I hope this helps.