Developing Perspective

#134: Useful Toys.


00:00:00   Hello and welcome to Developing Perspective.

00:00:02   Developing Perspective is a podcast discussing news of note in iOS development, Apple and

00:00:06   the like.

00:00:07   I'm your host, David Smith.

00:00:08   I'm an independent iOS and Mac developer based in Herndon, Virginia.

00:00:11   This is show number 134 and today is Friday, July 19th.

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

00:00:18   All right, first I just want to start off by thanking everybody for the kind words and

00:00:22   encouragement after posting my, I guess, my two-year anniversary show last week.

00:00:27   was really nice to hear all the people who responded and talked

00:00:30   about how the role of developing perspective

00:00:33   is played in them and their career

00:00:35   and the apps they've shipped and things like that.

00:00:37   So that was kind of cool to hear.

00:00:38   So thank you.

00:00:39   I appreciate that.

00:00:40   And so after that, I'm just going

00:00:42   to dive right into my topic for today, which is about--

00:00:45   I guess you could call it toy projects,

00:00:48   like playground projects.

00:00:49   Everyone, I think, has different names for these.

00:00:51   But I think there's something that I

00:00:53   think is very important for people to use.

00:00:56   And I find myself increasingly kind of heading in this direction.

00:00:59   And so I kind of wanted to talk about the role they play for me

00:01:02   and how useful they are.

00:01:04   So specifically, I'm going to talk from my own experience.

00:01:07   This last couple of weeks, I've been working on a little toy project

00:01:11   because it started from a place of realizing that--

00:01:14   Iowa 7 especially--had a lot of new APIs,

00:01:18   a lot of new things that it does,

00:01:20   and a lot of things that it does in ways that will change how I build my apps.

00:01:25   And so I thought to myself, well, as I'm staring down, making updates to all my big, my main,

00:01:32   my significant applications, that's a bit of an intimidating thing to look at a code

00:01:35   base with, I don't even know, thousands of lines of code and say, OK, well, how am I

00:01:40   going to adapt this?

00:01:41   How am I going to change this?

00:01:42   What do I need to do to make this iOS 7 ready?

00:01:45   And then also, how do I make that coexist well with iOS 6?

00:01:48   And these kinds of questions kind of made me start to get a little intimidated.

00:01:52   I was like, you know what I should do?

00:01:54   I should pull up one of my old kind of sort of toy projects,

00:01:57   and I should work on that and update that for iOS 7

00:02:01   and see if we sort of get some experience with that.

00:02:04   And so what I did is I pulled up an old project of mine called

00:02:07   Simplegram, which is an Instagram viewing application.

00:02:10   And I thought to myself, well, this is a good one.

00:02:12   It's a very basic app in the sense

00:02:14   that it just displays pictures for the most part,

00:02:16   does a few web service calls, gets back some JSON, parses it,

00:02:18   displays it to the user, does some caching.

00:02:20   But it could really use a lot of the stuff that's

00:02:22   coming in iOS 7.

00:02:23   And obviously, I'm not going to get into the technical side of that so much as the kind

00:02:26   of just the high level stuff from the keynote and, you know, Apple's general thing that,

00:02:30   you know, you can do things like background downloading now.

00:02:32   And there's a variety of UI and changes and improvements that are coming in iOS 7.

00:02:36   And so I was like, well, let's try this.

00:02:38   And so I started and, you know, the next -- sort of in my spare time and sort of evenings and

00:02:43   things over the last week, I've been working on this.

00:02:45   And I've gotten it now to a point where it's a fully working iOS 7 application.

00:02:50   What I love is that what that does is that puts me now

00:02:52   in a place that I have this great little sort of example

00:02:55   code for myself of how to do things in iOS 7.

00:02:58   All the new APIs for appearance and networking,

00:03:03   and all the little things that are changing out

00:03:05   from under the app, I have a reference implementation

00:03:08   that is useful and meaningful, styled how I like it.

