Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Beligerent

macrumors regular
Original poster
Oct 24, 2003
218
66
Concord, NH
Can anyone tell me what program I need to start writing programs for Mac OS X. Im a total newbie so I guess I will need a recommendation for a good book or two as well. The ideal book and software will be real simple and start at step one.

Thanks in advance,

Norm
 
I have some links on my web site that should get you headed in the right direction (see .sig). You need the developers tools which you can download for free from Apple's website and should also be on one of your install CD's (it is usually a separate CD that saves Developer Tools on it). I would recommend (for starters) Cocoa Programming for Mac OS X by Aaron Hillegass for starters. All the tutorials were written using the pre-XCode IDE but you should be able to figure them out. A new version of this book is due out in April 2004 (so I'd wait for that).

I would highly recommend that you learn text only things (nothing with graphics) and then move onto GUI stuff. Otherwise you can get too bogged down.
 
dont learn Cocoa/Objective-C as your first language.
Get like an introductory Java programming book first then learn Obj-C. Most Cocoa/Objective-C books out there WERE NOT written for newbies to programming. In fact even the beginner Obj-C programming books will say that it's a good idea to learn C/C++ or Java first because Obj-C is NOT a good starting language, or its sorta difficult because most books will not go through the beginning well assuming you already know how things work, etc.

Use a program like Xcode or SubEthaEdit to write code. Install the Developer Tools so you can compile Java apps, etc.
 
übergeek said:
dont learn Cocoa/Objective-C as your first language.
Get like an introductory Java programming book first then learn Obj-C.

I agree. Learn Java first (forget about C++, Java is better and more simple in many ways). I just recently started programming for the Mac, and OS X has made it extremely easy to transition from Windows. Java is built-in to the OS so you don't need to install any additional software. I use XCode (on the developer's tools CD), which has many nice features, but their are a lot of IDEs for OS X out there.

That said, if you want to develop apps that take full advantage of aqua, you will need to eventually move on to Obj. C. But take your time with Java, it is a great language and makes things like the GUI very easy to implement (plus, running your software on other platforms and the internet is always useful). Good luck!
 
I'd suggest both Cocoa and C, but first a question...

Hi Norm,

What kind of programs are you interested in creating?
- Applications with a graphical user interface (GUI)?
- Data analysis, text processing or utility scripts/automation?
- Games?

There are many different and contradictory programming languages and approaches, much as there are many wildly different and hence incomprehensible languages spoken across the globe.

Before you blindly jump into anything, please reply with a short description of what soft of code you're wanting to write. I'll gladly give you an opinion then, because the answer will depend on your goals.

Best,
Logicat
 
I learned some C++ in high school, and I'm currently learning even more C++ in college. Even after understanding how OOP works, looking at xCode and Objective-C still makes my head spin a little.
 
Beligerent said:
Can anyone tell me what program I need to start writing programs for Mac OS X. Im a total newbie so I guess I will need a recommendation for a good book or two as well. The ideal book and software will be real simple and start at step one.

Thanks in advance,

Norm

Getting a book and some software is a great way to get into a new programming language, or to refresh what you already learned. However, I strongly recommend taking and intro to programming class at a local community college. I think that way they will hammer the basics of programming in a way no book can. Once you pick up the stuff and become familiar with writing logic, using variables, etc. it is much easier to take a book and educate yourself more.

That being said, Java would be a good place to start. A good class will teach you the principles of Object Oriented Programming, logic, flow control statements, etc. Once the basics are picked up, you can look at other languages or move on to learn more about Java.

Like some other posters said, start with simple programs in text based environments and focus on learning the logic. Then you can move on to graphics and stuff like that.

What is your background if I may ask? Major, computing experience, etc?
 
Who wants to learn how to cook?

How about an analogy:
- Someone on this forum announces that they'd "like to learn how to cook." Sounds great. One person suggests that stir-frys are the easiest to learn. Someone else says that baking is the best first-step there is. Another says, start with food your parents used to cook for you when you were a child.

The very first question should be: what do you want to cook?

The techniques are all very different, require different skill sets and supplementary equipment. Also, some cooking styles are very effective within a short period of time, e.g. stir-fry, while others can be very hard for newcomers plus often require non-standard kitchen implements, e.g. pastries.

