Developing Perspective

#64: Footnotes on Side Projects and iCloud Data Sync


00:00:00   Hello, and welcome to Developing Perspective. Developing Perspective is a podcast discussing

00:00:05   news of note in iOS development, Apple, and the like. I'm your host, David Smith. I'm

00:00:09   an independent iOS developer based in Herner, Virginia. This is show number 64, and today

00:00:13   is Friday, July 13th. Hopefully it's not a bad luck episode. As always, Developing Perspective

00:00:19   is never longer than 15 minutes, so let's get started.

00:00:22   All right, first, a footnote to yesterday's topic, where I was talking about the importance

00:00:26   of having side projects.

00:00:28   And well, I guess two interesting footnotes to that.

00:00:31   The first is I ship my side project.

00:00:33   It's called Quick Capture for Cheddar.

00:00:35   It's in review right now, and I'll, of course,

00:00:37   let you know when it ships.

00:00:39   And it's just, like I said, it's a tool for quickly capturing

00:00:42   tasks.

00:00:43   And it's a tool that I've done before for email-based things.

00:00:46   But now that I'm using Cheddar, it

00:00:47   was a great little thing that I wanted

00:00:49   to use for just kind of brain dumping

00:00:50   and doing them, I guess, in a GTD sense.

00:00:52   They'd call it a mental sweep or whatever.

00:00:54   But anyway, that's-- so I've shipped it.

00:00:56   which is always great. But as I was shipping it, it reminded me that I didn't mention one

00:01:00   thing that's a very important part for me of side projects. And this is a term or topic

00:01:07   that I learned when I used to do Scrum, which is one of the agile methods. And I'm not sure

00:01:12   if it's actually related to Scrum or if it was just a term we used in a company where

00:01:16   I learned to use Scrum, if that makes sense. But basically, what I learned there was the

00:01:23   concept of a time box. And a time box is essentially what you do if you have say you have a classic

00:01:30   problem, a pretty standard problem in software development, you say, I want to build X. Well,

00:01:36   how long do you think X will take to build? And whether that's in calendar time, man hours,

00:01:41   whatever, but it's like, how long does that take? And you know, it's a huge problem. Developers

00:01:47   are notoriously bad at estimating how long things take. It's almost impossible to really

00:01:53   put some handles on that and say, "Okay, well, this is going to take a day. This is going

00:01:58   to take a week. This is going to take a month. This will take a year." I mean, who knows?

00:02:02   And so one of the things we used to do for tasks that had many undefines, that were sort

00:02:10   of almost, I guess you could say, they're experimental or exploratory, is that rather

00:02:15   Rather than taking the usual process of saying,

00:02:18   OK, this is a task.

00:02:19   I'm going to estimate it at eight hours,

00:02:21   put it in the backlog, pick it up.

00:02:23   What we would do is we'd say, we're going to do two things.

00:02:27   We're going to do a spike on the task,

00:02:30   and we're going to time box it.

00:02:31   And I'm going to unpack those two terms.

00:02:33   So a spike, what we meant is-- you'll often

00:02:36   hear people use the word minimum viable product.

00:02:40   It's similar to that in some ways.

00:02:41   But the goal is to be narrow and deep

00:02:44   rather than wide and broad and shallow.

00:02:49   And by that, I mean it's really focusing in the concept

00:02:53   of what it is you're trying to accomplish

00:02:55   and making that so narrow that you can make tremendous process

00:02:59   in terms of speed.

00:03:00   And as an example, in this application I wrote,

00:03:03   in Quick Capture, I--

00:03:05   so you make all these-- you just throw away

00:03:07   all kinds of things that could distract her

00:03:09   and make it more difficult. So I say, OK,

00:03:11   I'm not going to do an iPad version now.

00:03:16   It'll just be iPhone only.

00:03:18   I'm going to punt on a couple of things

00:03:20   that could otherwise take more time or be more complicated.

00:03:25   So for example, rather than having a Settings app built

00:03:28   into my application, I'm going to use a Settings bundle.

00:03:31   Perfectly valid, in many ways even more consistent

00:03:33   with the HIG and all that.

00:03:36   But it means that I just put together a P list

00:03:39   but the few notes and entries.

00:03:42   And there we go.

00:03:43   I got my Settings app in a few minutes.

