I'm Writing a Cocoa Book for O'Reilly
Writing a book is a fairly crazy thing to do. It's like coming up with 200 essays on a single subject. You can only do it if you really like the thing you're writing about. Fortunately, I really like making Mac software and teaching other people about it, so O'Reilly asked me to turn that into a book.The book is called Cocoa and Objective-C: Up and Running. It's a ground-level introduction to everything you need to write Cocoa apps. I don't assume you know C or compilers, or anything other other how to use a Mac. It's available now from O'Reilly Rough Cuts. More content will be added before it goes into production later this year.
In short, I took everything I've learned about writing Cocoa tutorials since 2004, cleaned it up, filled in the missing pieces, revamped and updated it for Snow Leopard, and put it all together into one, cohesive walkthrough. If you like the Cocoa articles on Theocacao and the tutorial I wrote for Cocoa Dev Central, I really think you'll like this book.
Who This is For?
I had to figure out who to write for. A book for expert programmers is easier to write because you can assume a lot more; but I wanted to make it possible for anyone to learn Cocoa, even if they had no programming experience. Once I decided on that, though, I had to figure out how to actually do it.
Cocoa is based on Objective-C, which is based on C. So I could write a book on C, then a separate book on Objective-C and Cocoa. The downside is that you could end up wasting time reading about the obscure parts of C that don't apply to modern Mac apps.
Another option is to skip C entirely, and just jump right into Cocoa and Objective-C. I almost went this route, particularly because it's how I learned. But then I remembered how many examples and explanations were going over my head when I was learning because I didn't understand the underlying rules of C. I got a lot of code to work purely by accident.
There's also a good chance that you'll want to use existing C code, and to do that, you need to know how to read and write C. In fact, some of the frameworks in Mac OS X can only be used as C types and functions. And sometimes, you may just need the extra speed of C.
So I asked myself was: "Am I training people to write one-off Cocoa apps, or to be productive Cocoa engineers?" I decided I wanted to make engineers, not just people who can run through basic examples. But it takes time to learn C first, and I want to help you get started right away. So what's the answer?
I decided to teach a core set of C concepts that apply directly to Mac and iPhone programming, leaving out the archaic C conventions that Cocoa has better answers for. So this book has only two chapters on C. They focus on just the parts that you need to be a productive Cocoa programmer.
What If I Already Know C?
The other big decision I made was that the book shouldn't be only for new programmers. I wanted it to be useful for people who already knew C or C++. I know this sounds like hyperbole, but I really mean it. I want to be able able to hand this book to an experienced programmer who's new to the Mac and tell them it will be useful.
So the chapters are setup to be modular. If you already know C, you can skip ahead to the Objective-C chapter. If you've spent some time with the iPhone SDK, you can start with the chapters that cover the frameworks. This was not something I took lightly and was not easy to do, but I think the result will be something that will work for a lot of people.
How Is it Written?
The main job I have in this book is to tell you how Cocoa works in simple terms and a personal voice. The world does not need another big, dense book with distant language. If you read Theocacao or Cocoa Dev Central, the style will probably be familiar, but hopefully even more stripped down.
My editor at O'Reilly, Brian Jepson, encouraged me to talk directly to you, and even write as if we're having a conversation. He also asks questions that he thinks you'll have, and suggests I just answer them directly in the text.
The CocoaBook.com Site
The home base for the book is CocoaBook.com. Please check out the site and share it anyone you know. This is where I'll post the code for the examples, along with any news on new versions or other things that come up along the way. I'm sure a lot of the major developments will end up on Theocacao, too, or you can get updates through my Twitter account.
Another Bonus
Now, what about Cocoa Dev Central? There are a lot of useful tutorials there, and some of them need to be updated. The good news is that I talked to O'Reilly about this and they gave their blessing to posting the revamped versions of the existing tutorials back to Cocoa Dev Central (specified as a percentage of the total book content). This is no small thing to me, and they really get why this is important.
The net result is that O'Reilly is getting a book while still enabling Cocoa Dev Central to be useful resource for Cocoa developers, which I think is pretty fantastic. Outdated content will be refreshed and missing pieces will be filled in. Some of the new content will be unique to the book, because we really want you to buy the book. But all of the tutorials that were previously available will stay that way. Nothing is being pulled from the site.
By the way, the reason I want you to buy the book is so that we can do more of this. This isn't my full-time job, and writing a book is pretty hard. But if you guys and girls like this one, I'll write more. Maybe it's too predictable, but I have to pull out the Disney quote that Brent Simmons first turned me on to, and John Gruber recently brought back into the collective consciousness:
"I don't make pictures just to make money. I make money to make more pictures. I'd rather entertain and hope that people learn, than teach and hope that people are entertained." -Walt Disney
I write software for a living, and I enjoy that very much. But I write tutorials because I like helping people learn how to do something that might change their life. I'll keep doing it for as long as you guys want to read it.
I hope you like it.
I'm Writing a Cocoa Book for O'Reilly
Posted Sep 28, 2009 — 34 comments below
Posted Sep 28, 2009 — 34 comments below
Eimantas — Sep 28, 09 6891
Jeff LaMarche — Sep 28, 09 6892
I wish you the best of luck finishing the book and, more importantly, I hope it sells well.
Roman Busyghin — Sep 28, 09 6893
harald — Sep 28, 09 6894
StuFF mc — Sep 28, 09 6895
Simon Wolf — Sep 28, 09 6896
Fingers crossed for you that it sells well and that you get to write more books.
Dylan Beadle — Sep 28, 09 6897
Having started programming a little over a year ago I can attest to how much your tutorials helped me through the steep learning phase and thank you for helping change my life.
Here's to hoping your book helps change even more lifes!
Steve Harris — Sep 28, 09 6898
Andy Lee — Sep 28, 09 6899
Best of luck. This *may* even inspire me to actually use my Twitter account.
I'd like to say I'll send you feedback, but I always fall short when I make promises like that, and then I feel crummy. So let's just say I'll send you feedback -- if I get around to it.
Steve Johnson — Sep 28, 09 6900
I cannot adequately express how happy I am that you are writing "your book".
I know that it will be absolutely wonderful.
Go get em tiger.
SteveJ
Anderson — Sep 28, 09 6901
Manton Reece — Sep 28, 09 6902
Adam Teale — Sep 28, 09 6904
Darcy Otto — Sep 28, 09 6910
Ken — Sep 28, 09 6912
Objective-C and Cocoa can be understood and grasped by individuals that have used C#, Java or other OO languages.
Interface Builder on the other hand is a very foreign land to someone coming over from Visual Studio, Delphi, or Eclipse.
Mac development frustrations:
10% objc
90% IB
Well... that's where I am at least.
Gus Mueller — Sep 29, 09 6913
Adil — Sep 29, 09 6914
aquaibm — Sep 29, 09 6915
Tedd Fox — Sep 29, 09 6916
Nasser — Sep 29, 09 6917
the "beauty" of cocoadevcentral.com and theocacao.com is one of the main reasons that made me love cocoa. No doubt that I'm gonna ENJOY reading your book.
cheers
Jacob Friis Saxberg — Sep 29, 09 6918
Pat Garner — Sep 29, 09 6919
Steven G. Harms — Sep 30, 09 6920
mmw — Sep 30, 09 6921
Cheers!
Colinj — Oct 04, 09 6927
Cant wait!
Spense — Oct 04, 09 6928
Josh Smith — Oct 06, 09 6929
GJ Nilsen — Oct 07, 09 6933
I just bought the bundle, and I think its interesting so far. When are you planning to release the printed version?
Kamelito — Oct 07, 09 6934
I wanted to but online and peintes but its too expansive.
Why because the taxes were around 11$ and shipping and handling were 30$.
I then purchased only the online version for around 17$
I live in France.
Kml
A R — Oct 07, 09 6935
I know this is off topic but did you ever make a core animation example that was a slideshow. I can't find it on your site if you did.
Tomas Sancio — Oct 12, 09 6939
Steve — Oct 19, 09 6959
GJ Nilsen — Nov 04, 09 6980
Bill — Nov 12, 09 6996