# c, or cocoa learning resources



## paleafterglow (May 1, 2002)

hello,

i do alot of design and programming work... mainly web based.  i do quite a bit of PHP and MySQL stuff.. mainly just running off my own machine.

anyways.. i would really like to learn to develope applications on mac os x.  but i have a few questions:

1::  what would you guys suggest i learn first... c, c++, or cocoa... of should i look into java?  im away of the learning curves and what not between c, c++, and objective-c... but i have also read that cocoa can be a challenge to experienced c programmers as well.  im leaning toward cocoa.  but what do you guys suggest?

2::  can any of you point out any good on-line resources or good books to pick up?  which would you suggest?


thanks very much


----------



## holmBrew (May 2, 2002)

I too want to make apps for OS X!!!!

viva la OS X!!!!

Anyway, an friend told me to learn C and then focus on Cocoa.  So I bought "Teaching Yourself C in 21 days" a SAMS Publishing book that is pretty good, and they I was advise to buy "Cocoa Programming for Mac OS X" by Aaron Hillegass.

Although I have not been able to devote the time and grey matter to work thourght these heady tomes, I have look through a read sections of each and they are quite good, especially the Hillegass book.  He is basically one of the brains behind Cocoa, so you get theinfo straight from the horses mouth when you read this book.

Have fun, and right something cool!


----------



## paleafterglow (May 2, 2002)

thanks much for the reply... and for the info.

i have one idea for a serious app i would like to build.. but its just that, an idea

for the first app to create i was thinkin about trying my hand at creating a web browser... not really for distribution.. i have no interest in joining the browser war.. i just want to make my own for my own personal use so i dont have to use IE of netscape or any of the others.. there are some out there that are nice.. just want to make my own

think this is too big of a project to start off on?  any idea where i can get info on developing a web browser?  i checked out the mozilla stuff.. but im not sure i would want to base it on mozilla.  i dont know.

anyways.. thanks for the info and all that


----------



## Koelling (May 4, 2002)

A browser is a little heavy so early. I suggest going to http://oreillynet.com/ and looking at their cocoa stuff. It is really basic but you get a text editor to work in very little time. It's a great feeling to get something to work like that and then you can tweak things to see what goes where. The latest article creates a graphics editor so maybe you want your first project to be a long those lines. Web just has so many rules and protocol


----------



## paleafterglow (May 4, 2002)

hey thanks very very much for the link... the text editor tutorial was really helpfull..

it left me a little confused in general, but i think it just my lack of understanding cocoa and oo programing in general.  i dont think i have a clear understanding of some of the methods either.. but a good article still... 

again.. thanks very much


alan


----------



## googolplex (May 5, 2002)

Yeah, a browser is a huge project. You don't want to get into that. If you are looking for a cool cocoa browser check out chimera (http://chimera.modev.org) its a cocoa browser using the mozilla rendering engine. Pure bliss .

end chimera endorsment. 

Cocoa Programming for Mac OS X by Aaron Hillegass is very very good. I bought it to help me learn and it is really helping!


----------



## voice- (May 6, 2002)

So this is what it's coming to, we were Apple customers and cultish, now we're all(me included) becoming developers...
I'll look into Cocoa Programming, hope it's helpful...


----------



## googolplex (May 6, 2002)

Its kind of strange eh? The platform thought to not be good for developing is all of a sudden becoming huge and is getting lots of users and new users to develop for it.


----------



## voice- (May 6, 2002)

Well, at least that is a clear sign that a) Apple is doing something right and b) that we really like this new OS


----------



## paleafterglow (May 6, 2002)

im having alot of fun (and some frustration) with learning the development and programing side of macs... but dont get me wrong... i still love designing and creating visual pieces and graphics

i guess really getting into actionscript, php, and mysql really started me off with the programing stuff

and again.. thanks for all your help.. i ordered the "cocoa programing for mac os x" book and hope to get it soon


----------



## nkuvu (May 6, 2002)

To learn the basics of OO programming, I'd suggest looking at Java.  It's fairly easy to learn, and can get you up to speed on OO concepts relatively quickly and painlessly.

Cocoa might be the same -- haven't tried it yet...


----------



## googolplex (May 6, 2002)

Cocoa might not be the best language to start of with, but for me it was just too damn cool to waste my time on something else . Most of the books and tutorials say that they require a knowladge of ANSI-C. I did not know any C and I am able to find my way through cocoa. I did have an idea on how Object-Oriented programming works.

There are things about cocoa that make it hard (some syntax things, etc.) but there are more things that make it really easy and cool (interface builder integration, etc.).


----------



## paleafterglow (May 6, 2002)

like i said above... i have had a little frustration with some aspects... but im gonna stick with.. 

