0:00:00Welcome to Under the Radar, a show about independent iOS app development.
0:00:04I'm Marco Arment.
0:00:05And I'm David Smith.
0:00:07Under the Radar is never longer than 30 minutes, so let's get started.
0:00:11So a couple of weeks ago, we did an episode where Marco talked through the complexity
0:00:18and underpinnings of the new search system that he built into Overcast.
0:00:21And it was kind of surprising to me that the feedback I got from a lot of people about
0:00:26that show was that they really liked it.
0:00:28And what was especially interesting was that a lot of that feedback was from people who
0:00:32are not particularly technical, aren't people who are necessarily going to ever implement
0:00:36a search system.
0:00:37Because I know there's a lot of people who listen to the show more for the businessy
0:00:40or marketing types of topics rather than the technical topics, but there are a lot of people
0:00:46who really enjoy that.
0:00:47And I think there is something to just hearing someone break down a really complicated problem
0:00:53that is a good exercise and a helpful thing for us to do to just encourage our own brains
0:01:01to be good at thinking and to think of, you know, sort of, you may not encounter that
0:01:05exact problem, but it may be useful.
0:01:07And so in that same vein, I'm going to, this week, largely unpack something that I've been
0:01:12struggling with that falls into the same kind of category of something that is superficially
0:01:17pretty easy but is actually fiendishly complicated.
0:01:20And that is this week, I've been forced to essentially rebuild the step engine in Pedometer++.
0:01:27It turns out that there is an issue and a bug in iOS 12.
0:01:30I don't know if it's a bug.
0:01:32There's a change in iOS 12, that's the charitable way to say it, in the way that CoreMotion
0:01:37reports steps that are from a few days ago, and it causes it to sort of significantly
0:01:42undercount versus the health app, and it's causing lots of consternation and problems
0:01:47that I'll get into.
0:01:49But this change is one of these things that for a while I've kind of had ways that I'm
0:01:51working around and they kind of have been patched around, weird quirks in CoreMotion,
0:01:56but I just can't do that anymore.
0:01:57So I have to rebuild it, and I'm moving it to a system that is based largely on health.
0:02:03But the process of doing this is something that seems relatively, that should be relatively
0:02:08straightforward, but it's actually not at all.
0:02:12And it's, you know, this week has been just, I've been joking with my wife that I feel
0:02:16like I'm spending half my time just sitting at my desk thinking.
0:02:21If you've ever read the stories of Winnie the Pooh, where he goes to his thoughtful
0:02:25spot and he sits and he taps his forehead and says "think, think, think," that has been
0:02:29me all week, because there's so many of these nuances and challenges that take something
0:02:34that superficially should be relatively straightforward and turns out to actually be not.
0:02:40You have to make tremendous amounts of complicated decisions and there's compromises, and you
0:02:45end up in situations where you can't do two things, it becomes impossible, and I don't
0:02:50like using the word "impossible" generally, but as best I can tell, there is no way to
0:02:56reconcile certain goals or desires that you have, and I think that makes solving problems
0:03:01like this the interesting part of what we do.
0:03:04The displaying of the data or those types of things, the UI parts, it's fun and it's
0:03:09interesting, but this is where the real rubber meets the road and things get hard.
0:03:14I honestly kind of enjoy this kind of problem.
0:03:17Whenever I'm in it, I find that's kind of like the good work of a programmer.
0:03:23That's kind of like the work that we wait for, because so often what we have to work
0:03:25on is boring or tedious or "oh, the login screen needs to accept this new condition,"
0:03:31like that's really boring.
0:03:33But when you have a hard problem to solve, it activates a part of my brain that is curious
0:03:39and loves challenges and loves to be flexed in that way.
0:03:43If you're lucky as a programmer, you get that maybe 10% of the time, and usually not even
0:03:47that much.
0:03:48>> Yeah, so anyway, without further ado, let's get started on the actual problem I'm facing.
0:03:54So first, it's probably good to start with, like at its core, what I try and do in Pedometer++
0:03:59is I'm answering the question, "How many steps did you take today?"
0:04:04Like at its core, that is what the app is trying to do.
0:04:07So of course, then you have to ask the question, "Well, what is a step?"
0:04:11And I suppose intuitively, I think everyone has an understanding of what a step is.
0:04:15It's the thing you've been doing since you were one year old, where you take one of your
0:04:20legs and move it forward to the other one, you take another step, you move the other
0:04:24leg forward.
0:04:25Conceptually, I think that's something that people understand.
0:04:29And what's complicated, though, is that turning that physical action into something that you
0:04:36measure and can track and count is very difficult.
0:04:41And thankfully, I'm not someone who's actually doing the work to build the physical monitoring
0:04:47to do this, like the geniuses at Apple who make the motion coprocessor, or the people
0:04:51at Fitbit, or the people who actually are doing the work, you know, looking at raw accelerometer
0:04:56data and turning that into steps.
0:04:59Because the reality is, based on where you are wearing your monitor, what terrain you
0:05:03are working on, how fast you are going, what you're carrying in your hands, all of those
0:05:08things dramatically impact what will be considered a step for the purposes of something that
0:05:15is being counted.
0:05:17And so there is no truth, then, about how many steps you took.
0:05:24And this is something that I think I have many customers who really get wrapped around
0:05:29the axle with, is that they want to have the sense that they took a certain number of steps,
0:05:36the physical thing that they did out in the world, and they wanted that to translate into
0:05:41a consistent measured value on their device.
0:05:45That is impossible.
0:05:47Like the classic example I have is people who go to a track and go for a walk.
0:05:52They walk around a track, perfectly level, flat, like nothing complicated environment.
0:05:58They walk around the track, you know, say they walk ten times around the track, and
0:06:02one day it gives them a certain number of steps, and the next day it will give them
0:06:04a different number of steps.
0:06:06And it's just the nature of the problem of the exact nuances of how they walked, or even
0:06:11more complicated is when they walk with somebody, say their spouse, and they're like, "I got
0:06:14more steps than they did," and then they have to account for where are they holding their
0:06:18phone in their pocket, what differences in heights, in gates, all manner of things.
0:06:23And sometimes they're even wearing multiple devices, which makes it even doubly complicated.
0:06:28So the one that I care about the most is people who have an iPhone and an Apple Watch.
0:06:33They're both generating step numbers, but in either case, are those ever going to be
0:06:38the same?
0:06:40The truth that I have found in general is working with steps is that all we have is
0:06:46just the numbers that the monitors spit out, and then we just have to work with those as
0:06:50best we can.
0:06:51So you're starting with something that's already kind of squishy, which isn't great.
0:06:57And then the second part is understanding what do I mean by today, or having a sense
0:07:02of timing and timeliness for those steps.
0:07:06And we all know that the four hardest problems in computer science are naming, caching, syncing,
0:07:09time zones, and off-by-one errors.
0:07:12Those are the problems that really get hard.
0:07:14And unfortunately, the step counting thing includes three of those, caching, syncing,
0:07:19and time zones, because I have to deal with those.
0:07:24But the one that's most complicated for the concept of today is, of course, time zones,
0:07:29because you take your steps in time.
0:07:33Say I measured all times GMT, and you then need to somehow tie that back to the concept
0:07:40of a day.
0:07:42And maybe that's reflecting the current time zone that the user is in when you're looking
0:07:47at the steps, but then what should happen to steps you took in the past?
0:07:52Or maybe you should have it be tied to the time that the app first saw that step, the
0:07:58first time it measured it, and then you could tie it to a logical day.
0:08:03And if you're curious, this is sort of what the activity app does.
0:08:06The activity app, so if you have an Apple Watch, you get the activity app, and it has
0:08:09its rings that measure your stand, exercise, and move.
0:08:14And they show that based on the time zone your Apple Watch was set to when that action
0:08:20took place, which can lead to really weird things like your stand hours, where if you
0:08:27go on a transpacific flight from Australia to California, depending on which direction
0:08:34you're going, your day could either not exist at all or potentially could last for 36 hours,
0:08:43or really strange and complicated things.
0:08:44But that's the way that they do it.
0:08:45But it's kind of a cheat, because Apple's always running, so they always know the time
0:08:50zone you're in when the steps are taken.
0:08:52Whereas third-party apps don't have that benefit.
0:08:55All we get is to be able to get run whenever the user opens us, for the most part.
0:09:03Monjolo Background App Refresh, which helps but still isn't reliable.
0:09:06So generally speaking, what I do is I show steps based on the current time zone.
0:09:12And this is the same thing that the Health app does, coincidentally.
0:09:16It's always updated to do essentially 24-hour periods that extend back in time based on
0:09:24midnight in your current time zone.
0:09:27That's basically what they do.
0:09:28Which is great.
0:09:29And that works reasonably well, but gets complicated by how you should then store your data.
0:09:37Because if you're going to be able to dynamically change time zones, you need to be able to
0:09:42store time zones in a way that you can re-chunk it based on changes in time zone.
0:09:48So a naive solution would probably be to just store it, maybe steps per hour.
0:09:53Which is actually the first version of the way that I did this, which turned out to be
0:09:56problematic.
0:09:58And this is quoting from Wikipedia.
0:09:59"New Finland, India, Iran, Afghanistan, Burma, Sri Lanka, and the Marques, as well as parts
0:10:05of Australia, use half-hour deviations from standard time for their time zones.
0:10:10And certain nations, such as Nepal and the Cheltenham Islands of New Zealand, instead
0:10:14use quarter-hour deviations."
0:10:16Oh my god.
0:10:18So time zones, right?
0:10:19They're great.
0:10:20So if you store in hour-long chunks, then you have this issue if you go to Newfoundland
0:10:27or Sri Lanka or parts of Australia or the Cheltenham Islands, and suddenly you can't
0:10:33accurately adjust it.
0:10:35What I ended up doing is quarter-hour chunks.
0:10:39So for every day, I store, I think it's 96 chunks, if my math's right, there.
0:10:44But I essentially, for every 15-minute period in GMT, I store the number of steps you take.
0:10:52And that mostly works for the concept of what today is.
0:10:58Obviously, that gets really complicated and it's awkward, and I have to store way more
0:11:03data than is really practical in some ways, but that's what I have to do.
0:11:10And just keep this in the back of your mind when I start to get to things like syncing
0:11:15and caching and those types of issues where it isn't just that I have one data point
0:11:20that I need to deal with, I have every 15-minute data points spanning back potentially for
0:11:27years for users.
0:11:30And then one last thing that gets really fun with time zones, and in general the concept
0:11:35of what a day is, is when you introduce things like goals and streaks into the application,
0:11:42which is like a core feature, like number one feature of Phenomena++, is that you can
0:11:46set a goal, for most people say it's 10,000 steps, and when you hit the goal, like the
0:11:52app Cheer, Confetti comes down, it's very exciting, and a poor part of the app is that
0:11:56you are trying to hit your goal every day.
0:12:00And if you may have noticed, day, as I just explained, is this impossible concept that
0:12:06doesn't mean anything.
0:12:08And so what should happen if you hit your goal, you have a great streak going, you have
0:12:11a 90-day streak, you're really proud of it, and then you fly to Europe, and suddenly all
0:12:17of your concept of days have shifted, and especially if you tend to do your walking
0:12:23at the beginning or end of a day, suddenly you may or may not actually have that streak.
0:12:28And you have to answer the question, "Well, what do you do?
0:12:30Should I store somehow the concept of goal achievements by logical days, for like September
0:12:387th, 2018 is a day, and did you hit your goal on that?"
0:12:43Well, if I do that, then I have the problem that I talked about before, where then I need
0:12:46to know, "Well, how many steps did you take?"
0:12:48Or is it just that you did hit your goal, but then how would I show that in the app?
0:12:52And if I don't adjust it to the current time zone, then you have weird issues where what
0:12:56happens if you do the transpacific flight where they miss a day, should that break their
0:13:00streak?
0:13:01Like if a day didn't actually exist, or they didn't take any steps?
0:13:06So in that case, right now what I just do is I just show everything in the current time
0:13:10zone, and unfortunately sometimes that means you miss your goal, because that is the least
0:13:15worst, most understandable option that I've been able to find.
0:13:20See I think what I would do is actually store per logical day whether you hit your goal,
0:13:29because your goal can change also.
0:13:31Like if I raise my goal, and I didn't reach the raised level last week, then I lose my
0:13:38streak.
0:13:39You know?
0:13:40So I think what I would do is I would literally store for every known day of past data, I
0:13:45would store whether that day's goal was reached, maybe for the sake of it, what that day's
0:13:48goal was, and then I would also store the number of logical steps I've assigned to
0:13:54that day, and that way it never changes.
0:13:56And so suppose you get launched for the first time, and you haven't been launched for
0:14:00seven days, but you have data before that.
0:14:03You can then calculate those past seven days in local time, save them, and then basically
0:14:08once a day is quote "done," you never revisit it.
0:14:11Does that make sense?
0:14:13Sure.
0:14:14It's a reasonable approach.
0:14:16And this is the thing that is so fiendish about this, is the approach you're describing,
0:14:21where the works, but except for on the boundaries between long periods where you don't open
0:14:27the app, and can also get complicated during those seven days in your example.
0:14:34That user may have traveled dramatically, potentially, right?
0:14:40And so then suddenly the concept of which day those steps were part of may not actually
0:14:46be meaningful or make sense or be reasonable to them.
0:14:50That they'll look at it and say, "Well, if you take a look at the steps in the current
0:14:53time zone, it sort of makes sense, but it can be very inconsistent."
0:14:59And one thing that I've learned is that people get really annoyed when the data doesn't
0:15:03make sense to them.
0:15:05That if I'm bucketing days into logical days, like the activity app approach, if I could
0:15:15do that on a regular basis, I think it would work great.
0:15:18Or, and this is something that I found, probably one of my longest-running health kit radars,
0:15:22is if Apple stored the user's time zone when they took the steps that are recorded in health,
0:15:28that would solve a lot of this problem.
0:15:30But in the absence of that, what I find is that it ends up with these weird complications
0:15:34where they look at the data and they're like, "Why is this day double-counted depending
0:15:40on how you change time zones?"
0:15:43Or "Why is this day missing?" for example.
0:15:45That could also be problematic.
0:15:46So it's like, your instinct is not wrong.
0:15:49That's the thing.
0:15:50Both of these answers are correct.
0:15:51It's like they're both just different and lead to different sets of compromises or problems
0:15:55that we just have to deal with as a result.
0:16:00We are sponsored this week by Linode.
0:16:02With Linode, you'll have access to a suite of powerful hosting options with prices starting
0:16:06at just $5 a month.
0:16:07You can be up and running with your own virtual server in the Linode cloud in under a minute.
0:16:11Whether you're just getting started with your first server or you're deploying a more complex
0:16:15system like what David and I run, Linode is the right choice for you.
0:16:19They offer the fastest hardware, the fastest network, and the best customer support behind
0:16:24it all.
0:16:25It has never been easier to launch and maintain a Linode cloud server.
0:16:29Linode also guarantees 99.9% uptime for server availability.
0:16:33Once your server is up, they keep it that way.
0:16:35And Linode now offers additional storage too.
0:16:37Block storage is now out of beta and available almost everywhere.
0:16:41So check it out today.
0:16:42Linode is great for things like hosting large databases, running mail servers, operating
0:16:46a VPN, Docker containers, private Git servers, entire applications like what I do, and so
0:16:51much more.
0:16:52And they are hiring right now.
0:16:54If this interests you, go to Linode.com/careers.
0:16:56Anyway, Linode has fantastic pricing options for their hosting.
0:17:01Plans start at one gig of RAM for just $5 a month.
0:17:04And there's lots of plans above that for all your various needs.
0:17:06They also include things like high memory plans.
0:17:09They start at 16 gigs of RAM and go up from there.
0:17:11Listeners of this show can sign up at Linode.com/radar.
0:17:15This will support us and get you $20 towards any Linode plan.
0:17:19So on the one gig plan, that could be four months for free.
0:17:21And with a seven day money back guarantee, there's nothing to lose.
0:17:25So go to Linode.com/radar to learn more, sign up, and take advantage of that $20 credit
0:17:30or use promo code radar2018 at checkout.
0:17:33Thank you so much to Linode for supporting this show and Relay FM.
0:17:37So let's just say we move past the concepts of time and space and instead focus on the
0:17:44practical issues of actually getting these mythical steps that we're talking about.
0:17:50So there's two ways to do that in iOS and WatchOS.
0:17:55The first is Core Motion, which is the more raw direct motion API, and that provides concepts
0:18:01of steps, distance, and floors if you have a device that has a barometer on it.
0:18:06It also includes things like cadence and pace, but for my purposes, I don't really worry
0:18:10about those.
0:18:12And Core Motion is -- Core stores that data for the last seven days.
0:18:16Though as I mentioned at the top of the show, as the data gets older, Core Motion's data
0:18:22seems to somehow change and become unchangeable and trustworthy and becomes much more of a
0:18:27scoundrel in terms of what it does and how it behaves.
0:18:31And so it becomes unreliable the farther back in time you go, even as you -- it only stores
0:18:36seven days, but if you ask for the steps from like six days ago, the number you get back
0:18:41will be variant and changeable and day-to-day will give you different values, sometimes
0:18:45go up, sometimes go down, even though nothing's happened, but this is what it does.
0:18:49And as best I can tell, that is a feature, not a bug, based on conversations I've had.
0:18:56But it also -- the thing that Core Motion has going for it is that it is essentially
0:19:00real time, and you can even like observe -- you can set up like a long-running query that
0:19:04says anytime the user takes a step, tell me.
0:19:07And so if the user starts walking, and -- or this actually I hear from users a lot, is
0:19:14the -- say you're trying to reach to your 10,000 steps, and you've taken 9,900 steps
0:19:20right before bed, and you've realized this, and you're like, "Okay, I'm going to walk
0:19:22100 steps."
0:19:24You want to sort of get confirmation that you've hit your goal before you go to sleep.
0:19:30You don't want to wait around for that.
0:19:31So you want to have it update roughly in real time.
0:19:33And the only way to do that on iOS is with Core Motion, because the other version -- or
0:19:39the other way you can get steps is from the health APIs and HealthKit, which is in many
0:19:45ways you could say the like authoritative source on the device.
0:19:48It is the grand repository where all health-related data goes to, you know, goes to be stored
0:19:54forever.
0:19:55It's lovely because it goes back forever, essentially, like from as long as the user
0:19:59has maintained a iCloud backup and restore chain, or even now it syncs in iCloud, and
0:20:06it goes back to whenever the data was collected.
0:20:09But it is very slow to update.
0:20:12On iOS 12, the steps typically don't show up there for at least 10 minutes, sometimes
0:20:1720 minutes.
0:20:20But the only exception being if you are in an active workout on the watch, then steps,
0:20:26samples are written to the HealthKit database roughly in real time, which sort of makes
0:20:31sense, that in that mode it is kind of in more of a streaming system rather than an
0:20:35aggregation system.
0:20:38But that's kind of awkward because it can take up to 20 minutes.
0:20:41Like it seems like it bundles step updates into 10-minute chunks, and then it writes
0:20:46them 10 minutes after they were done.
0:20:48So from the beginning of one of those chunks to when it gets actually written can be 10
0:20:52-- can be 20 minutes.
0:20:53So, CoreMotion, does that require permission to access?
0:21:11Both CoreMotion and Health have permission and a certain sort of privacy request, things
0:21:18in their place.
0:21:19But I mean, who knows?
0:21:20There are certainly issues.
0:21:21I get the impression with a lot of this stuff that what you're saying, like there's things
0:21:24beyond the use that I'm using them for that comes into play that is just -- you deal with.
0:21:31But I mean, Health also -- another positive thing with Health, you can do observer queries
0:21:35that run -- or like another scheme to get background time to get woken up that are actually
0:21:41really clever because you can say, "Wake me up," whenever the user has taken a significant
0:21:45number of steps, and it'll do that.
0:21:47So whenever time your device is unlocked, which is actually another side point, Health
0:21:51is only available when the device is unlocked.
0:21:53CoreMotion is available at all times, so something you have to keep in mind, especially if the
0:21:59-- or build something like a Today widget, which is visible when the device is unlocked
0:22:03-- or is locked, but would not be able to access Health in that state.
0:22:09So just all these kind of fun things you have to deal with.
0:22:14And also another fun thing is that Health can take data from many sources.
0:22:19So it could take data from your phone -- multiple phones, if you do iCloud syncing, including
0:22:25phones that aren't yours, potentially.
0:22:27So if you and your spouse share an iCloud account, and you turn on Health syncing, suddenly
0:22:31Health contains steps from both of your devices combined.
0:22:35It can also include devices such as Fitbits or other devices.
0:22:39Users can manually enter Health steps into the HealthKit database.
0:22:44It is great in that it pulls all this data together, but is problematic in that you don't
0:22:50necessarily know how to get the data out of it.
0:22:52So ultimately what I'm having to do is move towards Health because of the issues in CoreMotion.
0:22:57It has the benefits of the data's always available, and the data just, you know, spends back in
0:23:03time.
0:23:04So previously there was an issue where if you didn't open Podometer++ for more than
0:23:06a week, sometimes it would lose -- you'd have a gap in data because it would have kind of
0:23:11fallen off the back of CoreMotion's queue.
0:23:14With Health, that's never the case.
0:23:15You can go back essentially until, you know, since the iPhone 5s was launched, which is
0:23:20as far back as my Health's database goes with steps, I think, or until HealthKit was launched,
0:23:24whichever came last.
0:23:26It goes all the way back to there, and so I can do these great big imports, and it's
0:23:30awesome.
0:23:31But it has all these crazy issues with syncing, and more complicated, and what I'll get into
0:23:37now, which is the real fun starts, is merging.
0:23:41Merging and syncing.
0:23:42I was worried, like, once you were saying, like, "Oh, it could take things from multiple
0:23:44devices."
0:23:45The first thing I thought of was, like, "Well, what if you're wearing a Fitbit at the same
0:23:48time that you have your phone in your pocket, and they're both counting steps?"
0:23:53Yes.
0:23:54Or even just you have a watch and a phone.
0:23:57Oh, man.
0:23:58Like, it's a great situation that now, you know, a substantial proportion of my users
0:24:03have, and they're both generating steps, and they're both generating step counts.
0:24:07So, what is the correct value to show?
0:24:12Right, because a lot of steps will be counted more than once.
0:24:15Yes.
0:24:16Well, I mean, sort of strictly, you would expect that if you put your phone in your
0:24:19pocket and your watch is on your wrist and you're walking normally, they both should
0:24:23be ideally counting roughly the same number of steps, which in some ways would be a great
0:24:28and easy problem to deal with.
0:24:30But say, for example, you're pushing a stroller with your hands.
0:24:34Now, suddenly, your wrist is not really moving in a traditional way, swinging side to side.
0:24:41So now, you are getting fewer steps with your watch, but your phone is still getting lots
0:24:46of steps.
0:24:47Oh, man.
0:24:48Or alternatively, you could have a situation where your phone is, say, in your backpack
0:24:52or in your purse, but your wrist is free.
0:24:55So now, your watch is giving you lots of steps, but your phone is not.
0:24:59It's still giving you some, not zero.
0:25:01Giving you zero would make the whole problem super easy.
0:25:04But giving you any number of steps is where it gets hard.
0:25:08And the way that Health deals with this, so the Health database will show you a sort of
0:25:15canonical number of steps.
0:25:17And the way it does it is it has this vague sense of priority.
0:25:21So most people don't know this, but in Health, you can go and set which devices you want
0:25:27to be in what order.
0:25:29And what it does is it looks, I think, in roughly 15-minute chunks.
0:25:35It goes through and says, "Which device, in order on my priority list, has any steps,
0:25:41any non-zero number?"
0:25:42If it has a non-zero number, the first one it finds, that becomes the step count for
0:25:46that 15-minute period, and it ignores the rest of them.
0:25:49So if you have one step on your Apple Watch, and by default, Apple Watch takes priority
0:25:54over iPhone, which makes sense.
0:25:56But if your Apple Watch gives you one step, in the example of pushing a stroller, and
0:26:02your phone gives you 500 steps, it'll give you one.
0:26:08That doesn't seem like sophisticated enough logic.
0:26:12Maybe not, but that seems to be what it does.
0:26:15So what I did initially, with all this, and for the purpose of time, what I'll just say
0:26:19is I do a Smart Merge, typically, where I look for, in each 15-minute chunk, which device,
0:26:25only looking at Apple devices.
0:26:26If you're running Fitbit or something else, I just ignore it.
0:26:29For me, that would just hurt my head to deal with the way that other people state it.
0:26:32At least I'll just look at Apple Watches and iPhones.
0:26:35Whichever device gives you the most steps is the one that I looked at, which conceptually
0:26:40means that I'm potentially over-counting, potentially, but at least I'm giving a more
0:26:44representative case, and it means that I dynamically switch between devices based on which one
0:26:49seems to be reflecting the most steps, which typically, "most" means best representative,
0:26:54because apart from the issues with accuracy of measuring, if your watch says you took
0:27:00500 steps and your phone says you took 400 steps, you probably took 500 steps.
0:27:04It's unlikely that it's over-counting in terms of what it's measuring.
0:27:08That's exactly what I would do.
0:27:10My solution to this problem would be exactly that, which is basically take whichever device
0:27:14reported the most.
0:27:15I feel like over-reporting is probably less common than under-reporting in all these different
0:27:19situations.
0:27:20Exactly.
0:27:21And it's more honestly, for people, they want the number to be bigger.
0:27:24It's not going to be sad.
0:27:27Then they go to health, and the health number is going to be different.
0:27:32And that'll drive people crazy, too.
0:27:34And especially, there's all kinds of schemes.
0:27:36I've had people who have health insurance things, where their health insurance is based
0:27:41on a discount if they reach their step goal, say, and that number is the number that's
0:27:46coming out of health, not the number that's coming out of pedometer++.
0:27:50So they thought they were hitting their goal every day, but the health system is less than
0:27:54that, and is under-counting, and then they're mad at me.
0:28:00But the problem with the health system is it can go down, because if you don't sync
0:28:05– say your Apple Watch is your priority device – it doesn't sync right away.
0:28:10So it can think, then its number can start at 10,000 and then drop to 9,000.
0:28:15If your Apple Watch comes in, it's the priority device.
0:28:18It has fewer steps, and then the number can go down, and that drives people crazy, too.
0:28:22You have to revoke their confetti.
0:28:24Yeah, I have to revoke their confetti, or they get mad at me, and I'm running out
0:28:27of time.
0:28:28So understand that this is the nature of these kinds of problems.
0:28:35There is no right answer, as you've seen.
0:28:37And nothing is as simple as it seems.
0:28:39No, nothing is as simple as it seems.
0:28:41And it's actually, a brief aside, one of my early mentors in programming, I remember
0:28:46specifically saying, "Never, ever use the words 'easy' or 'trivial' to describe
0:28:51something in programming.
0:28:52If you do, it is a clear sign that you have a fundamental misunderstanding of what programming
0:28:58is.
0:28:59Nothing is easy, nothing is trivial.
0:29:02The strongest you could say is that something is relatively straightforward.
0:29:07And if you don't have that perspective, you're either making assumptions that you
0:29:12don't know about, or you're making assumptions that you do know about and are going to come
0:29:16back to bite you.
0:29:17And so don't call anything easy.
0:29:19Step counting is hard, and there is no right answer.
0:29:22So you just kind of do your best, sit in your thoughtful spot, and hope for the best.
0:29:27That's fantastic.
0:29:28Well, thanks for listening, everybody, and we'll talk to you next week.
0:29:32Bye.
0:29:33Bye.
0:29:33[BLANK_AUDIO]