There is no generic right answer. It all depends on what Norm would like to produce as an end product.


[edit]
iShater has another good suggestion. A community school crash-course might allow for a basic grounding of the basics. In the end, and especially as you continue learning how to program, you realize that many of the concepts are useful across many different languages. The more you learn, the easier it will be to learn new programming languages, the better your code will become. It's an endless cycle.
 
logicat2001 said:
Hi Norm,


Before you blindly jump into anything, please reply with a short description of what soft of code you're wanting to write. I'll gladly give you an opinion then, because the answer will depend on your goals.

Best,
Logicat


Hi logicat,

The type of programming I want to do is more things like write my own instant messaging program or maybe another P2P app. Big jobs huh?
 
Beligerent said:
Hi logicat,

The type of programming I want to do is more things like write my own instant messaging program or maybe another P2P app. Big jobs huh?

So you're interested very specifically in an ad-hoc networking application?

Gosh, you are leaping forward with confidence. Are you running on OS X? Does this need a GUI or will it provide this service in the background as other existing clients for this service connect to it? Are you interested in serving files or just allowing for multiple clients to send text back and forth, aka. IM?
 
i'd like to also suggest trying a little AppleScripting as well. it will allow you to get familiar with syntax and also provide immediate results to test out on your Mac. later on, add AppleScript Studio to the mix and you can build some very cool little Cocoa apps with GUIs and all. some of the best Shareware apps out there are nothing more than nice AppleScript Studio apps. just a suggestion.
 
Funny who you find wandering across different forums...

tjwett said:
i'd like to also suggest trying a little AppleScripting as well.

Hey tjwett,

I'd agree but have you ever found a decent reference for AppleScript? That's the only thing that I found frustrating. The one book I've got is outdated and was really not ever useful to me (I'm not really sure why either, as I'm always reading through some technical reference or another): Danny Goodman's AppleScript Handbook

I'd be interested to hear if you've found any resources.

Thanks,
Logicat
 
As an Amazon Associate, MacRumors earns a commission from qualifying purchases made through links in this post.
logicat2001 said:
Hey tjwett,

I'd agree but have you ever found a decent reference for AppleScript? That's the only thing that I found frustrating. The one book I've got is outdated and was really not ever useful to me (I'm not really sure why either, as I'm always reading through some technical reference or another): Danny Goodman's AppleScript Handbook

I'd be interested to hear if you've found any resources.

Thanks,
Logicat

we meet again! haha, yeah the pickins are kind of slim when it comes to good AppleScript training. i bought "Teach Yourself AppleScript in 24 Hours" (Yeah Right) from Sams Publishing. it was eh, OK. i'm excited to see that Apple's own AppleScript Project Manager - Sal Soghoian - is releasing his own book entitled "AppleScript 1-2-3". i have a very good feeling about this one, coming right from the horse's mouth. also noteworthy, O'Reilly very recently released "AppleScript: The Definitive Guide" which i hear is not exactly a beginners tutorial book but is getting good reviews as um, a definitive guide! there is only one single publication i have come across that i consider to be a really good, no make that absolute must, for starting with AppleScript. it's called "AppleScript for Absolute Starters". and even better, it is a totally free PDF e-book! really really good. you can get that here:

http://www.applescriptsourcebook.com/tips/AS4AS.html

aside from those i've been able to learn most of what i know (which isn't much) from the web. i'd say the number one resource for AppleScript online is hands-down http://www.macscripter.net
there is an awesome message board with some extremely knowledgeable members. very friendly and helpful only problem for me is that they are so good that i often go there looking for some tips or just a little push and they end up posting a complete, sophisticated solution for my problem oh, in about 10 minutes! making me lazy.

hope that helps. probably bump into ya on yet another forum sometime soon. :D
 
As an Amazon Associate, MacRumors earns a commission from qualifying purchases made through links in this post.
logicat2001 said:
How about an analogy:
- Someone on this forum announces that they'd "like to learn how to cook." Sounds great. One person suggests that stir-frys are the easiest to learn. Someone else says that baking is the best first-step there is. Another says, start with food your parents used to cook for you when you were a child.

The very first question should be: what do you want to cook?

The techniques are all very different, require different skill sets and supplementary equipment. Also, some cooking styles are very effective within a short period of time, e.g. stir-fry, while others can be very hard for newcomers plus often require non-standard kitchen implements, e.g. pastries.

