Podcast Search

Developing Perspective

#134: Useful Toys.

Select a time to play from there. The line being spoken is highlighted as the audio plays.

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

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

0:00:06the like.

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

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

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

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

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

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

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

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

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

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

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

0:00:38So thank you.

0:00:39I appreciate that.

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

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

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

0:00:48like playground projects.

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

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

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

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

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

0:01:02and how useful they are.

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

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

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

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

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

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

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

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

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

0:01:40going to adapt this?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

0:02:22coming in iOS 7.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

0:04:02cool.

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

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

0:04:09It's very simple.

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

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

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

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

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

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

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

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

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

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

0:04:41for a lot of projects.

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

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

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

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

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

0:04:55complexity.

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

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

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

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

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

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

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

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

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

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

0:05:23Just take this very simple application

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

0:05:27and into SQLite.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

0:06:08cetera.

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

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

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

0:06:19really struggles with.

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

0:06:23I have a variety of circumstances

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

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

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

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

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

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

0:06:39have to load those objects.

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

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

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

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

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

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

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

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

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

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

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

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

0:07:12into something else.

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

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

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

0:07:23for SQLite.

0:07:24That is excellent.

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

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

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

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

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

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

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

0:07:41to look inside the database.

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

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

0:07:47and really like.

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

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

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

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

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

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

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

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

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

0:08:13whatever that may be.

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

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

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

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

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

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

0:08:31that was actually useful.

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

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

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

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

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

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

0:08:51and grows from it.

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

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

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

0:09:02sit down and use.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

0:09:37application.

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

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

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

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

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

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

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

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

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

0:09:57is this actually a product?

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

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

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

0:10:05This is actually useful.

0:10:07It's something sophisticated.

0:10:08It's not complicated.

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

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

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

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

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

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

0:10:28at even another level.

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

0:10:32and for your personal development,

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

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

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

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

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

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

0:10:46to the store.

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

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

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

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

0:10:55going through that process, understanding

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

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

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

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

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

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

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

0:11:11and shows it to you.

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

0:11:14is useful or interesting or something

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

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

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

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

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

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

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

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

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

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

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

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

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

0:11:51work in a big project.

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

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

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

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

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

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

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

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

0:12:13to dive down into it.

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

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

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

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

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

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

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

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

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

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

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

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