00:03:12   That's kind of going beyond, say, the sample code

00:03:14   that you get from WWDC or something like that.

00:03:17   Because I find that we're kind of in this weird middle ground

00:03:20   now, where after iOS 7 actually launches in the fall,

00:03:27   there'll be a lot of talk about it in terms of tutorials

00:03:29   and books and all kinds of things

00:03:31   that will appear at that point to help people kind of work

00:03:34   around some of the complicated edges.

00:03:37   But until then, you kind of run on your own for better or worse.

00:03:40   And so this was something that I did,

00:03:41   and I was just really encouraged that it didn't take that long,

00:03:44   because if you scale down the problem to something that's

00:03:47   fairly straightforward-- my goal was

00:03:49   to keep it as simple as possible.

00:03:51   It's like, I want to build something

00:03:52   that can pull in from a web service and download assets,

00:03:58   and has a UI that is cool in all the ways that iOS 7 UIs are

00:04:02   cool.

00:04:03   And so I sort of built that.

00:04:06   But now it's essentially like a four-class application.

00:04:09   It's very simple.

00:04:11   And it lets me try things out and play with things in a way

00:04:14   that is also kind of cool.

00:04:16   So another thing I did with this, which is getting away

00:04:18   from the iOS 7 thing, for a while now, I've been thinking,

00:04:21   you know, like, Core Data is-- sometimes feels like a trap,

00:04:27   in a good way and a bad way.

00:04:29   So like, Core Data, which I've used

00:04:31   in a lot of my applications, can do a lot of things,

00:04:34   and can do-- make them-- and can get you up and going very

00:04:38   quickly for a lot of applications,

00:04:41   for a lot of projects.

00:04:42   There's good tools in the browser.

00:04:44   There's a lot of documentation.

00:04:45   There's a lot of books and tutorials and things

00:04:47   people, it kind of gets you up and going.

00:04:50   But what I've found recently is using core data brings with it a tremendous amount of

00:04:55   complexity.

00:04:56   There's a lot of things going on and there's a lot of limitations that you have, especially

00:05:00   on performance side of things, that I kind of don't like.

00:05:03   And so I've been for a while then like, oh, maybe I should do something else.

00:05:06   Maybe I should use SQLite directly, which is sort of the most obvious approach for all

00:05:11   kind of my data persistence needs.

00:05:13   But I've always been like, oh, man, migrating away from that

00:05:15   would be really complicated, because I've

00:05:17   got these big, large projects.

00:05:19   And so I took the same philosophy.

00:05:21   I was like, well, let's see if I can take Simplegram.

00:05:23   Just take this very simple application

00:05:25   and change its state of persistence away from that

00:05:27   and into SQLite.

00:05:29   And so that's what I did.

00:05:30   And the result-- and this is sort of a mini topic

00:05:33   that I just kind of wanted to branch off on--

00:05:35   is that was actually really, really cool.

00:05:38   And I strongly recommend you take a look at that.

00:05:42   Now, you're playing at a much lower level with SQLite.

00:05:49   So SQLite, if you're not familiar,

00:05:51   it's a file-based database.

00:05:52   It's what Core Data usually sits on top of.

00:05:55   And it's basically a SQL database that runs,

00:05:58   but is just file-based.

00:05:59   So it's not one of these large server-based things.

00:06:02   It's just something you open a file,

00:06:03   but it has a very well-structured way of doing it.

00:06:05   And you can browse it and query it and insert into it, et

00:06:08   cetera.

00:06:09   And using it directly gives you a tremendous amount

00:06:12   update a value, I think if you do anything that involves batch

00:06:15   operations-- that's the one area that I'd say Core Data really,

00:06:19   really struggles with.

00:06:20   And this is something, as you may wonder,

00:06:23   I have a variety of circumstances

00:06:25   where I need to do things like, for example,

00:06:27   take a collection of articles and mark them all as a red

00:06:30   in Feed Wrangler or something like that,