im quite fluent in php,actionscript,javascript,html and all that stuff.. im a little familiar with asp and i know enough perl to extensively edit existing perl scripts.  so im not completely new to programing.. but i am new oop

but like i said.. its been pretty fun and kool so far.. just been reading alot about it and going through some tutorials

thanks for the support and everything


----------



## xaqintosh (May 8, 2002)

What programming language would you suggest starting out with (for a complete programming newbie)


----------



## nkuvu (May 8, 2002)

> _Originally posted by xaqintosh _
> *What programming language would you suggest starting out with (for a complete programming newbie) *


Assembly.  Definitely.  

Or more seriously, I think Java is a good start, C/C++ are both probably a bad start, Perl might be too confusing, a lot of people like Python (I don't, but that's personal preference).

So all in all I'd say Java -- I know that a lot of universities are starting to adopt Java as the "Programming 101" language, then moving to C++ in later courses since C++ is currently the market standard.  But Java is simpler, IMHO.


----------



## xaqintosh (May 8, 2002)




----------



## paleafterglow (May 8, 2002)

ok i created my second app with cocoa... a random number generator... really simple.

i think the thing that im getting confused and mixed up about the most is just the terminalogy... like the differences and relationships between methods, classes, instances/instance variables, objects and so on...

ugh... back to reading


----------



## googolplex (May 8, 2002)

Do you have a book or are you learning from online tutorials? If you have a book, which one did you get?


----------



## paleafterglow (May 8, 2002)

mainly just been reading the "Cocoa Programming for Mac OS X" by Aaron Hillegass... and its actually a really easy to read book.. the only thing is that it assumes that the reader is already at least familar with the terminology.  i have gone through some tutorials in the "Programming With Cocoa" section on oreillynet.com and those were pretty good.

i think i understand classes and methods best... let me see if i got it straight

a class is basically a set of methods, and a method is basically a function... is that right?

anyways... thanks for the help and all that


----------



## googolplex (May 9, 2002)

Thats basically right.

I have that book too. Its very good.


----------



## nkuvu (May 9, 2002)

> _Originally posted by paleafterglow _
> *mainly just been reading the "Cocoa Programming for Mac OS X" by Aaron Hillegass... and its actually a really easy to read book.. the only thing is that it assumes that the reader is already at least familar with the terminology.  i have gone through some tutorials in the "Programming With Cocoa" section on oreillynet.com and those were pretty good.
> 
> i think i understand classes and methods best... let me see if i got it straight
> ...


A class can also contain data.  Basically what you're looking for is an explanation of an ADT (abstract data type) which is the same as a class.  Easy, huh?  

An example of a class could be something like "Shape".  In this class, you can have methods (or functions, basically the same terminology but different languages tend to use different words (in C it's called a function, in Java it's a method)).  Ahem, Let me get back to where I was before I interrupted myself...

The Shape class could have methods, like Set_Size or Get_Color or Copy or whatever.  Along with these methods, it might have built in information.  For example, when you use the Set_Size method it alters internal information.  The Get_Color method would return the current information.

The hard part for me when I was learning OOP was the difference between an _instance_ of a class and the class itself.  The class is more general.

For example, if I am talking about all different kinds of shapes, without talking about specific sizes, colors, or number of sides, I'd be talking about the Shape class.  But if I am talking about a blue square that's 1 meter per side, that is an instance of the class Shape.

Hopefully this isn't too confusing...


----------



## nkuvu (May 9, 2002)

Also, there's a good series of articles at 
http://www.oreillynet.com/pub/ct/37

OOP is specifically talked about at http://www.oreillynet.com/pub/a/mac/2001/04/20/cocoa.html


----------



## paleafterglow (May 9, 2002)

i think im confused most about the difference between an instance of a class and the class itself... but that was a really clear explination of it.. thanks very much

the further explination of classes was really helpful too

thanks so much for the help, all you guys are awesome... but i have one more question


what is the difference between an instance of a class and an object?  an object could be a button... but wouldnt the button also be an instance of the NSButton class?  i dont know.. sorry if this is a dumb question


anyays... thanks for all the help


----------



## xaqintosh (May 9, 2002)

here at macosx.com, there are no "dumb questions"


----------



## celeborn (May 9, 2002)

> _Originally posted by paleafterglow _
> *
> what is the difference between an instance of a class and an object?*



At least in OO system analysis & design an object = an instance of a class. Haven't done any OO programming (or much programming of any sort, for that matter), so I won't say anything more.


----------



## xaqintosh (May 13, 2002)

> _Originally posted by nkuvu _
> *
> Assembly.  Definitely.
> 
> ...



Thanks, by the way, what is Assembly? I'm assuming its a really hard language to learn. Also, If I learnedC++ for Windows, would I be able to program Mac Stuff?


----------

