0:00:00Hello and welcome to Developing Perspective.
0:00:05Developing Perspective is a podcast discussing news of note in iOS development, Apple, and the like.
0:00:07I'm your host, David Smith. I'm an independent iOS and Mac developer based in Herndon, Virginia.
0:00:12This is show number 77, and today is Thursday, September 6th.
0:00:16Developing Perspective is never longer than 15 minutes.
0:00:20So let's get started.
0:00:22First, I just wanted to thank you all for the great feedback you gave me on the last show, number 76,
0:00:23The Best Way to Avoid Distractions.
0:00:26I heard a lot of people say that it was a really good, encouraging, motivating show.
0:00:31And so if you haven't heard it, and this is your first one, or you just skipped the last one,
0:00:36I'd highly recommend you find it.
0:00:40A lot of people seem to be saying that it's a really good one.
0:00:42So first, I appreciate your saying.
0:00:45I want to thank you all for the feedback, because I do this for you, for the most part.
0:00:46It's something that I do as a side project, my main thing, for the goal of sharing the lessons I've learned,
0:00:53and hopefully helping other developers.
0:00:56It's not a commercial project or anything like that.
0:00:59And so one of the biggest things you can do
0:01:02if you like the show is to just give me that high five
0:01:05every now and then when it's like,
0:01:07if I do something that really resonates with you,
0:01:09it certainly encourages me and keeps me interested
0:01:12and keeps me motivated to do the show.
0:01:13All right, so I think what I've decided I'm going to do,
0:01:16based a little bit on that feedback I got
0:01:17from the last show, and kind of just trying to decide
0:01:20where to head over the next couple of weeks.
0:01:23So in the last show I introduced, I was saying that I'm just going to be starting to work
0:01:27on a weather app for iOS.
0:01:29This sort of the story back story of that's in the last episode.
0:01:32Basically, that's what I'm doing.
0:01:33I'm working on a weather app, and I'll probably be working on it for about the next month
0:01:37or so.
0:01:38My hope is to launch, I think, middle of the second week, October, something like that.
0:01:42So with review times and things, roughly I'll be working on it over the next, say, maybe
0:01:47month, month and a half.
0:01:48And I think what I've decided I'm going to do is I'm going to walk through this process
0:01:53from start to finish on the show and talk about how I'm going about doing what I'm doing.
0:01:58Now, some of the things I'll talk about are obviously, I'll be plain and straightforward and talk
0:02:04about some of the things I'll be a little bit more cagey about just in terms of it's, you know, you
0:02:09want to be able to control and trickle out some of the features, some of the UI, some of those kinds of things.
0:02:13I'm not going to jump in and share it all about it once as I'm doing it, but the goal is to kind of walk
0:02:21through this process and show the arc of developing an application, sort of from concept through
0:02:26to implementation, some of the marketing I'll do.
0:02:29And a big part of the reason why I'm doing it this way, and what kind of got me excited
0:02:33about the idea, is I want to try and synthesize and use all the lessons I've learned from
0:02:40my past failures, my past successes, all the things that I've done over the last, whatever,
0:02:45years that I've been writing iPhone apps, that I've learned about how to do it.
0:02:50And I want to try and really put all those, to bring all those to bear on this project.
0:02:55I want to make it that I'm doing all the things that I say, sort of I'm talking the talk about,
0:03:01I want to do those.
0:03:02And I'm going to be trying to do that in a way that I can talk about on the show.
0:03:07And that's hopefully helpful, that you can kind of over the next month and a half, whatever
0:03:11whatever that is, maybe 15 episodes.
0:03:14They won't all be about this.
0:03:15There's certainly things about like probably the new iPhone,
0:03:17the new iPad mini if it comes out,
0:03:19all those kinds of things.
0:03:20But you know, this will be an arc.
0:03:21And so what I want to do is,
0:03:22in some ways it keeps me accountable
0:03:25for doing all those right things.
0:03:26And having an audience who's expecting me to do it,
0:03:29it's like this app's going to be internationalized.
0:03:32And I'm going to talk about my experiences with that.
0:03:34I'm going to talk about, I'm going to make a video for it,
0:03:37a teaser video, a promo video,
0:03:39making the website for it, reaching out to the press,
0:03:44all those kinds of parts of the marketing back inside,
0:03:47as well as the development side.
0:03:49This app does a couple of interesting things,
0:03:50other things not so interesting,
0:03:53but that's what I'm going to be talking about
0:03:54over the next couple of weeks.
0:03:56I just wanted to queue that up.
0:03:57If that sounds good to you,
0:03:58and especially if there are topics or ideas
0:03:59or things that you want to make sure that I hit on
0:04:03in that vein of if you're building an app
0:04:05from start to finish,
0:04:07what are the things that you want to talk,
0:04:05you would want to make sure you were understanding or hearing my perspective on,
0:04:10then please let me know.
0:04:15Twitter is probably the best way to do it.
0:04:16You can also email me.
0:04:18It's on my About page if you need my address.
0:04:19But you can, please reach out to me if you have things that you want to make sure I cover.
0:04:22Otherwise, it should be pretty good coverage of the topics involved in writing an app and getting it done.
0:04:26All right.
0:04:33So the first part of this, what I'm going to talk about is prototyping,
0:04:33and specifically about how I build an app
0:04:38and how I start that process and work through it.
0:04:41So kind of from final new project,
0:04:43this is the way that I tend to build an application.
0:04:46So first, you always pick a template
0:04:48that is relevant to your application,
0:04:49that'll do a lot of the heavy lifting for you if you want.
0:04:52Xcode has a lot of these templates in there
0:04:54and they work pretty well.
0:04:56They're definitely, you're going to get carried away
0:04:58with that, but if you're making a data-driven application
0:05:01that's going to be table-based, use the detail view template.
0:05:05And it'll do a lot of the setup for you.
0:05:07You can click a button that says use core data,
0:05:09and it'll build a base core data stack for you and things.
0:05:12These are things that you ultimately, a lot of times,
0:05:15what I'll end up doing is replacing those templates.
0:05:16And I'm not saying that you want to necessarily ship
0:05:19that template or use the code that's in that template,
0:05:21but it's great for getting started.
0:05:22Because you can start implementing your idea
0:05:25rather than having to do a lot of boilerplate, a lot of code
0:05:28that isn't actually interesting or useful.
0:05:30There's a lot of things that are just kind of there that you have to do.
0:05:35If there's a template that exists for doing that, please do use that.
0:05:38Don't feel like you need to start a new project with the window-based application,
0:05:42which is I think the most bare bones.
0:05:46You know, absolutely nothing in it.
0:05:48Don't do that.
0:05:50That's not helping anybody.
0:05:51So first, you start that and you start a new project.
0:05:54And probably it's also important for you to have a slight disclaimer.
0:05:55A lot of what I'm talking about in my development process
0:06:00applies mostly to individuals or very small teams.
0:06:03If you're a developer working on a large team,
0:06:0610, 15, 20, 30 developers,
0:06:09first, you really have my condolences.
0:06:11I'm sorry about that.
0:06:13That's a tough situation.
0:06:14I've been there.
0:06:16Personally, I'd rather work on smaller and smaller teams.
0:06:18The smaller the better.
0:06:21Probably my sweet spot is probably a couple of developers.
0:06:22I've really enjoyed the time since I've worked on projects
0:06:22I've met a couple developers, but I've also done the big, big teams, and it's a bit of
0:06:26a mess.
0:06:27But anyway, I'm just saying as a disclaimer, what I really like is this is the way that
0:06:32I like to do it because I'm an individual.
0:06:34I can cut a few corners.
0:06:37That would be really awkward to cut in a bigger team project.
0:06:41For example, some of the ways that I do things in terms of files and being able to add and
0:06:46remove files really easily and things would be really awkward in a version control environment
0:06:50where you're constantly trying to have to merge
0:06:55XJ project files and nib files and things.
0:06:57Take it with a grain of salt if you work on a large team,
0:07:02but if you're a small team or an individual,
0:07:05definitely this is the way that I do it,
0:07:07and it seems to have worked pretty well.
0:07:09So the first thing I do when I'm trying to prototype something
0:07:11is I hate doing work that doesn't help me get closer
0:07:13to actually completing my project.
0:07:17And by that I mean I hate it when you kind of,
0:07:19I hate the concept of building things
0:07:22that you're going to, that are entirely throwaway.
0:07:26I'm a big fan of throwaway code,
0:07:29but I don't like things that I'm going to build
0:07:31and then throw away.
0:07:32And a classic example for me of this
0:07:33is the Photoshop mockup, where you are having someone
0:07:38spend a lot of time and effort mocking up every page,
0:07:41pixel by pixel, and then the developer goes
0:07:44and tries to build this.
0:07:45And obviously I'm a developer, and that's my specialty.
0:07:50So I'm going to shy away from that process.
0:07:53If you're in a design-driven organization,
0:07:55that may be just the way you work,
0:07:58that the people in the driver's seat are designers
0:07:59rather than developers, and so you can't.
0:08:01And for me, I really struggle in that environment.
0:08:03What I like doing is I want to build it right away.
0:08:08I want to get in there, I want to build something,
0:08:10and I want to have something to show
0:08:12from that very first day.
0:08:11So what I do is, everything I do is writing code.
0:08:15I have a couple of sketches, maybe in a notepad,
0:08:17just to kind of organize my mind,
0:08:19but once I've got that, I just go in and start building.
0:08:22And when I'm starting to build, I tend to,
0:08:26I'm cutting a lot of corners,
0:08:30and these are often things
0:08:31that I know I'm going to replace later.
0:08:33And you cut these corners
0:08:36to make your development process faster.
0:08:38Any time that I can do something
0:08:40make me develop quicker and more effectively, I'll definitely do it.
0:08:44So, and often what I'm doing when I'm building these things is I'm doing, I'm making obviously
0:08:49naive choices that I know aren't right, and I know there are better solutions for, but
0:08:54I don't have the time or the energy to do it right away, because what I want to do is,
0:08:58my goal is to get from zero to a roughly functionally complete version as soon as possible.
0:09:06And by that I don't mean that it's ready to ship.
0:09:11For that I have something that I can put in people's hands,
0:09:14have them play with it, I can play with it,
0:09:16I can start using it day in and day out.
0:09:18On my home screen right now is my weather app
0:09:21and I'm using it daily to check the weather
0:09:23before I go out to use on a regular basis.
0:09:25And I want to get there as quickly as possible.
0:09:28It drives me crazy when I've worked on projects
0:09:30where you end up spending like weeks and weeks
0:09:33building all this code that at the end of it you're like,
0:09:33We don't have anything to show yet.
0:09:36Some higher up, some C-level executive appears in and says, "Hey, what you guys been working
0:09:41on?"
0:09:42It's like, "Well, we've got these 16 data persistence libraries all ready to go.
0:09:45We've got this data rendering engine over here, and we have nothing really to show for
0:09:49it."
0:09:50I want things as quickly as possible.
0:09:52So the first thing I did when I'm building a weather app is I set it up so I could make
0:09:59a weather call, download the data, and display it on the screen.
0:10:02That's my first goal, and that was pretty straightforward.
0:10:07I use AF networking as my networking stack right now
0:10:10because it is just gorgeous.
0:10:13The API for it is really straightforward.
0:10:15It seems very fast, performance reliable,
0:10:17and I've had really good experience with it.
0:10:20And so that's all the application was at its beginning,
0:10:22is it was just a single view with a couple of labels in it
0:10:24that were styled in basic Helvetica,
0:10:27and you open the app, it made a static request
0:10:29for basically the address of my house,
0:10:30and it showed me data.
0:10:35Now, at that point, that took, oh, no,
0:10:36maybe an hour, something like that.
0:10:39It was not a lot of work to get to that point.
0:10:41Now, at this point, I actually have something that's useful.
0:10:44I can use this to look at the current weather
0:10:46right now on my house.
0:10:49That's obviously not an app I don't want to ship,
0:10:50or it's not useful in the broader sense,
0:10:52but what I've done, though, is I've started,
0:10:54I've gotten a great starting point,
0:10:57and then I just start growing out from there,
0:10:56pulling in more data, showing it to the user, starting to build out the views.
0:11:00But in everything what I'm doing is I'm trying to, as quickly as possible, get it on screen.
0:11:04I want to be able to see it and play with it and interact with it. But I cut a lot of corners
0:11:08in doing that. So here are a couple of examples, and I think these are hopefully useful
0:11:12examples for what this actually means in practice. So, for example,
0:11:16one thing that I always do whenever I'm working on
0:11:20prototyping like this, is I set it up so that I always
0:11:24cache network requests, pervasively, across the board.
0:11:29Because I want my iteration process
0:11:34to be as quick as possible.
0:11:38So when I launch it in the simulator on the app,
0:11:40it immediately returns results and displays them.
0:11:42Because usually the interesting part
0:11:45is not getting the data.
0:11:46The interesting part is what I do with that data,
0:11:48how I display it, how I interact with it.
0:11:49So what I do is I just add a little stub
0:11:51to my AF networking stack that any time
0:11:51a URL request is made, I record the URL,
0:11:56and when I get the JSON back, this is a JSON thing,
0:12:00it works pretty much any way you do it.
0:12:03I get the JSON back, I take that as an NS dictionary,
0:12:05and I put that dictionary with the URL key
0:12:09in my NS user defaults.
0:12:12It's a terrible solution for caching,
0:12:14but it works really well because it does all
0:12:16the serialization for me, I don't have to worry about that.
0:12:18And then you just, at this point,
0:12:23anytime you make a network request,
0:12:25it's instantaneously returned.
0:12:26There's all kinds of performance problems and things
0:12:28that you never actually want to cache anything
0:12:30in NSC user defaults, but it's a really simple way
0:12:32to just pervasively put that kind of code
0:12:34in your application.
0:12:36And it makes my development process much quicker.
0:12:37Now, I've since iterated twice on my caching strategies,
0:12:39and right now it's got a much more complicated system,
0:12:43you know, serializing data to disk
0:12:46in special custom files and all these kind of things
0:12:46that I've been building on top of that.
0:12:51But to start off, that's what I did,
0:12:54and it made me develop faster
0:12:55because I didn't have to worry about
0:12:57network connectivity problems,
0:13:00about that performance hits,
0:13:02all those things I could just focus on what I was building.
0:13:04Another thing that I do
0:13:06is I have a couple of base UI view classes
0:13:08that all of my views tend to subclass.
0:13:10And I often do that mostly just so that I can do
0:13:13kind of clever, not clever,
0:13:12I can apply custom attributes to all views across the board
0:13:17to make my life a little easier when I'm developing.
0:13:21And for example, the classic,
0:13:23this is the most important thing that I do
0:13:24whenever I'm laying out code,
0:13:26is I set it so that all my views have a one pixel
0:13:27like black border, or a random color border is even better
0:13:30if you just pick a random color.
0:13:33Because what that allows me to do
0:13:35is very easily see layout on my screen.
0:13:36When the app is running,
0:13:39everything has these ugly borders everywhere,
0:13:37But I can see weird alignment problems.
0:13:38I can see how things are actually spaced out in a way that is often difficult if you have
0:13:42a lot of white space around your controls.
0:13:45So those are two things that I do when I'm starting off, when I'm prototyping, to just
0:13:48get going quickly.
0:13:49And as I said, all of those things will get pulled out and replaced later.
0:13:52You don't want to ship this stuff.
0:13:53What you're trying to do, though, is actually get something that you can ship soon so that
0:13:57you can get feedback on soon.
0:13:59The earlier you make mistakes, the quicker you're able to correct those mistakes.
0:14:04You put it in front of somebody and they're like, "This doesn't make any sense."
0:14:07You want to know that information as soon as you can.
0:14:09As a result, I'm about a week in.
0:14:12I've spent roughly one week of time working this app.
0:14:15And I have some that's functional, that's useful,
0:14:17that I've started to put in people's hands and show them.
0:14:20And I've gotten started getting feedback.
0:14:22And so that's the goal of this really rapid focus
0:14:24on attention to shipping something
0:14:27and putting pixels on screen as soon as possible.
0:14:29All right.
0:14:30That's it for today's show.
0:14:31As always, if you have questions, comments, concerns,
0:14:33complaints, I'm on Twitter as _DavidSmith.
0:14:35Otherwise, I hope you have a good weekend.
0:14:37And as always, happy coding.