Showing posts with label Book Review. Show all posts
Showing posts with label Book Review. Show all posts

Monday, October 12, 2009

Book Review: Cocoa Design Patterns

cdp.png The Cocoa Design Patterns Book is one I've been anticipating for a while now and the first Cocoa book i've gotten in my hands that I've been really excited to read (i just finally got Bill Dudneys iPhone SDK book and Marcus Zarra's Core Data Book after I already started reading this.) Mac & iPhone Developers face a unique challenge when learning Cocoa in that you are learning 2 things at once, an Object Oriented Language (Objective-C) and the Cocoa Frameworks. As Aaron Hillegass has stated, you can easily learn Objective-C in a couple hours no problem. It's the Cocoa Frameworks that present a challenge to developing a good Mac or iPhone App and that is what this book explains. It takes you through lots of things I see people ask about on the mailing lists like why we use

MyObject *object = [[MyObject alloc] init];
instead of
MyObject *object = [MyObject new];
Overall it has 32 chapters and covers 28 Design Patterns used throughout Cocoa. I particularly liked their approach of going through a design pattern and stating the motivation behind using it, how it works and then also stating the consequences of using the design pattern mentioned and, finally they provide an overview of some areas of Cocoa in which the Design Pattern is used. It leaves you feeling like they really spent a lot of time trying to provide an objective overview of all the design patterns they cover. You might get the impression at first that this is a book for beginners, but then you'd be completely wrong. In fact I don't really felt at any time during reading this book that it was dumbed down for beginners or mentioned topics way to advanced for newcomers to Cocoa. It really felt like just about any Cocoa Developer (even veterans) could pick this up, understand it, and immediately begin using the content in their apps. I learned many things from this book, it filled in some small holes in my knowledge of why some parts of Cocoa operate the way they do. I think this book fills in a really important gap in that we've had intro books for learning Mac or iPhone Development, and we've had advanced books on Mac Development and now we are getting books on various areas of how Core Animation, Core Data, etc work, but we haven't really had anything that sat you down and explained all the various design patterns employed by Cocoa and the other Mac/iPhone frameworks, and how they work in such detail before now. Additionally it provides source code for each design pattern, to not only explain how it works, but takes you through an example of the design pattern in action. It covers a lot of things from MVC to Singletons to Categories, Notifications, Delegates, The Responder Chain, Invocations, etc. About the only thing this book doesn't cover is multithreaded design patterns in Cocoa (that could practically be a book just by itself), and even though it was published after Snow Leopard came out, it was written with Leopard in mind. Given all the other great material it covers I think it's a fair trade off. They even do a good job as well mentioning areas where using Garbage Collection changes something in your code. They briefly mention blocks once, but didn't really say anything more about it, I had wished they'd at least mention it's a feature coming to Snow Leopard. Given when they intended to publish this book I can't say though that I blame them for briefly mentioning as they did. About the only thing I wish this book had is a PDF version of this book so that I could have it on reference on my Mac and search through it at any time like I can with the Pragmatic Programmer Books. Update: people have pointed out they do have a PDF available on the InformIT website link in the comments. The Verdict To say I really liked this book would be a tremendous understatement. In conclusion I think just about every Cocoa Developer out there should get this book, Apple should practically be giving this away with Developer Memberships, it's that good. It doesn't matter if your using Cocoa for the Mac or iPhone, this book is something you should have, the material applies just as well to either area of development. Trust me, you'll be glad you got this book. It really gets you thinking about the design patterns you use in your own code, and how you could design your apps better. I know because it's already got me thinking more about the design patterns I use in my own projects.

Sunday, March 15, 2009

Book Review: Pragmatic Thinking & Learning

prag_cover.pngIn what may be become the first in a series of reviews, I thought i'd share some of my thoughts and some insights into various Computer Science/Programming/Developer related books. I am always reading something so I thought i'd provide some thoughts on these books as I read them. Pragmatic Thinking & Learning is a book that I came across in an unusual way, basically Bill Dudney said he was reading it on twitter, posted a couple updates on his progress and then never really mentioned it again. I was getting done reading Predictably Irrational and the book left me very fascinated about Psychology. I have taken Psychology class, but Predictably Irrational brought it down to a practical level and showed how it applied in the real world with behavioral economics. In that same spirit Pragmatic Thinking & Learning is to Programming & Learning what Predictably Irrational is to behavioral economics. It's a fascinating journey through behavioral theory, cognitive science, neuroscience and some psychology, all while you are learning how your brain is wired and how it all works. Don't let these science terms make you think it's some boring study on how our brains work, as the title says it's Pragmatic Thinking & Learning. In essence it takes you through how your brain works and then quickly applies it to the real world and offers more of a framework for how you can begin to apply the principals presented. Through the tips and studies in this book you gain a lot of unique insight into problem solving, for example how do you teach someone how to play tennis with only 20 minutes of time? One of the things that makes this book somewhat unique is that it forces you to stop every so often and do an activity or think about something. For example I meditated for 5 minutes today, where I don't think I've really ever been instructed on meditation, and I liked doing it so i'll probably continue trying meditation for a while and observe what differences it makes in my day. It's also not just the author making a case for an opinion, there are many citations throughout the book to external resources or studies on a particular subject. It offers some very good tips on things from how to keep yourself organized, how to think out solutions to problems, how as a developer you can try and recover from being interrupted when your in "the zone" and many other things like that. I was surprised when I saw the Rubber Duck debugging technique online one day and then came to read about it later that evening in the book. The book presents a case for something and then tries to get you thinking and get you involved in actively applying that to your situations. My only complaint is the author mentions using a personal wiki to keep things organized and keeps showing he is on a mac and never mentions VooDooPad which I use everyday. I got started using VooDooPad as a way to keep my School notes organized and now I use it for a lot more things, including notes about Cocoa, specific Classes, personal things,etc, it's essentially a Wiki in a convenient self contained document. Overall it's a nice collection of information on how our brains work, techniques to solve problems, how you can learn information or a skill faster and find techniques that work better for you individually. It's been a surprisingly good read and I am glad I bought it because Im sure I'll reference it from time to time from now on.

 
...