Search
Follow
Recent Comments

Entries in review (7)

Tuesday
Aug302011

Book Recommendations

I have posted the odd book review on this site but I have for some time been meaning to collect my book recommendations into a single page that I can more easily keep updated. Well today I finally got around to adding a resources page to the site and made an initial pass of my bookshelf to see what I could recommend.

My intention is to only recommend books that I have actually used or continue to use. A big problem with technical books is that they can very quickly become outdated. That is especially true right now with books on iOS development which is a topic undergoing almost continual change. As a result of this I actually have only one book covering Cocoa and iOS development currently on my recommended list. Something that I hope will change over the coming months.

One introductory book that is often recommended is “Programming in Objective-C” by Stephen G. Kochan. It has recently been updated to include Xcode 4 but it looks like it will be updated again before the end of the year to cover iOS 5 and Automated Reference Counting (ARC). The Big Nerd Ranch also have some interesting introductory titles including the recently released iOS Programming book and an upcoming Objective-C Programming book. If I find the time to check them out I will of course post my reviews here.

Saturday
Apr092011

Objective-C Fundamentals

There seems to be a never ending number of books which provide an introduction to iPhone and iOS programming. Both the introductory books that I used when starting out with the iPhone are now long overdue an update so I have been on the lookup for something to recommend to new iOS programmers for a while.

Objective-C Fundamentals by Fairbairn, Fahrenkrug and Ruffenach (Manning Publications) takes a slightly different approach to most such books by focussing on the Objective-C language rather than Cocoa Touch. The Cocoa Touch framework is mentioned but more as a way to illustrate aspects of the language. The book is subtitled “For iOS 4 and the iPad” so the example code and framework discussions are targeted at iOS rather than Mac OS X. Having said that most of the language concepts (with the possible exception of memory management) apply equally to OS X programming.

This review is based on an early access edition so there could be some minor changes in the final released version.

Part 1 Introduction to Objective-C

The book starts with the creation of a simple app to introduce Xcode and related tools (examples use Xcode 3). Once that is out of the way it introduces the basic data types. A lot of this discussion is not really Objective-C specific since the data types discussed are really C data types. So C structures and arrays are covered for example. If you are coming to iOS programming with prior knowledge of C this will not be anything new and you can probably skim through the early chapters. However for somebody without much experience of C these earlier chapters are well done. There is a fuller discussion of C basics in the appendix for those that need it.

Things get more interesting when the concept of objects are introduced and I think the authors do a good job of covering the Objective-C way of doing things. The NSString class gets good coverage as do the NSArray and NSDictionary classes. All of which need to be well understood by an iOS programmer. Enumeration and the boxing of basic data types so that they can be stored as objects are also covered. There is some good attention to detail here as some of the more obscure parts of the language that are often overlooked get explained (for example the difference between nil, NULL and NSNull).

Part 2 Creating and Extending Classes

With the basics out of the way the book starts to dig into the core of the Objective-C language. The sections on creating classes cover declaring instance variables and methods. The key concept of getter and setter methods is introduced first before covering the use of property and synthesize declarations and the dot syntax. Subclassing is covered but so are Categories as an alternative to subclassing which is useful. Interestingly there is also a discussion of Class Clusters. I should say that advanced topics such as Class Clusters are not covered to the detail you would find in a book such as Cocoa Design Patterns but it is good to see that they at least get a mention and brief explanation.

The chapter on protocols uses the UITableView as one of several examples but as I said previously this is to illustrate the language concept more than to explain iOS table view controllers. The chapter on dynamic typing covers another of the less well understood Objective-C topics digging into messaging, selectors and runtime typing.

A key chapter in any book on Objective-C or Cocoa has to be the one on memory management. The authors explain memory management through object ownership and use that to introduce the retain/release methods (there is no discussion of garbage collection since this is an iOS book). Autorelease pools are covered as expected but so are memory zones which I confess I have never had to use with iOS. Overall this is a good explanation of a topic that most new iOS programmers struggle with. My only criticism is that you have to wait until chapter 9 for such a key topic to be covered.

Part 3 Advanced Topics

The final section of the book covers a number of advanced topics not all of which are really Objective-C language features. Having said that I think the chapter on NSError is not out of place as it covers why it is often used in Cocoa applications where other languages might instead use exception handling. The chapters on Key Value Coding (KVC), blocks and Grand Central Dispatch are all good introductions to complex topics which are becoming increasingly important for iOS developers.

The one topic that seemed slightly out of place to me was the one on Core Data. There is nothing wrong with the chapter, it is a good introduction to an important topic, I just think it would fit better in a book focussed on the Cocoa frameworks rather than Objective-C. The final chapter covers debugging with emphasis on detecting memory issues such as leaks and zombies. There is no mention of unit testing which would have been a nice addition.

Who Should Read This Book?

With so many books available all wanting to help you master iOS programming it can be difficult to recommend one over another.

I would recommend Objective-C fundamentals to people coming new to the language, perhaps without prior knowledge of C, who really want to master the finer points of the language. The only caveat is that you will probably want to start with a book that covers more of the Cocoa Touch frameworks and iOS development. This book is more suited to filling the gaps in your understanding of Objective-C rather than learning iOS. As such it is likely to be more useful to intermediate iOS developers rather than absolute beginners.