00:06:31   or places where you're going to delete a bunch of things

00:06:35   if they're older than a certain type.

00:06:37   Now, in Core Data, you essentially

00:06:39   have to load those objects.

00:06:40   you can do to speed this up a little bit.

00:06:42   But a lot of what you're doing is

00:06:43   you'll end up loading all these objects into memory

00:06:46   and then iterating over them to delete them,

00:06:47   rather than just being able to make a single SQL call

00:06:49   and say update red equals true where ID in blank.

00:06:55   And it's tremendously more performant.

00:06:57   It's kind of one of these amazing things

00:06:59   that I've been thinking I should do for a while,

00:07:03   but having now have a sort of a toy project, an example where

00:07:07   I can actually try it out, I feel

00:07:09   much more confident about than taking that and moving it

00:07:12   into something else.

00:07:14   A side note to my side note is if you're

00:07:16   going to get into SQLite, the best place, I think,

00:07:18   to start is to get FMDB, which is Gus Mueller's wrapper

00:07:23   for SQLite.

00:07:24   That is excellent.

00:07:25   I'll have a link in the show notes.

00:07:26   It's a great way to kind of just get up and running.

00:07:28   And I'll also have a link in the show notes

00:07:30   to a tool called Base, which is a Mac application.

00:07:32   It's kind of a GUI application for setting up, editing,

00:07:35   browsing SQLite databases, which I've been using for years

00:07:38   and really like whenever I'm wanting

00:07:41   to look inside the database.

00:07:42   It's just a really quick way to do it.

00:07:44   It's an interface that I've just grown accustomed to

00:07:47   and really like.

00:07:48   So anyway, so now I have this very useful tool.

00:07:51   And that led me to an interesting--

00:07:54   another realization that I thought was interesting I

00:07:56   wanted to talk about is-- so what I've been saying

00:07:59   is that these test projects, these proof of concepts

00:08:03   or technological test beds, whatever you want to call them,

00:08:06   are useful in terms of teaching you, in terms of scaling down

00:08:09   a problem to something that you're only

00:08:11   dealing with the interesting technologies that you want,

00:08:13   whatever that may be.

00:08:14   So if you're doing a text application,

00:08:16   maybe you want to play out with some hot new text stuff,

00:08:19   you can have an application that's focused on that.

00:08:22   What I realized is that it was important for me

00:08:24   to, rather than just making it super kind of esoteric test

00:08:29   project, it was important for me to make something

00:08:31   that was actually useful.

00:08:33   Because if I didn't, then-- and I've done this before--

00:08:37   I'm not actually testing the edges of the technology

00:08:41   in a way that I'm just doing the bits that I think I'll need.

00:08:46   And then when I actually go to implement it

00:08:47   and properly in my application, then

00:08:49   there's all this other complexity that sprouts out

00:08:51   and grows from it.

00:08:52   So you want to build something, I think,

00:08:54   for this type of a toy project that is actually useful.

00:08:59   You want to build these useful toys that you can actually

00:09:02   sit down and use.

00:09:03   And so in this case, it's an Instagram browser,

00:09:05   which is something that I use periodically

00:09:07   to look at pictures on Instagram.

00:09:09   And so it's something that I actually--

00:09:11   I can just replace it, take the Instagram icon off my phone,

00:09:15   and put Simplegram in its place.

00:09:18   And I can play with it and use it,

00:09:21   I've seen it in a conscious way for a couple of days.

00:09:23   And I'll start finding the weird things that I wasn't doing

00:09:26   right, or the things where the places that it falls down,

00:09:29   or the weird bugs in the beta that I

00:09:30   I need to go file radars about.

00:09:33   These are the kind of things that you

00:09:34   wouldn't see if it just was a totally esoteric test

00:09:37   application.

00:09:37   And this is the kind of problem you'll see a lot with, say,

00:09:40   like sample code that you'll get from Apple.

00:09:42   It's something that you'd never actually use.