00:03:46   And it's kind of focusing down your efforts

00:03:48   into really the core functionality, the problem

00:03:51   you're trying to solve.

00:03:53   And by doing that, you really help yourself

00:03:55   really drive quickly towards the goal of actually shipping

00:03:59   something.

00:04:00   And then time boxing.

00:04:01   And this is probably more important.

00:04:03   And the reason I brought it up was this morning

00:04:06   when I was in the shower, and I was thinking about what

00:04:08   I said yesterday.

00:04:08   And I was like, you know, I didn't mention time boxing.

00:04:12   And time boxing is a great concept.

00:04:15   And basically what time boxing is, is rather than saying,

00:04:18   how long do I think this thing will take,

00:04:21   it's how much time am I willing to spend on this,

00:04:26   which is a different question.

00:04:27   It's more a question of the perceived value of your time,

00:04:33   the perceived value of the task, and what it accomplishes.

00:04:36   And so rather than having it be how long is this going to take,

00:04:40   I say, OK, I'm going to give myself a certain amount of time

00:04:43   to work on this.

00:04:44   And for the purposes of this task,

00:04:46   I was like, I'm going to give myself about 16 hours,

00:04:49   about two days of regular work.

00:04:53   And if I can't get something done in that amount of time,

00:04:56   I'll need to re-evaluate.

00:04:58   And the purpose of doing that is that it's not so much

00:05:01   that you are limiting yourself in what you do,

00:05:05   but you're limiting almost your room for catastrophe.

00:05:09   You're limiting your ability to get stuck in a rut

00:05:14   or stuck in a place where you end up spending

00:05:17   way too much time on something.

00:05:19   So you kind of end up avoiding going down

00:05:22   bunny-- what do you call it?

00:05:23   Like rabbit holes or bunny trails

00:05:25   or all kinds of things like that, where you say, OK,

00:05:29   I'm going to give myself 16 hours to work on this.

00:05:31   And that's it.

00:05:32   And after 16 hours, I need to either decide if I'm going to keep going, and if I am, I

00:05:36   need to give myself another time box.

00:05:38   I'll say, "Okay, I'm going to give myself another eight hours, another day, whatever."

00:05:42   Or I'll say, "You know, I thought it would be fun.

00:05:44   Turns out, 16 hours in, I've got like nothing done, and it's a mess."

00:05:50   Maybe this is not for me.

00:05:51   I'll just, you know, can the project or put a shell of it or, you know, see what I want

00:05:55   to do next.

00:05:56   And for me, I found that to be really productive in keeping me focused.

00:06:01   It's kind of like the Parkinson's law,

00:06:03   if you're not familiar with it, is essentially

00:06:06   the time it takes to complete a task

00:06:09   will always grow to fill the time allocated to that task.

00:06:13   Or put another way, if you give yourself 10 hours

00:06:16   to do something, it'll take 10 hours.

00:06:17   If you give yourself 20 hours to do something,

00:06:19   it'll take 20 hours.

00:06:20   And to a certain degree, that's just

00:06:23   the way the human nature works.

00:06:26   And so by pulling that down and rather than saying,

00:06:28   I'm going to start this project and I'll be done when I'm done,

00:06:31   you say, "I've got 16 hours. I've got two days. I better get working. I better make

00:06:35   a lot of progress on this very quickly. Otherwise, I'm going to be stuck. Or otherwise, I'm going

00:06:39   to have to abandon it." And that urgency is great. And in this case, it's like, I worked

00:06:44   on shipping an app. It took about 16 hours. I think I've maybe gone slightly over. I think

00:06:48   16 hours happened, maybe two hours before I shipped. But at that point, it was mostly

00:06:52   the time I had left was sort of the marketing stuff, taking the screenshots and trimming

00:06:57   them and writing the copy for the website and things.

00:06:59   So it wasn't like-- there weren't development tasks in that way.

00:07:03   And so at that point, I was like, well, I'll just give myself the next two hours, which

00:07:06   that's the point.

00:07:07   The goal is not that I'm cutting myself off then, but it's being mindful of that so that

00:07:12   it's not like in two weeks from now, I'm like, huh, maybe this wasn't the best use of my

00:07:17   time.

00:07:18   Maybe I've kind of gotten sucked into something.

00:07:20   And you can apply time boxing to a lot of concepts where it can be to small tasks, it

