[MacRuby-devel] MacRuby Book expectations

Jean-Denis Muys jdmuys at kleegroup.com
Fri Feb 4 01:30:49 PST 2011


On 4 févr. 2011, at 05:53, "Perry E. Metzger" <perry at piermont.com> wrote:
> 
> On Thu, 3 Feb 2011 17:35:08 -0800 Matt Aimonetti
> <mattaimonetti at gmail.com> wrote:
>> I don't really aim for this book to be a Cocoa book, but a MacRuby
>> book which is really hard since it's like writing a book about
>> Objective-C without covering Cocoa in depth.
> 
> It does make it a bit harder to use, though, for someone coming at
> this without an extensive Cocoa background...
> 
> -- 
> Perry E. Metzger		perry at piermont.com
> 

I am at the other end of the spectrum: I am an experienced Cocoa/Objective-C programmer and a Ruby newbie.

I strongly believe that I am in the demographics for the book.

I don't expect the MacRuby book to teach me Ruby. Quite often, when reading the book (in its current form), I feel I don't understand the code snippets, simply because I don't know Ruby. What I do then, is put aside the MacRuby book, pull out a generic Ruby book (or Google), and research that part of Ruby I don't understand.

Granted, this slows me down considerably in my reading of the book, but I believe this is the correct way for me to learn.

I would suggest the converse is valid for experienced Ruby programmers. When you feel you don't understand some Cocoa bit, you can go to Apple documentation (on the web or from Xcode), and research it. It's rather good.

I don't think it is reasonable to expect that a MacRuby book should teach you Cocoa.That would be a different book, possibly titled "Cocoa Programming with MacRuby".

The example of Core Data is a good example. Core Data is a framework that I had a hard time understanding in the first place, irrespective of the language. Full books have been written about Core Data. It is not reasonable to expect the MacRuby book to teach you Core Data.

So what are *my* expectations for a MacRuby book?

I expect the book to address two facets of software development with MacRuby:

- How to integrate MacRuby in my software development tool set on the Mac. This includes  topics such as:
  • Using Xcode with MacRuby (other IDEs too when applicable).
  • How to use MacRuby to develop Cocoa Apps.
  • How to "add" MacRuby code to an Objective-C Cocoa App.
  • How to "add" Objective-C code to a MacRuby Cocoa App.
  • How to take advantage of Ruby's dynamisms in Cocoa. How to fix bugs without restarting the application for example.
  • How to debug (breakpoint, step, trace) MacRuby code in a Cocoa app from Xcode
  • How to add a REPL (Read Eval Print Loop) to a Cocoa app
  • How to expose a Ruby evaluator to a Cocoa app (for kind of Spreadsheet-like features for example)
  • How to use standard Ruby libraries (are these called gems?) in a Cocoa app.
  • The dynamic runtime: what it can bring you, how to use it…
  • Interface builder and MacRuby: outlets, actions, bindings.
  • Key-Value Coding and Observing. How does it fit with Ruby's introspection feature.

- How to take advantage of/cope with the idiomatic differences between Ruby and Objective-C/Cocoa. From adopting an Objective-C style to a full Ruby style (was that HotCocoa's goal?), the spectrum is quite large I guess. No size fits all. But a cookbook approach could be useful. Select a number of typical Ruby idioms, discuss when they would be interesting to use in a Cocoa context, and how to do so. Core Data and ORM might be a large such example. A smaller example would be using map/apply/reduce with Cocoa's collections: how do they fit with Cocoa's iteration facilities…

But I don't expect the book to:
- teach me about Cocoa: I already know that stuff. I don't need it.
- teach me about Ruby: I don't know that stuff, and I really need it, but I can find it elsewhere.

For those two needs, the book could possibly help with footnotes and/or sidebars with pointers to the relevant literature. This is not easy to write. It is difficult for the author to anticipate that such and such point under discussion uses some construct that might be foreign to some reader but not others. This probably requires readers of all possible profiles to point those out.

Such a book would then benefit both populations of experienced programmers. It would probably not be the book for an absolute beginner. But that would be another book altogether (I would love such a book to teach programming to children/teenagers).

Jean-Denis



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20110204/7f899246/attachment.html>


More information about the MacRuby-devel mailing list