So to summarise this still may not be the first book I recommend you buy on iOS programming but it would make a good second follow up book for many people.

Thursday
Nov112010

Programming Ruby - The PickAxe Book

I am guessing that anybody who has even a passing interest in Ruby or Ruby On Rails probably owns the original Programming Ruby book (otherwise known as the PickAxe book) from Pragmatic Programmers. So I was pleased to see today that they have a special offer on the latest edition of Programming Ruby 1.9.

I have the original Programming Ruby version which covered ruby 1.8 and along with The Ruby Way it pretty much covers all my Ruby reference needs. I have been meaning to buy the upgrade to the new edition for a while but I never got around to it. The book has just been updated to cover ruby 1.9.2 and to celebrate 10 years since publication of the original version Pragmatic are offering the book for just $10 in either eBook or dead tree versions.

I always go for the eBook versions from Pragmatic as they are formatted really well. I use the pdf version to read from the computer and the ePub version to read on the iPhone using Stanza. The book normally sells for $25 so getting it for $10 is a bargain especially if you do not own the original (Pragmatic offer an upgrade from the previous version for $12.50 so the saving is not as big as it first seems for me).

It does not say how long the offer will last so if you are interested I would suggesting getting it while you can…

Tuesday
Sep282010

Design Patterns in Ruby

I just finished reading Design Patterns in Ruby and think it is worth a mention even if you are a dedicated iPhone developer. If you are regular Ruby developer you should definitely check it out. I should clarify that when I say I read this book I really do mean I read it from cover to cover which is not something I can normally say for a book on software.

I mentioned the excellent Cocoa Design Patterns books a while ago which looks at common design patterns in the Cocoa frameworks. This book takes a slightly different perspective in that it focuses on 14 of the classic software design patterns from the so called “Gang of Four” book - Design Patterns: Elements of Reusable Object-Oriented Software. This latter book has a reputation for not being an easy read whereas Design Patterns in Ruby is very well written by Russ Olsen.

The design patterns that the book discusses are as follows:

  • Template Method
  • Strategy
  • Observer
  • Composite
  • Iterator
  • Command
  • Adapter
  • Proxy
  • Decorator
  • Singleton
  • Factory Method
  • Abstract Factory
  • Builder
  • Interpreter

The patterns that are not included are generally those that do not find frequent use in Ruby. In addition, in a section that is much closer to the Cocoa Design Patterns book there are three additional chapters on patterns that are very common in Ruby:

  • Internal Domain-Specific Language (DSL)
  • Meta-programming
  • Convention Not Configuration

The book is written in a very readable style and I found it really increased by understanding of Ruby but also of when and how to apply common patterns in any language. The description of the Observer pattern for example is very easy to apply to the typical iPhone or Cocoa application.

I should also mention that the book starts with some good general advice on OO design and also a warning not to abuse design patterns by using them when it is not appropriate. Basically a design pattern is intended to solve a specific problem, applying a pattern to your code because you just read a pattern book and you want to try it out is likely to cause you some grief.

In Summary

If you have any interest in Ruby you should check this book out. Like the Cocoa Design Patterns book it is not an introductory book but if you are coming to Ruby from another language such as Java or Objective-C it can help you to start thinking the Ruby way.

Tuesday
Sep212010

Apple Magic Trackpad

I have tried all of the recent attempts by Apple to make a decent mouse and by “decent” I mean functional as well as good to look at. The prettiest mouse in the world is of no use if it does not work well as a mouse. So maybe finally at the third attempt I have achieved Apple mouse nirvana…

Apple Mighty Mouse

About three years ago my shiny new iMac came with a bluetooth Apple Mighty Mouse. The mouse was fine, the shape was comfortable but the tiny scroll ball was forever getting clogged making it extremely frustrating to use…

From Mighty to Magic

When Apple announced the Magic Mouse it seemed they had come up with the perfect solution to clogged scroll wheels by eliminating all of the moving parts and making the surface multi-touch. Unfortunately I found it uncomfortable to use and whilst I liked the scrolling and swiping gestures I would often find I would send a window scrolling up or down as I lifted my hand off the mouse…

And Finally The Magic Trackpad

For the last month I have been using the magic trackpad and I have to say that finally I think Apple has come up with something that both looks good and actually works great. If you already have an Apple MacBook then you know how to use the trackpad. The whole surface is actually a button but I find I never use it to click. I have the preferences set so that a single tap simulates a click whereas a two finger tap creates a right-click.

Other gestures that I really like are the two finger scrolling and dragging both of which seem very natural once you get past the initial learning curve. Since the trackpad is static I find it much easier to use on a cluttered desk compared to a mouse as it is always in the same place off to the right of my keyboard.

Battery Life

I found with the mighty and magic mice my rechargeable batteries would last about a week as long as I remembered to turn the mouse off every night. With the trackpad, one month on, I am still using the original batteries and they still show 63% of charge remaining. I no longer even bother to turn it off since it seems pretty good at sleeping and waking up when I need it.

In Summary

Since this is an Apple product it is not cheap compared to a standard mouse so it is worth trying it out in the Apple store first. Given the mixed reaction that Apple mice receive it may not be saying much but I think the magic trackpad is the best mouse that Apple has made so far.