Slide 1

Slide 1 text

DO THE WORK Scottish Ruby Conference 2014 Lori Olson

Slide 2

Slide 2 text

LORI OLSON • [email protected] • www.wndx.com • @wndxlori • Freelance developer, mentor, trainer • CANADA!

Slide 3

Slide 3 text

KUDOS Changing the world, one Thank You at a time! kudosnow.com

Slide 4

Slide 4 text

LADIES LEARNING CODE Instructor/Mentor

Slide 5

Slide 5 text

TELL YOU A STORY I’m going to tell you a story.

Slide 6

Slide 6 text

CAUTIONARY TALE It’s a somewhat cautionary tale

Slide 7

Slide 7 text

DOWN THE RABBIT HOLE About just how far down the rabbit hole you can go…

Slide 8

Slide 8 text

INSTEAD OF DOING THE WORK when, instead of doing the work

Slide 9

Slide 9 text

FALL INTO THE TRAP OF AVOIDING THE WORK you fall into the trap of avoiding the work, looking for the easy way out.

Slide 10

Slide 10 text

THE STORY

Slide 11

Slide 11 text

WRITE A RUBYMOTION APP As a side project, to learn more about RubyMotion and iOS Development

Slide 12

Slide 12 text

WIMBY Wells In My Back Yard So I picked WIMBY, or Wells in My Back Yard. That’s a play on NIMBY, or Not In My Back Yard. ! You might call that a garden….

Slide 13

Slide 13 text

CALMAR, ALBERTA, CANADA • "According to the records, they believed that somewhere in that vicinity was a well site," recalled Ms. Beaudry, 45, a mother of two. They guessed right. In her backyard, a metre from her house, crews found a broken, leaking, 50-year-old natural gas well.

Slide 14

Slide 14 text

BUT WHY? HOW? How is it even possible for people to not know they have an abandoned well on their property? ! Once the wells were abandoned, Imperial/Texaco Canada surrendered the lease back to the landowner and consequently no longer had an interest in the lands. Caveats were later removed from the land titles because there was no regulatory requirement that provided for registration of well locations on land titles once activity had ceased.

Slide 15

Slide 15 text

WELLS ABANDONED IMPROPERLY It was only in the mid 60’s that rules and regulations acquired some teeth, and wells had to be abandoned according to well-established, well-regulated procedures.

Slide 16

Slide 16 text

HOMES TORN DOWN • The re-abandonment of the 1-36 wellbore required the acquisition and removal of five Evergreen Crescent properties to accommodate the safe operation of a drilling rig. A quote from the Imperial Oil website, w.r.t. the Calmar incident.

Slide 17

Slide 17 text

I MUST DO SOMETHING So, having encounter this story, I felt I must do something. But what?

Slide 18

Slide 18 text

DATA. GOT THAT In fact, I spent the better part of 7 years immersed in the Oil & Gas data used by most of the Canadian oil industry, and provided by 2 of the biggest data vendors in the business.

Slide 19

Slide 19 text

LOADS OF DATA There are over 750,000 oil and gas wells in Canada, and of those, over 244,000 are abandoned.

Slide 20

Slide 20 text

THATS A LOT OF WELLS to keep track of

Slide 21

Slide 21 text

FOR AN IOS APP THATS A LOT OF DATA

Slide 22

Slide 22 text

YOU SHOULD USE CORE DATA All of my research let me to the conclusion that I needed to use Core Data.

Slide 23

Slide 23 text

CORE DATA in RubyMotion And there-in lies the problem. Not just using Core Data, where there are books and tutorials galore, but using it in RubyMotion, not so much.

Slide 24

Slide 24 text

I BET THERE’S A GEM FOR THAT Isn’t there always?

Slide 25

Slide 25 text

–@topfunky @charliesome You must be new to Ruby. We write 16 different independent gems for everything here. ;-)

Slide 26

Slide 26 text

SO MANY GEMS • motion-sqlite • Nitreon • Magical Record • Superbox • Motiondata • MotionModel • CDQ Why yes, in fact, there are a lot of gems. And where there are many options there are so many opportunities to become lost in analysis paralysis.

Slide 27

Slide 27 text

SO MANY REQUIREMENTS SO LITTLE TIME

Slide 28

Slide 28 text

PRELOADING *LOTS* OF DATA

Slide 29

Slide 29 text

NON-TRIVIAL DATA MODEL

Slide 30

Slide 30 text

RELATIONSHIPS

Slide 31

Slide 31 text

FILTER by location

Slide 32

Slide 32 text

LIST

Slide 33

Slide 33 text

MAP

Slide 34

Slide 34 text

PART TIME But I was only doing this little project on the side. Part time. Evenings & weekends.

Slide 35

Slide 35 text

RESEARCH a.k.a. Yak Shaving And so it went. I researched, and I researched some more. And then so more. And so it went.

Slide 36

