Sure, I Could Learn Objective-C, but

Preview:

DESCRIPTION

Slides from the presentation that I gave at the Kod.io conference in Istanbul, on October 26, 2013. In this presentation, I look at how RubyMotion can be used for much more than just a direct translation of Objective-C.

Citation preview

Sure, I could learn Objective-C but...

Isn’t there something better?

Joshua Ballanco

@manhattanmetric

https://github.com/jballanc

Joshua Ballanco

@manhattanmetric

https://github.com/jballanc

What is Objective-C?

• Object Oriented

• Message Passing

• SmallTalk Inspired

• Strict Superset of C

Objective-C Explosion

Why?

Duh...

Is there another option?

What is Ruby?

• Object Oriented

• Message Passing

• SmallTalk Inspired

• Strict Superset of C

RubyMotion is Rubyfor iOS and OS X

Learning a New Language

Stage 1

I understand what you’re saying...but I have no idea how to reply

Learning a New Language

Stage 2

I know how to construct statements,but they are direct translations

from that other language I know

Learning a New Language

Stage 3

I get it!

How to learn RubyMotion?

• If you don’t know Objective-C...

• GREAT! Go for it!

• Directly Translate

• Apply Ruby Refactorings

• Re-Open Core Types (Monkey-Patching)

• Build Modules

• Use Wrappers

How to learn RubyMotion?

JTGestureBasedTableViewhttps://github.com/jamztang/JTGestureBasedTableViewDemo

GestureTable Samplehttps://github.com/HipByte/RubyMotionSamples/tree/master/ios/GestureTable

Direct Translation

Obj-C

RubyMotion

Direct Translation

Direct Translation

Direct Translation

Obj-C

RubyMotion

Direct Translation

Obj-C

RubyMotion

Direct Translation

Obj-C

RubyMotion

Direct Translation

Obj-C

RubyMotion

Ruby Refactoring

Ruby Refactoring

Re-Open Core Classes

Modules

Modules

Wrappershttp://motionwrappers.com/

Wrappershttp://motionwrappers.com/

Wrappershttp://motionwrappers.com/

Wrappershttp://motionwrappers.com/

Wrappershttp://motionwrappers.com/

Why should I use Objective-C

• Speed

• Interface directly with C libraries

• Like long method names

Why should I use RubyMotion

• Development speed

• Clear, concise business logic

• Use high-level wrapper libraries

Moral of the Story...

Use the best tool for the job...and there is more than one tool!

Recommended