0:00:00Welcome to Under the Radar, a show about independent iOS app development.
0:00:04I'm Mark Arment.
0:00:05And I'm David Smith. Under the Radar is never longer than 30 minutes, so let's get started.
0:00:10So we occasionally have a little bit of a lull in newsworthy topics or relevant topics that we haven't already covered.
0:00:16This is one of those weeks where we decided to ask the listeners for basically some Q&A questions.
0:00:21We did this once before and it was, I kept thinking it was recent, but it was back in 2016, so it wasn't that recent.
0:00:27It was almost two years ago. We're going to go through, kind of have like a miscellaneous day, and let's see how it turns out.
0:00:33I think it should be pretty fun, I think.
0:00:35I think we're going to leave, like I'll have a link in the show notes to the tweet that Marco sent out to ask for questions.
0:00:41If you respond there, between now and next week we're going to take a look at the questions.
0:00:45And if there's a lot of more great questions, we might do another round next week as well.
0:00:50So just if you have a burning question, this is an opportune time to ask it.
0:00:54So the first question comes from Hakon Bogan, who asks, "Will React Native be the way forward for iOS development?"
0:01:02And this was also asked in a more direct way by somebody named Casey Liss.
0:01:07The way I feel about things like React Native, and this is with the giant caveat that I have used almost none of these types of systems.
0:01:15Effectively, I have no experience with them.
0:01:18But it's really hard for anything that is not the official platform API, and the official platform way to build things, to really ever get like massive amounts of traction.
0:01:31Sometimes, you know, the realities of the platform are a little bit different.
0:01:36Like I would say, one case where a third party thing has totally taken over a platform is jQuery taking over JavaScript.
0:01:43Like if you search the web for how to do something in JavaScript, 95% of the answers you're going to see are really how to do it in jQuery.
0:01:51Because they just assume, of course, everyone's using jQuery.
0:01:54With iOS, it isn't that simple. You know, with iOS, even great ideas from third parties about how applications should be built, or what kind of frameworks or libraries they should be built on, are really hard to get traction.
0:02:06Because iOS development is really big, and also Apple has a pretty strong first party point of view, and they keep moving it forward, and everyone's already using it and invested in it.
0:02:16So it's really hard for anything like React or any other kind of alternative interface framework or method of programming to really take off unless Apple actually does something like that themselves, as the official first party API.
0:02:32And I think too, I struggle with these types of things. I think mostly just from a...
0:02:37Like there are situations where they come into play, where if you are a company who needs to have a cross-platform application,
0:02:47where tying directly to the native libraries directly is inconvenient for some reason. And usually what you hear is, "Well, we want to have an Android app and an iOS app, and we want to have some amount of more commonality between the two."
0:03:05So if you move up into a library like this, you get the advantage of being a bit more portable in that way. Or you can certainly get into benefits around...
0:03:17I know with a lot of React, it's a different way of programming, where it's more event-driven, I believe.
0:03:22And you can think about your application in a different way, which certainly could be useful. It's certainly not diminishing that.
0:03:29But I always struggle with these types of things because... Like in your example of jQuery, I think is a great one, where JavaScript isn't something where there is a platform owner who is intentionally and specifically driving things forward.
0:03:45No one owns JavaScript in the way that Apple owns iOS or that Google owns Android.
0:03:52There isn't this single point of direction. In general, the community agreed that jQuery was a great baseline and adopted it as a result.
0:04:04But what I struggle with with something like any of these types of things is, it means that I'm now dependent in two levels to the further direction from application.
0:04:17Because every year, Apple is going to change the platform in some way, as we expect. And they're going to be pushing it in a certain direction.
0:04:25And then now, I'm currently reliant on it. I'm under no illusions that I'm free from this, that I'm developing off of my own and not dependent on anyone else. I'm dependent on Apple.
0:04:37But that one's unavoidable. If I also then time myself to be dependent on, in this case, React. So Apple makes a change. I have to then wait for React to make that change, and then I can start making my changes.
0:04:49Or Apple pushes things in a different direction, and then suddenly I have to wait for these dominoes to fall before I can really make changes.
0:04:59And that just always makes me nervous. Or if React just stops being worked on, and suddenly I'm in kind of a dead-end platform that I can't, for whatever reason, I can't update my application.
0:05:10Or there's some weird toolchain problem, and suddenly I can't do these things. If Apple stops updating iOS, well, the platform is probably dead.
0:05:19It's no longer a useful or interesting thing. But there are plenty of reasons why a third-party thing might not continue to be worked on and not be as viable.
0:05:28And so for me, I find the risk of putting my codebase in this kind of tenuous place to not pay off the potential benefits, even though those potential benefits are real and tangible things.
0:05:39It's never gotten to a place that it seems like it made sense to do, unless you have really compelling, specific reasons otherwise.
0:05:47Alright, our next question comes from Rick Allen, who asked, "What is your approach to writing reusable and maintainable code? Had you decided whether something needs refactoring?"
0:05:58He says he tends to write very focused code on the problem at hand, and sometimes ends up having duplicate code.
0:06:05This is something for me that I try very hard to never copy and paste two files from one project into another, for instance.
0:06:16Like I was just yesterday, I had a need for writing out a WAV file for a utility I'm writing on the Mac. Don't worry, it's nothing exciting.
0:06:27And I already had WAV writing code for SideTrack, the private app that I use to sync up Double Ender podcast tracks.
0:06:39And the needs were going to be very slightly different between the two. And I thought, you know, I could just copy this over, I could, you know, I could copy it over and modify it, but then I have two different files that are similar, but you know, not, but it's two different representations of the same function in two different files in two different projects that are almost the same.
0:06:59And I was like, well then what if I find a bug in one and I fix it in that one, and I don't remember to fix it in the other one, like that's kind of, you know, inefficient and potentially bug prone for the future.
0:07:09So what I usually do for reusable or reused code is just basically try to make a private library that I can then add as a Git submodule to both projects.
0:07:22And so I host it on GitHub, I have its own separate project for these private libraries. I don't have a large number of these, I have maybe like five or six of them.
0:07:30But you know, things like my iOS utilities library, some extra things on top of the iOS utilities that aren't really ready for public consumption but that I use as kind of like my private utilities.
0:07:42My audio engine and different parts of my audio engine and different functions for audio engines, those are kind of all separated into a library, and so I'm able to share that code.
0:07:52And my idea basically is like, if it's one library that I'm sharing as a Git submodule in all the projects that use it, then I, you know, any bug fixing in one benefits all of them.
0:08:06And it's worth the slight overhead to make the code reusable and generalized to some degree.
0:08:12It's worth that overhead to have that shared bug fixing and shared labor potential of doing that.
0:08:18As for refactoring, I'm not a big refactorer. I still think that refactoring is largely a construct, it's largely a euphemism for rewriting in practice a lot.
0:08:32I know that isn't officially what it means, but in practice I think refactoring often means I really just want to rewrite this because I'm a programmer and all programmers always want to rewrite everything that they come across.
0:08:43But I know rewriting is a bad thing, so I'm gonna call it refactoring, even though I'm putting in enough work and making enough changes that I'm basically rewriting it.
0:08:53So I have never found a good balance between refactoring and rewriting, and I'm not sure anyone else has either, but regardless I'm sure Casey will yell at us for this if he didn't yell at us already for the first answer about RxSwift.
0:09:07But I don't really do refactoring. I will occasionally do a rewrite, but very occasionally, only when it's really necessary.
0:09:14In some ways it's a funny thing to weight into, but I, as a general rule, don't worry too much about duplication between projects.
0:09:28I don't have any shared libraries that I use between my various products, even though many of them have similar attributes to them.
0:09:38Obviously a lot of them deal with, for example, the health framework. A lot of my apps read and write data from the health framework.
0:09:45What I tend to do for my focus is around, I try and, in order to make my code very maintainable and very focused, I have certain patterns that I use across multiple applications.
0:09:59In terms of the way that I structure my requests to health, for example, are very similar across apps. But in my experience, trying to make something work across multiple uses more often than not tends to make it more cumbersome to use.
0:10:20Which often in a weird way makes it harder to maintain. Because you have the benefit in the sense of there's always the concept of, "Well, I find a bug, I can fix it, and then it's fixed for everybody."
0:10:33Which is a great promise, but in practice I often found, when I used to do that kind of thing more specifically, is that also it creates another room for a new bug in all the dependent applications.
0:10:46That they may have been relying on what you are now considering to be a bug from one application I'm working on. It reads the data, it gets it back, and it's like, "Oh, the way that it was doing it now is different."
0:11:02"Oh, maybe this is a bug." I make a change. And I'm actually breaking other things, because these dependencies are much harder to remember about and plan for in that way, at least in my experience. You get a benefit in theory of having this cascading bug fix, but you also have the downside of the cascading uncertainty about what this change is going to do to anything that depends on it.
0:11:27And so what I tend to do is try and write, I try and have similar patterns across my apps, but they're very focused on the problems and the things that they're trying to do.
0:11:37And so I can build and learn from the past experience without necessarily needing to reuse that code specifically. And I found that works reasonably well.
0:11:48I think on the refactoring side of things, I'm very much like you. If it isn't broken, I don't tend to go back in and change it. I find that it's far more likely that I'm going to introduce problems than that I'm actually going to solve things.
0:12:03And I think refactoring's place probably comes in more into play when you get into a larger team organization than the situations where I have found refactoring to be a actually productive thing, is where you're trying to create and force uniformity across a code base, where it is written by five or six different people, that sometimes you might need to go back and refactor something, or rewrite it or change it,
0:12:32to make it more in line with a broader code base. That is certainly something that I found productive, just from a uniformity perspective, but still, it's something that is very rare and very rarely actually useful, that I'd rather typically spend that time making the product, adding a new feature, making the product better, making it faster, doing those types of work,
0:12:54than doing something that is primarily beneficial, ostensibly, for me, the developer. I'd rather put the focus on external things that customers are actually going to see and experience and feel.
0:13:06Colin Weir asks, "What are some types of apps you could build that would help teach you some core concepts beyond just the typical Hello World example?" So, for instance, building a notes app would teach you X, Y, and Z.
0:13:18So I think for this, I mean, this is a great question, if you're trying to learn and you're trying to learn something beyond Hello World, the number one answer really is try to build something that you are really motivated to make happen, that is also practical to achieve with your level of skill and time.
0:13:35So, if you want to make the next AAA video game and you've never programmed before, this might be a problem for you, but you can do things that are more achievable. That being said, any real-world useful app that you pick to try to tackle,
0:13:51first of all, if you're motivated to do it, that'll get you through the grind of learning. So that's how I think almost all programmers learn, is basically they want something to exist, so they kind of plow through until they make it exist.
0:14:02But almost everything you pick besides Hello World is going to teach you a lot of different things, just by necessity. So, for instance, if you are trying to write a game, for instance, which is a lot of times people get into it when they're younger,
0:14:16mostly because they want to create games first, and it's often people's first programs, like something in a basic little game, and making a game teaches you all sorts of crazy stuff.
0:14:25You learn lots of things about 3D or 2D graphics, geometry, linear algebra, possibly if you're at those levels you might be learning about physics, even basic ballistic-type games, you're going to be dealing with physics on some level.
0:14:38You're going to be dealing with textures and lighting and colors and menus and music and level design and trying to make things fun and difficulty curves.
0:14:48Anything you do beyond Hello World I think will teach you different things. I would also say another major category of this would be dealing with user data.
0:14:58Doing something where people are entering data where you are basically taking responsibility for it, which means that you have to care about things like data integrity, backups, restore.
0:15:11You might at some point have to deal with sync, and then sync you have to deal with privacy. Any problem area you pick will naturally sprawl into tons of different areas.
0:15:26There isn't one particular type of app that you should do after you learn the basics of Hello World. I would say just do the one you're motivated to. So much will just naturally flow from that, that as soon as you get to step one, steps two through five are going to become obvious to you.
0:15:45Like, "Oh, now that I have this, now I should really add this, this, and this." And then the same way you learn how to do the first part, you can learn how to do the rest, just one by one.
0:15:54Yeah, and I think too, there's something to be said for, it's like build something that actually does something. I think in some ways is inherent in this question is that doing these contrived examples that you often end up with in a programming book or something like that.
0:16:14In my experience, it's far more interesting, I learn much more when I try and solve a real problem that I have in my life, that somebody I know would use, even if it's not an app that you expect to ship or make money from or any of those types of things.
0:16:27But it's something that is practical, that you're solving an actual problem, you're not inventing a problem and then inventing a solution, I think is helpful.
0:16:36Something I'd also say that is really useful is to think about what types of frameworks or areas of development you are most interested in and build an app to get used to doing that.
0:16:49I've learned some of my best learning to buy just sort of like pick a framework that I don't have a lot of experience with and I just try and make some app that uses it.
0:16:59And sometimes, for example, I've never shipped a photos app, but I've built and played with the photos frameworks just because I'm curious about how they work.
0:17:08And there's something nice about sort of building an application that is focused on one framework or one area of iOS that lets you kind of, you can drill in and get deeper more quickly into a problem rather than trying to do something that touches on lots of different technologies and sort of integrates them.
0:17:28That's a really interesting problem and honestly that's probably where down the road as you get more experience, that's where most of your sort of the value that you're going to be able to provide in your products is going to come from combining interesting technologies together.
0:17:43But when you're learning, I find it's great to just focus on one technology and sort of dive into it and get good at it and kind of have that experience and you're able to get to something useful much more quickly that way.
0:17:56Mike and Steven ask, "Who is sponsoring this episode?" Well, Mike and Steven, this episode is brought to you by Linode.
0:18:03With Linode, you'll have access to a suite of powerful hosting options with prices starting at just $5 a month.
0:18:08You can be up and running with your own virtual server in the Linode cloud in under a minute.
0:18:12Linode has hundreds of thousands of customers, including David and I.
0:18:16Linode knows how important it is to get the help that you want and need.
0:18:19And I've been using Linode myself for, gee, something like eight years or maybe even more than that now.
0:18:24It's been a long time. I've dealt with their support here and there and it's been wonderful.
0:18:27I really have no complaints. It is fantastic support.
0:18:31They also have the best control panel I've ever seen at a web host.
0:18:35I've probably been with at least 15 or 20 web hosts by now in my career and the control panels are usually awful.
0:18:41Linode's is wonderful. It's nicely designed. It's intuitive. It's very capable.
0:18:46There's lots of things you can do without filing a support ticket to try and wait for them to do it for you.
0:18:50You can even do things like resize, upgrade your server sizes and resources.
0:18:55You can resize disk images. You can shut down the server, resize the disk, and it boots up and it just has more space.
0:19:02You don't have to repartition. You don't lose any data. It's remarkable how good all this stuff is.
0:19:07And of course they have lots of other wonderful features that won't even fit in this ad read.
0:19:11Things like two-factor authentication, a whole API, lots of great stuff.
0:19:15Linode has fantastic pricing options available.
0:19:17Plans start at one gig of RAM for just five bucks a month.
0:19:20And they also now offer high memory plans that prioritize RAM over the other resources if you need that.
0:19:25Those start with 16 gigs of RAM and they go up from there.
0:19:28So our listeners can sign up at linode.com/radar to support us and get $20 towards any Linode plan.
0:19:34So on that $5 a month plan, that's four free months.
0:19:37And with a seven-day money-back guarantee, there's nothing to lose.
0:19:40So go to linode.com/radar to learn more, sign up and take advantage of that $20 credit,
0:19:45or use promo code radar2018 at checkout.
0:19:48Thank you so much to Linode for hosting all my stuff and supporting this show.
0:19:52Chris Stirner asks, "Any tips to mastering the art of packing for conferences or travel trips like _DavidSmith?"
0:20:01Which I believe is you.
0:20:02This is in reference to the recent discussion on ATP we had last week or the week before about packing cubes and backpacks.
0:20:09And we mentioned how you seem to be like this master traveler.
0:20:12Like whenever we travel and you're there, you have basically like a handbag-sized backpack,
0:20:19and out of that comes all the things you need for a month.
0:20:22How do you do this?
0:20:23So you're exaggerating the size of my backpack.
0:20:26Barely.
0:20:27Yes. It is something that I...
0:20:30It's such a funny question to answer in public, but...
0:20:33Would a 17-inch MacBook Pro fit in your backpack that you use for travel?
0:20:3715-inch would.
0:20:39So you can fit, like, in the space that a 17-inch MacBook Pro would not fit, you fit like a week's worth of everything you need.
0:20:46Sure. So I think probably it's fair to say...
0:20:49So yes, I tend to pack light.
0:20:52That is something that I have developed over the last year, over many years.
0:20:56That is just a tendency that I have.
0:20:58And I think, first, it's probably the best place to start, I think, is if someone wants to pack light,
0:21:03is understanding why you might want to do this.
0:21:05And first, it's just to say, there is something just delightful when you're traveling to have less things with you.
0:21:12That it's... When you walk through an airport, when you're trying to...
0:21:15Especially if you're going to a place that you then...
0:21:17You have to walk a quarter mile or a half a mile to something.
0:21:22Having lots of stuff is just burdensome.
0:21:24And I think also this has become more manifest for me since I have children.
0:21:29And so now, often, I have to carry their stuff as well as my stuff.
0:21:33And so, minimizing the amount of stuff that I take on when I'm traveling or when I'm doing trips is just useful in that way.
0:21:40And so, once you get used to it, it's really kind of hard to go back to the world where you pack lots of stuff,
0:21:45you have big luggage, and you just kind of muddle through with that.
0:21:50Once you can wrap your head around, well, I don't actually need nearly as much stuff as I think I do when I go on trips,
0:21:56and kind of get used to the realities of that.
0:21:59So that's sort of the main reason why I do this.
0:22:01And I think, for me, the technique and the approach I take is coming from a backpacking background.
0:22:07So, growing up, I was in Boy Scouts, and we did a lot of backpacking.
0:22:10And that was the thing that we did.
0:22:12And obviously, I've hiked hundreds and hundreds of miles backpacking.
0:22:16And something that you very quickly get used to when you do that kind of travel,
0:22:21where you are literally taking everything that you will have with you for the entire trip,
0:22:25putting it on your back, and then carrying it for 10 miles a day, 20 miles a day, whatever it is you're doing,
0:22:32you very quickly start to wonder, "Do I really need this? Is this really something that I want to carry with me up this mountain?"
0:22:40And so it creates that kind of a mentality.
0:22:43More practically, I think, for people who might be thinking of lightening their load,
0:22:47is something that I started doing that I think is a really just good discipline in general for packing
0:22:53and understanding what you need is every time you get back from a trip,
0:22:57take all of the things that you didn't actually need or wear or you brought with you just in case,
0:23:03and pile them up on your bed when you're unpacking or something like that.
0:23:07And you start to very quickly see trends if you do this over a course of a couple of trips.
0:23:13You'll start to see that, "Man, I always bring three pairs of jeans, and I only end up wearing two.
0:23:19Why am I bringing the third pair?" Or, "I always feel like I'm going to need this thing, and I never actually do."
0:23:25And there are certainly cases where you can pack defensively, where like,
0:23:29"Well, I'm going to have everything I could ever possibly ever need, and I'm going to cover all my bases,
0:23:35and then I will never need anything else." It's like, "Okay, maybe."
0:23:40But that preparedness is coming at the expense of having to then carry this with you everywhere you go,
0:23:47versus the reality that in most places, if you're traveling to any urbanized area,
0:23:54almost everything you could ever need can be purchased with a credit card at very short notice.
0:23:59That's just life. If you're in the United States, there's probably always going to be a Target or a Walmart
0:24:06somewhere nearby that you can get almost anything you need.
0:24:09And in general, that really actually happens. If you are thoughtful about what it is that you're going to take with you,
0:24:14you don't need nearly as much as you think. And so on the first side, it's like, reduce what you're going to bring.
0:24:19In terms of actually packing it into a small case, the biggest thing I find there is to just pack,
0:24:26give yourself less space, and you will naturally bring less stuff.
0:24:31It's sort of like, I think it's Parkinson's Law, or one of these software development overarching laws,
0:24:41which is, work expands to fill the time allocated. So if your boss gives you two weeks to finish something,
0:24:47it'll take two weeks. If your boss gave you the same amount of work and said you had to do it in a week and a half,
0:24:52somehow magically you could do it in a week and a half. Everything tends to expand to fill the space available.
0:24:59And so when you're packing, give yourself a smaller bag and you will naturally find your way to make it work.
0:25:07And that's just something that I think is useful. I have a nice backpack that is good for this kind of thing,
0:25:14it's very space efficient, it doesn't have a lot of wasted space inside of it, but by limiting myself to that,
0:25:23you are forced to make more specific choices. In some ways I love and I hate when I have to take a big Czech suitcase
0:25:30because I'm bringing something else with me that I can't fit into a smaller bag. It's great insofar as it's like,
0:25:37"Now I don't have to make these choices." But it's bad in the sense that I end up bringing way more stuff than I actually need,
0:25:42and it ends up just being a big waste of effort. So that's the approach I take. Packing cubes are awesome,
0:25:50I really like them. I know they're somewhat controversial, some people love them, some people don't.
0:25:54I've found that they are just very useful for just organizing the things that you have. Almost every suitcase is just one big cavern,
0:26:03and then tends to have a bunch of small pockets on the sides. Most people love having little pockets in the backpack
0:26:11that they use on a day-to-day basis because it's useful to organize and partition your stuff, and to be able to remember
0:26:16where something is, and to be able to take one thing out without having to mess up everything else.
0:26:21Packing cubes are great for that. If you just need a fresh pair of socks, you can just take the sock cube out,
0:26:29and you don't need to rustle through all your nice shirts and mess everything up in order to do that.
0:26:37I highly recommend packing cubes. Otherwise, that's the approach I take. If you go down this road, then apparently everyone thinks it's really weird,
0:26:46and pokes fun at you about it, but you're the last laugh because you're not tired from carrying around heavy suitcases.
0:26:53When we poke fun at you, it's more out of just amazement. How did he do that? How did you fit everything you have?
0:27:04Where did that laptop come from? Stuff like that.
0:27:07The thing that's funny is I think people often imagine things need to take more space than they actually do, or you can get away with having less stuff.
0:27:18It's not that I'm taking less stuff to take less stuff. The point is not to have a very small backpack.
0:27:26It's not to have the things that I need, but it's to bring only the essentials and to bring only the things that I need.
0:27:34It seems impossible until you try. Like I said, I think the best place to start for anyone who wants to pack less is to, every time you don't use something on a trip,
0:27:44make sure that you look at it and internalize how big that was, how heavy it was.
0:27:49Then the next time you're packing, maybe you'll be slightly more reluctant to take it with you. Ten years of doing that, and pretty quickly you take a lot less stuff.
0:27:58To bring this back around to software development a little bit, just to tie it up, a similar experience I had that I think is also a worthwhile thing to think through is,
0:28:07for years I always brought a big 15-inch laptop with me everywhere I went, because I was like, "Oh, what if on the road a server's going to go down?"
0:28:14or "I'm going to need to fix something. I'll need a big laptop."
0:28:18Then I realized, well, I could just take a 12-inch MacBook.
0:28:22More recently, I've even gotten to the point where I realized I can set up my phone to do 99% of the things that I would ever need to do on an emergency basis.
0:28:31The only thing I really can't do is build and run Xcode.
0:28:35But that's very rarely something that I'm going to have to do on an emergency basis.
0:28:41The reality there is, if on an emergency basis I absolutely needed to do something,
0:28:46I'm sure I can find a Mac somewhere for this incredibly unlikely event that I've never actually happened in 10 years of being a professional developer.
0:28:56I don't think this is really going to happen, and if it did, my source code is available to me when I'm traveling through various means,
0:29:04and I can just get something, build it, run it, and submit it, and it would be fine.
0:29:09In the same way, scale down the things that you are thinking that you're taking with you, and just be thoughtful about it.
0:29:16Actually do it, and reboot a machine from your phone to actually prove to yourself that you can do it before you rely on doing that.
0:29:23Don't be foolish about this, but also be thoughtful about it.
0:29:26I love that you've reached the point where a laptop that can fit in your jacket pocket is too big.
0:29:33It's too big. Way too big. It's so much bigger than an iPhone. If you see iPhones, they're so, so, so small.
0:29:38Oh my God. Alright. Thanks for listening everybody. Thanks for enjoying our second QA episode, and we'll see you next week.
0:29:45Bye.
0:29:46[BLANK_AUDIO]