Slide 36 text

NOTHING WORKS Eventually, I came to a CONCLUSION. Nothing works. At least, not for the specific requirements that my application had.

Slide 37

Slide 37 text

–@scottdavis99 Young C is expending an extraordinary amount of energy finding shortcuts rather than just doing the work. Future #convict or #programmer? I saw this and thought… this is me. Instead of just buckling down, and doing the work of figuring out Core Data for myself, I wasted all that time trying to use other people’s code that was not suited to my core requirements.

Slide 38

Slide 38 text

DIDN'T KNOW ENOUGH about Core Data

Slide 39

Slide 39 text

DIDN'T UNDERSTAND THE GEMS And because I didn’t know enough about Core Data, I didn’t really understand how the gems worked

Slide 40

Slide 40 text

COULDN'T MODIFY THE GEMS And because I didn’t understand how they worked, I couldn’t really modify them easily, either.

Slide 41

Slide 41 text

THE IRONY I tried to use gems as a shortcut, only to end up wasting more time than just DOING THE WORK.

Slide 42

Slide 42 text

–@bketelsen spent 6 hours researching a way to do it the easy way, when I could have written it in 3, the hard way. Yup, I resembled this guy too. I wasted 3 weeks of part time efforts, digging into all those gems, so I wouldn’t have to learn Core Data for myself.

Slide 43

Slide 43 text

DO THE WORK back to the basics So, after all that, I needed to go back, and actually spend time figuring out Core Data in RubyMotion for myself.

Slide 44

Slide 44 text

LEARN THE SDK Because RubyMotion, for all it lets you code in Ruby, does not relieve you of the need to learn the Apple iOS SDK’s.

Slide 45

Slide 45 text

READ THE API And what does that mean? Learn the SDK. It meant going back, and actually reading the Apple documentation for Core Data.

Slide 46

Slide 46 text

READ THE EXAMPLES It meant downloading and reading the example code that comes with the API documentation.

Slide 47

Slide 47 text

FIND MORE EXAMPLES It meant finding some Objective C posts about using Core Data (on Ray Wenderlich’s fab site).

Slide 48

Slide 48 text

IMPLEMENT SAMPLE SOLUTIONS and using those examples, walking thru them, and translating them into RubyMotion.

Slide 49

Slide 49 text

HARD PROBLEMS ARE HARD Along the way I (re)discovered… hard problems are hard. Most of my requirements turned out to be fairly challenging problems, in and of themselves. Most gems are make tedious things simple. But they don’t really tackle the hard problems.

Slide 50

Slide 50 text

@SERIOUSPONY On expertise and just how deep the rabbit hole goes Most of the gems stop at the “Turns out it’s quite simple”. ! Most of my requirements drove me all the way into “OMG complex!” ! * https://twitter.com/seriouspony/status/419887010388537344/photo/1

Slide 51

Slide 51 text

Turns out, I was sort of glad that none of those gems worked for me. I learned SO MUCH.

Slide 52

Slide 52 text

I KNOW! I’LL WRITE A BOOK NOW! So much in fact, that I ended up with enough material to write a whole book on the subject of Core Data in Ruby Motion.

Slide 53

Slide 53 text

DOING THE WORK The moral of this long and involved tale that is somewhat embarrassing and somewhat uplifting is that when the problem you are attempting to solve is core to your application, sometimes what you need to do is just sit down, and do the work.

Slide 54

Slide 54 text

PERILS What are the perils involved in avoiding “Doing the work”?

Slide 55

Slide 55 text

EXPERT BEGINNER How Developers Stop Learning: Rise of the Expert Beginner This is where you learn just enough to think you are proficient, but really, you never get to be an expert at anything. Lots of developers fall into this trap. We need to dig a little deeper, avoid the easy solutions, and do the work. ! http://www.daedtech.com/how-developers-stop-learning-rise-of-the-expert-beginner

Slide 56

Slide 56 text

@SERIOUSPONY On expertise and just how deep the rabbit hole goes The expert beginner gets stuck in that trough, and never realizes there is more to learn ! * https://twitter.com/seriouspony/status/419887010388537344/photo/1

Slide 57

Slide 57 text

ADVANTAGES What are the advantages of doing the work?

Slide 58

Slide 58 text

LEARNING IS ITS OWN REWARD Ok, sure it’s a cliche, but that doesn’t make it less true. There is deep satisfaction in deep diving into learning, and becoming truly expert in something.

Slide 59

Slide 59 text

BELONG BY DOING This is a great quote. I wish I could track down where it came from. ! Do the work.

Slide 60

Slide 60 text

CORE DATA IN MOTION http://coredatainmotion.com And of course, maybe you too, will some day discover that you have learned enough about a difficult topic that you have enough material at your fingertips to write a book.

Slide 61

Slide 61 text

DO THE WORK! Thanks for listening! Finnegan says…