00:07:25   It can be to projects, it can be to an update.

00:07:28   It can even be on really small things.

00:07:29   Sometimes I do it-- and this is kind of borrowed

00:07:32   from the Pomodoro technique, which if you're not

00:07:34   familiar with it, just search Pomodoro technique, which

00:07:37   is very much you kind of focus your time in,

00:07:39   I'm going to work for 25 minutes and then take a break, 25

00:07:41   minutes and take a break.

00:07:43   And what often I find works really well for me

00:07:45   is sometimes I'll be like, I think this feature is worth it.

00:07:48   I think this feature is fun.

00:07:50   I think people would like it.

00:07:51   Maybe I'll give myself a couple of hours and just try it

00:07:54   and focus on just getting the barely working

00:07:58   and then see if it is actually fun to see if it is actually useful like

00:08:01   matchy per my phone and play with it

00:08:03   and this is a reason i often really don't get into a lot of like photoshop

00:08:06   pixel perfect mock-ups and all those kinds of things that a lot of

00:08:10   some people like

00:08:11   for me it's like

00:08:11   i'd just want to feel it and touch it and often to say okay

00:08:15   you know i think this new feature would really work i think people would really

00:08:18   like this maybe i'll just throw together

00:08:20   and time box and say hey i'm gonna spend an hour on this and in an hour i look at

00:08:24   at it and I'm like, "Wouldn't you? Now I can make a better decision." Because the goal

00:08:28   is that at the end of it, I have more information to make a better decision about how I spend

00:08:32   my time. So anyway, those are just a few footnotes on side projects. If you didn't listen to

00:08:37   yesterday's show, "63 Side Projects of Internationalization," definitely give it a listen. I'll have a

00:08:43   link in the show notes to it or just developingperspective.com or search "Developing Perspective 63." And, okay,

00:08:50   So the second topic I was going to talk to today is iCloud and iCloud syncing.

00:08:57   And specifically talking a little bit about a process that I'm about to begin for my recipe book of taking the app and making it sync across servers.

00:09:07   And it's a core data-based application, sort of my first gut.

00:09:12   And when I first started this, my initial thought was, "Oh, I'll just do this with iCloud. That's what iCloud's for.

00:09:18   this great thing and I was at WWDC and he was like, add three lines of code to your

00:09:23   persistent SOAR coordinator and you're done.

00:09:26   I'm like, sweet, that's great.

00:09:28   You plug it in, you kind of, even you obviously realize actually it's not

00:09:32   three lines of code, you have to do a bunch of other stuff, but you get it all working

00:09:35   and it's kind of a mess and it sort of works and sometimes it doesn't and then you read

00:09:40   blog posts and you go to talks by people who are smarter than you, spend a lot more

00:09:44   more time on it and all the trouble they're having with core data and iCloud. iCloud seems

00:09:51   like if you can do all your syncing in the key value store, you're golden. The key value

00:09:57   store is, works perfectly and flawlessly. And I've done that in my applications. I've

00:10:01   done some stuff, you know, preferences syncing, a little bit of data syncing, but not really

00:10:05   like data, just sort of user information. All that stuff works amazingly on core data.

00:10:09   It's ridiculously fast. It never seems to get out of sync, doesn't really seem to have

00:10:14   any problems. And I think a large part of that is that it has a server reference model

00:10:21   rather than a sort of this weird transaction log approach that they use for core data where

00:10:29   they're like replaying logs from side to side, from side to side. Anyway, but that's not

00:10:34   really the point. The point is that at this point I'm kind of weary to go down the path

00:10:39   using iCloud for my core data sync for my users.

00:10:45   And this is where I think the more interesting part--

00:10:47   Apple, I'm a freeloader in that model on Apple.

00:10:53   Apple is the one who's building this infrastructure

00:10:55   and building this platform and this way for users

00:10:58   to sync information back and forth.

00:11:00   And that's great.

00:11:01   And I'm glad they provided, and that's cool.

00:11:05   But the problem is Apple's not my customer in that.

00:11:08   my end user is Apple's customer, and I'm doing this thing via Apple that my customer is going

00:11:15   to rely on, but if something goes wrong, they're going to blame me, not Apple, but I can't

00:11:20   fix it, only Apple can. And so that's a bit of an awkward situation. And it's got me thinking