00:09:44   It's just a proof of concept.

00:09:46   And so if you're going to use these,

00:09:47   I think making them useful is something that's kind of cool.

00:09:52   And then it has a secondary benefit,

00:09:53   is that you actually potentially-- you can end up

00:09:55   in a point where you can decide, hey,

00:09:57   is this actually a product?

00:09:59   Now, it's unlikely to be a product that's

00:10:00   going to set the store on fire and make you millions of dollars.

00:10:03   But it's a project that you could potentially say, you know what?

00:10:05   This is actually useful.

00:10:07   It's something sophisticated.

00:10:08   It's not complicated.

00:10:09   It's intentionally stripped down.

00:10:11   But with a bit of work to clean it up and polish it up,

00:10:14   do the various art assets and the help and so on and things like,

00:10:18   you could potentially take that idea, take that test bed,

00:10:22   turn it into something that you can put into the store,

00:10:24   and then you've made it-- you've validated that time.

00:10:28   at even another level.

00:10:29   In addition to just being useful for yourself

00:10:32   and for your personal development,

00:10:33   you now have something that you can put in the store,

00:10:36   maybe make a little money from, or get

00:10:38   a little bit of exposure from, or just

00:10:39   have the experience of putting something in the store.

00:10:42   I talk to a lot of people who listen

00:10:44   to the show who have never actually submitted apps

00:10:46   to the store.

00:10:48   They're kind of interested in it,

00:10:49   or it's a hobby or something like that.

00:10:51   And there's a tremendous amount that you learn from actually

00:10:53   just putting something in the store,

00:10:55   going through that process, understanding

00:10:57   how iTunes Connect works, et cetera.

00:10:59   And so it's just something that I was going to--

00:11:01   the third level benefit of this is that you finally

00:11:04   have a project that you can put out there.

00:11:06   And it can do almost anything.

00:11:08   It can be very, very simple.

00:11:09   It can just be an application that downloads something

00:11:11   and shows it to you.

00:11:12   But if that thing that it's downloading

00:11:14   is useful or interesting or something

00:11:15   that you're going to check on a regular basis, then great.

00:11:18   Or it can test a new graphical API or a new whatever it is.

00:11:22   So just something that I was doing this week

00:11:24   that I thought would be interesting to talk about.

00:11:26   And so first, it's encouraging people to-- especially

00:11:28   as we're heading into iOS 7 or heading into new technology--

00:11:32   is to try and strip down all the things

00:11:35   that you're going to have to learn into a very

00:11:37   simple, well-defined problem, and then solve that first.

00:11:41   And then you can take those lessons and apply them directly

00:11:43   to the bigger thing without all the complexity of trying

00:11:46   to just dive into the thousands and thousands of lines of code

00:11:49   that you'll need to update and work to make it actually

00:11:51   work in a big project.

00:11:53   And two, make sure that it's actually useful.

00:11:55   that you yourself-- even if you're

00:11:58   the only person who would-- that you yourself would play with,

00:12:00   that you yourself would look at and use on a regular basis.

00:12:04   So you can really understand where your implementations are

00:12:07   falling down before you take them and try and put them

00:12:09   into something else, which is a lot of complexity

00:12:11   and would be harder, necessarily,

00:12:13   to dive down into it.

00:12:14   And then lastly, build something that maybe you

00:12:16   could actually put in the store and just take advantage of that.

00:12:19   All right, so that's kind of it for the day's show.

00:12:21   I just thought it was an interesting topic, something

00:12:23   that I'm definitely diving into recently.

00:12:25   And so I figured I'd share.

00:12:27   Otherwise, I hope you guys have a great weekend.

00:12:30   If you have any questions, comments, concerns,

00:12:31   or complaints, I'm on Twitter @_davidsmith.

00:12:34   You can email me, david@developingperspective.com.

00:12:36   Otherwise, have a great weekend.

00:12:39   Happy coding, and I'll talk to you next week.