Life Beyond RailsBuilding Cross Platform Applications
DEMO
@parasquidChief Problem Solver
at Mindvalley
Why not Ruby on the browser and on
mobile?
Dead end product
So what if voyager can go to Mars, or dive in the ocean
So what if your hackathon was written in JS that runs on both server and client
So what if your legacy code was written in Ruby (cross platform!)
Can you reuse a significant portion of the code you wrote?
Cross platform is useless if your code
can't be reused.
Reuse of prior work across multiple platforms is the
biggest reason why you want cross platform support
“cross platform” is mostly solved in the
physical world
cable
usb powerbank
usb camera
usb phone
usb ereader
• How does this work?
• Which things can I use this with?
• What can this do?
• How does this work?
• Which things can I use this with?
• What can this do?Encapsulation
Polymorphism
(DESCRIPTOR)
• open()• close()• read()• write()• seek()
You’re not a beautiful or unique snowflake.-Tyler Durden, Fight Club
–Linus Torvalds
“Use common tools tooperate on different things.”
principle: common tools operating on different things
technique: polymorphism
Surface Area of the API is small
principle: information hiding
technique: encapsulation
Oooh. But I already know OOP.
OOP is about programming with
objects
OOP is about programming with
objects
OOP is about the organization of your
program
• Procedural• Object Oriented• Functional• Prototype based• Rails-way based• Hybrid / Combination
How are things
connected?
Rails is omakase.I [am] … the head chef of the
omakase experience that is Rails-DHH
To Rails or not to Rails
–Kent Beck
In a connected system, elements are highly available to each other (via global
state, for example). Adding the first feature to a connected system is cheap. All the resources you need are available.
However, the cost of all those connections is that subsequent features are very likely to interact with previous features, driving
up the cost of development over time.
–Kent Beck
A modular design has connections deliberately kept to a minimum. The cost for the first feature is likely to be higher than in the connected system, because
you need to find the necessary resources and bring them together, possibly re-
modularizing in the process. Features are much less likely to interact in a modular
system, though, leading to a steady stream of features at relatively constant
cost.
Stay on the connected curve until the climb phase, then switch to the
modular curve.Kent Beck
App
Rails
request-response
App
TelnetWeb sockets
streaming
App
RubyMotion
mobile
App
Opal
browser
App
mRuby
hardware
Programming is the act of managing
complexity.
Programming is the act of managing
complexity.
Programming is the act of managing
complexity.
Write flexible, maintainable,reusable code
@parasquidChief Problem Solver
at Mindvalley
Top Related