00:11:26   about two other products. There's one called Parse, and there's one called Simperium. Again,

00:11:31   I'll have links in the show notes. And their business, their businesses who exist for the

00:11:37   sole purpose of taking iOS applications and helping you sync data between them. Parse

00:11:43   does a bit more than that. That's pretty much all Simperium does. And they charge you for

00:11:46   it. They'll charge me a couple hundred dollars a month or whatever it is. And I like that.

00:11:51   I like that I'm not a freeloader there. I'm a customer. If something's wrong, I call up

00:11:56   Simperium and say, "Hey, I do this, this, and this, and I don't get the right data out."

00:12:02   or this merge fails in a weird way, why is that?

00:12:05   And it's their job, and their existence and their success

00:12:09   is based on them giving me a really good answer to that,

00:12:12   for why does it do that?

00:12:13   Oh, huh, that's a bug.

00:12:15   Or, hm, you're doing it wrong.

00:12:16   Let me see your code.

00:12:18   In a way that Apple just isn't.

00:12:20   I'm not Apple's customer.

00:12:22   I'm a freeloader there, in a true sense.

00:12:24   I don't mean that in a derogatory sense of, oh,

00:12:26   I'm freeloading.

00:12:27   But that's just the reality of it.

00:12:29   I'm not Apple's customer.

00:12:32   I'm just kind of taking advantage of something they do.

00:12:35   And so for something like Data Sync, for something--

00:12:39   there are so many different problems that can go wrong.

00:12:41   I mean, there are hundreds of things

00:12:42   that can go wrong with Sync.

00:12:45   That makes me feel really nervous.

00:12:47   And I feel like I'm going to use Core Data,

00:12:48   and I'm going to use iCloud in my syncing solution.

00:12:53   But it'll be like I'll use iCloud

00:12:54   to sync super simple things.

00:12:57   Like I have a collection of images

00:12:59   that you-- sort of each recipe, for example,

00:13:01   can have some pictures associated with it.

00:13:04   Perfect thing for iCloud sync.

00:13:06   They're all uniquely identified by the MD5 of the file name

00:13:11   of the file.

00:13:12   Perfect.

00:13:13   Just throw those in, make them share documents,

00:13:15   and as best I understand, iCloud should sync them.

00:13:17   If somehow they don't sync, if a file ends up missing,

00:13:20   OK, not great for the user, but not the end of the world.

00:13:24   It's not like corrupting data in the same way.

00:13:26   But anyway, those are just some thoughts

00:13:28   had that I was kind of like, huh.

00:13:31   I had this anxiety about using iCloud for syncing.

00:13:35   And I think it was a sort of-- it crystallized in my head

00:13:37   that's like, I'm not Apple's customer for this.

00:13:40   I'm using this very complicated, sophisticated networking system

00:13:45   that has really no accountability.

00:13:49   That there's no one at Apple who I can call and be like, hey buddy,

00:13:53   I'm paying you a bunch of money.

00:13:54   You better make this work.

00:13:55   And if you don't, I'm going to take my business elsewhere.

00:13:58   There's nobody I can do that with.

00:14:00   And so that's just kind of-- it kind of makes me nervous

00:14:03   and kind of makes me worried.

00:14:04   And so that's where I'm going to be going.

00:14:05   I think I'm going to start with Simperium and try it.

00:14:07   If that doesn't work, I'll go to Parse probably.

00:14:10   But it's kind of great.

00:14:12   And there's all these other options and things

00:14:14   that it could potentially open up by doing this.

00:14:17   A lot of these things have web APIs that if I wanted to,

00:14:21   I could also write a web application that

00:14:22   ties into the same data, or all kinds of other things

00:14:25   that are just not possible within Apple's closed model.

00:14:28   So anyway, a few thoughts.

00:14:29   I hope you have a good weekend.

00:14:32   That's it for today's show.

00:14:34   As always, if you have questions, comments, concerns, by all means hit me up on Twitter.

00:14:40   I'm @_davidsmith on Twitter.

00:14:43   And the Twitter feed for this show is @devperspective.

00:14:47   And otherwise, I hope you have a good weekend.

00:14:49   I'll see you next week, and happy coding.

00:14:51   Bye.

00:14:52   [BLANK_AUDIO]