Learning the iOS 4 SDK for JavaScript Programmers:
Learning the iOS 4 SDK for JavaScript Programmers:

Author: Danny Goodman
Publisher: O'Reilly, 2010
Pages: 318
ISBN: 978-1449388454
Aimed at: JavaScript programmers
Rating: 3.5
Pros: A good introduction to Objective-C and Cocoa
Cons: Difficult to make parallels with JavaScript as it progresses
Reviewed by: Ian Elliot

Introduces iOS4 development from the point of view of a JavaScript programmer - does it work?

This is an interesting idea - a book that introduces iOS4 development from the point of view of a JavaScript programmer. Notice that this isn't a book about iOS4 development using JavaScript because such an approach is impossible. The main development language for the platform is Objective-C and JavaScript can only be used to create web apps that just happen to run on iOS devices. If you want to create a native application you have to code in Objective-C and there is no choice.



The book starts off with a look at "Why Go Native" which explains why you might want to take advantage of the hardware and run outside of a browser. It also discusses the cost of joining the Apple app store, what you get in return and how it all works. Chapter 2 deals with getting the SDK and installing it and Chapter 3 tells you how to create your first project. 

It is at Chapter 4 that the JavaScript approach starts to go a little wrong. The problem is that using Objective-C, Xcode and the SDK in general isn't very much like working in JavaScript. The application structure is quite different and more sophisticated and the language is classically object oriented, strongly typed and not at all dynamic. What this all means is that from chapter 4 the appeal to what you know about JavaScript becomes increasingly less helpful.

By Chapter 7, which looks at the details of the C language, you should be getting the hang of iOS development and forgetting, JavaScript but it keeps being popped up to motivate what follows. Chapter 8 concludes the introduction to the SDK with a look at using Objective-C and Cocoa Touch. 

Chapter 9 forms a sort of cookbook of tasks but the big difference is that they are organised as how to do common JavaScript tasks in Cocoa Touch. So you format a number in JavaScript but how you do it in Cocoa touch isn't really related and so why organise things in this way?

On the plus side the book does point out the big differences between working in JavaScript and Objective-C. For example, it explicitly tells you that you can use a C array with the sort of flexibility that you expect from a JavaScript Array object and this  could well be useful. However the differences in the environment are so great that any programmer reaching page 151, where C arrays are introduced, still expecting anything much to be like JavaScript isn't really thinking about it. 

Another, and perhaps more important, problem with the book is that it is very focused on small tasks and not on creating whole apps. It also doesn't take you into many of the areas of the API that are the reason you decided to go with native app creation, i.e. there's nothing much on using the hardware. This is a slim book and can't cover everything, but you do need to know that you will need a second volume to get up to speed on creating more adventourous apps. 

Overall this is quite a good introduction to Objective-C and Cocoa but I suspect it would be even better if the link with JavaScript was removed. It's a nice experiment but one that ultimately probably doesn't work. On the other hand if you really only know JavaScript and feel that having the new compared with what you already know might be useful then give this book a try. 


Beautiful Code: Leading Programmers Explain How They Think

Editors: Andy Oram and Greg Wilson
Publisher: O'Reilly, 2007
Pages: 618
ISBN: 978-0596510046
Print: 0596510047
Kindle: B0026OR2NG
Audience: Anyone who has an interest in programming
Rating: 4.5
Reviewer: Mike James

This collection of essays is approaching its 10th anniversary. It isn't [ ... ]

97 Things Every Programmer Should Know

Author: Kevlin Henney
Publisher: O'Reilly, 2010
Pages: 258
ISBN: 978-0596809485
Print: 0596809484
Kindle: B0039OVIAK
Aimed at: Practising programmers
Rating: 5
Reviewed by: Alex Armstrong


The 97 Things series presents a well-chosen collection of short essays in a highly accessible way. Th [ ... ]

More Reviews

Last Updated ( Thursday, 24 March 2011 )

RSS feed of book reviews only
I Programmer Book Reviews
RSS feed of all content
I Programmer Book Reviews
Copyright © 2018 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.