There is no generic right answer. It all depends on what Norm would like to produce as an end product.


[edit]
iShater has another good suggestion. A community school crash-course might allow for a basic grounding of the basics. In the end, and especially as you continue learning how to program, you realize that many of the concepts are useful across many different languages. The more you learn, the easier it will be to learn new programming languages, the better your code will become. It's an endless cycle.

Maybe he just wants to eat, and doesn't care what he cooks. :D
 
Beligerent said:
Hi logicat,

The type of programming I want to do is more things like write my own instant messaging program or maybe another P2P app. Big jobs huh?

This is not exactly the type of project you will be able to start with!

I would advise learning something like Python, which is included with OS X, first. Python forces good code structure and style by making indenting essential and many universities seem to be adopting it as their primary teaching language. Once you have got to grips with creating a simple command line programs you can the move on and try the same things in C. You can use sockets (which are for network apps such as P2P clients) in both Python and C (via the BSD sockets APIs). Finally you will need to learn the Objective-C extensions to C and object oriented programming. OO programming can be learned with Python or with Objective-C but I would probably choose the former.

This is just one possibility for learning to "real" programming. Other languages that could initially be used are Java and PHP. Both these languages are relatively easy to get started in but have an extensive set of features to learn as you progress.
 
tjwett said:
we meet again! haha, yeah the pickins are kind of slim when it comes to good AppleScript training... :D
Hey man, thanks for the AppleScript references; all new ones for me.

Beligerent, if you're still on this thread, you might check out this search results page from SourceForge

This is a list of projects in various stages of development that: run on MacOS X, are written either in C or Objective-C, and use Cocoa. There are several projects that involve networking or chat clients. It might be enlightening to browse the materials, or even the code, just to get an idea of what might be involved. Of course much of it will not make quick sense to you, but I think you'll either get excited or put off.

IMHO, C is only useful when learning programming because it's very small. Also, many of the basic syntax, conventions and assumptions of C are found in other higher-level programming languages. Therefore, as low-level and frustrating as C can be, it's still a very useful intro to programming.

The Cocoa API, when paired with XCode (or ProjectBuilder) and InterfaceBuilder, is incredibly quick to whip out an application's skeleton, especially when you're thinking to create a graphical interface. Objective-C adds just a couple (literally just a hand full) of conventions to straight-up ANSI C, and yields a fantastic and very readable, object oriented language.

One of Cocoa's biggest strengths when compared to Java, is the size and organization of it's API. Java gets really huge, really quickly. The object hierarchy for the Cocoa API is quite slim and felt sensibly organized, really quickly for me.

Here's my Top Five book list for Cocoa/Objective-C:
Aaron Hillegass's most excellent Cocoa introduction Cocoa Programming for Mac OS X

When you're done with that one, skip on over and check out my defacto Cocoa bible, Cocoa Programming. Just a fantastic book, application design reference and compilation of knowlege from three individuals who've worked with these frameworks for many years.

O'Reilly's Cocoa in a Nutshell, the API listing you've been yearning for.

Always remember to include Apple's own Cocoa developer pages.

Finally, go right to the source: Brad Cox. He invented this stuff and wrote a superb book about object oriented programming and objective C. It's small and available used on Amazon.


Maybe he just wants to eat, and doesn't care what he cooks.
Aw great, now I'm hungry...

=
Logicat
 
As an Amazon Associate, MacRumors earns a commission from qualifying purchases made through links in this post.
thanks for those links to the AppleScript beginners stuff. i've been meaning to learn that for a long time.

i also just stumbled upto the hotkeys for AppleScript studio or something. i never knew you could record an AppleScript just like a macro! :eek: :D very handy stuff! :)
 
Alot of people have allready mentioned some great books, but when I was learning Cocoa programming the books were still kinda confusing, their were alot of references to Obj-C info that just confused me. So I download the following PDF from Apples web site:

http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/ObjC.pdf

Its a little bit of a dry read, very technical, but I've found understanding HOW the language works helped alot, because my previous experience was with C++ it helped me learn how Obj-C did things different, which helped alot. Since you have an understanding of C++ you should be able to work through the info, and then you can tackle all the tutorials without any confusion.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.