Latest / DevQuestions with Tim Corey / 293. Should I Create a PWA or Native Application?
Transcript
- 0:00SPEAKER_01: Your customers are not all on the same platform.
- 0:02SPEAKER_01: Some are on Windows, some are on Mac, some are on Linux.
- 0:05SPEAKER_01: Some want to access your app from the iPhone or an Android device.
- 0:09SPEAKER_01: So how do you support all these options, especially as a solo developer or a small company?
- 0:14SPEAKER_01: Should you build native apps for a few of the platforms?
- 0:18SPEAKER_01: Should you just build a progressive web app that can be deployed anywhere?
- 0:21SPEAKER_01: Or should you try to find something in the middle like Flutter or Uno?
- 0:25SPEAKER_01: Let's talk about it in today's episode of DevQuestions.
- 0:36SPEAKER_00: Welcome to the DevQuesti podcast with Tim Corey.
- 0:40SPEAKER_01: Software development is more than just writing code.
- 0:43SPEAKER_01: So let's talk about the rest of it.
- 0:45SPEAKER_01: Specifically, let's talk about cross-platform application architectural decisions.
- 0:51SPEAKER_01: So the first answer to this question you probably anticipate already, but I'm going to give it to you because I want to make sure you realize that it depends.
- 1:01SPEAKER_01: It really depends on your situation.
- 1:03SPEAKER_01: There's a reason why all of these options and more exist.
- 1:08SPEAKER_01: Because they fill different needs.
- 1:11SPEAKER_01: It's like saying, which vehicle do I need?
- 1:13SPEAKER_01: Well, maybe a car is fine for you, maybe a motorcycle is fine for you, or a moped, or even just a bicycle.
- 1:19SPEAKER_01: But maybe you need a truck, or maybe you need an even larger vehicle, like a dump truck or something else.
- 1:26SPEAKER_01: It all depends on your scenario.
- 1:28SPEAKER_01: So saying one size fits all just doesn't work.
- 1:32SPEAKER_01: Even with the things that do grow, go cross-platform, you know, one code base, whether it be a progressive web app or PWA, or things like Uno or Flutter or others, just because they deployed at every platform doesn't mean they're the only choice or necessarily even the best choice for every scenario.
- 1:51SPEAKER_01: It really does depend, which is what your job is as a software developer, to make the right choice for your situation.
- 1:59SPEAKER_01: So let's talk about the things to consider when you're looking at what should I build for my application.
- 2:08SPEAKER_01: The first one is going to be something that frustrates me a lot because I think people put the wrong weights on the wrong areas.
- 2:16SPEAKER_01: And that is development performance versus runtime performance.
- 2:21SPEAKER_01: Too often, developers will focus on the development performance when it's going to cost runtime performance and cost their users time every time they run the application.
- 2:35SPEAKER_01: But then they'll also focus so much on runtime performance where it doesn't matter.
- 2:42SPEAKER_01: So a very simple general thing here is when you're using entity framework poorly, so it's not performing well.
- 2:51SPEAKER_01: Entity framework can be very performant, but only if you optimize it well.
- 2:56SPEAKER_01: But oftentimes people say, well, it works, so therefore it's good enough.
- 3:00SPEAKER_01: And I know that I've written entity framework.
- 3:02SPEAKER_01: I don't understand databases, but I know entity framework, therefore it's good enough.
- 3:06SPEAKER_01: They're optimizing for development performance.
- 3:09SPEAKER_01: But then they'll stress out about the fact that they added two strings together once.
- 3:14SPEAKER_01: And that, you know, changing that over to something else may actually lose you performance because, yes, it's not an efficient operation, but at a one or two or even a dozen scale, you just want to add those two strings together rather than trying to do something like a string builder or something else.
- 3:32SPEAKER_01: You've optimized the tiny thing and ignored the massive thing.
- 3:37SPEAKER_01: So be very careful here on development performance versus runtime performance.
- 3:42SPEAKER_01: But there is something to be said for evaluating both.
- 3:46SPEAKER_01: For instance, when you look at building an application per platform, or maybe a few.
- 3:53SPEAKER_01: So maybe you're gonna build a Swift application for iPhone and Mac, and then you'll build a Java application for the Android, and you'll build something in.NET for the Windows platform and a couple others.
- 4:09SPEAKER_01: Well, that could be okay, but now you're building the same thing three times.
- 4:14SPEAKER_01: Now, if you're building against an API, that's just a UI that you're building on those different platforms.
- 4:19SPEAKER_01: That might be okay.
- 4:20SPEAKER_01: But you have to think through what is the time and effort to support three different platforms or three different uh languages as well.
- 4:29SPEAKER_01: So you need to think that through.
- 4:31SPEAKER_01: And then you compare that to what it's gonna take to do just one language or just one, if it's a progressive web application, just one application.
- 4:40SPEAKER_01: Maybe it's a longer build time because one application is harder to do, and it's there's gonna be some uh issues with making sure everything can work.
- 4:50SPEAKER_01: But if you get that to work, well, that may be faster in development compared to maintaining three different code bases with three different languages.
- 5:01SPEAKER_01: And it's going to also make sure make your team smaller because your team doesn't have to have a Java expert and a Swift expert and a.NET expert, and then people who can do more than one thing.
- 5:16SPEAKER_01: You just have to have a team that can do one thing well.
- 5:20SPEAKER_01: So that's development performance.
- 5:22SPEAKER_01: But what's then the runtime performance that you are potentially giving up?
- 5:29SPEAKER_01: So a progressive web application will not run as fast as a native application in most cases.
- 5:36SPEAKER_01: So what you need to think through is what's the performance difference?
- 5:42SPEAKER_01: Because if your application could launch in sub-one second timeframes on a native application, but might take three to five seconds in the progressive web app or something else that's the central application, well, that might be a big deal.
- 6:00SPEAKER_01: It might be something that's a a make or break for your application.
- 6:04SPEAKER_01: But if we're talking about sub-one second performance either way, and it's just that the desktop application is maybe 50 milliseconds versus 500 milliseconds, well, that's not as big of a deal, and that might be an okay trade-off, where the the savings in your dev performance make it worth it to give up that 450 milliseconds.
- 6:29SPEAKER_01: So it does depend on your dev performance, what it's gonna take, what it's gonna cost, if you can even do it, and then also what does that do to your runtime performance and comparing those?
- 6:41SPEAKER_01: So that's the first thing to consider.
- 6:43SPEAKER_01: The next is kind of goes along with this, but it's your budget, both your time budget and your monetary budget.
- 6:50SPEAKER_01: So if your management comes to your team and says, listen, I need you to build this in three months, well, that's gonna change what you can do compared to if they said you have one year or get done as soon as you can.
- 7:06SPEAKER_01: And the same is true with money.
- 7:08SPEAKER_01: Hey, we're gonna we only have one person working.
- 7:11SPEAKER_01: Maybe you're a solo developer, and you have to make money at some point with you need to eat.
- 7:16SPEAKER_01: Well, you need you have a short amount of time to get that out, and you don't have a lot of budget.
- 7:22SPEAKER_01: If your team has only enough budget for six months worth of work, or only enough to bring in one extra developer, then it's going to help make that decision for you.
- 7:34SPEAKER_01: You need to think about the costs associated.
- 7:38SPEAKER_01: Because a progressive web app or an Uno app or a uh a Flutter app will be cheaper than trying to build native apps on more than one platform.
- 7:51SPEAKER_01: It just will because you have it takes longer to build multiple plat on multiple platforms with multiple different build systems and all the rest.
- 8:01SPEAKER_01: But if you can afford it, that might be the way to go.
- 8:05SPEAKER_01: But you have to think about that up front.
- 8:08SPEAKER_01: Number three is can this easily be done with a central system like a PWA?
- 8:15SPEAKER_01: Because if you can't do it with a PWA, there's nothing to consider.
- 8:19SPEAKER_01: So you might be saying, well, I love to do a PWA because it's you know, right at once and deployed everywhere.
- 8:26SPEAKER_01: But then you try and build it and you're like, ooh, I can't do these things.
- 8:30SPEAKER_01: And maybe it's just not possible.
- 8:31SPEAKER_01: And that's where you may move up to the next level, like an Uno or a Flutter or something else, where you could say, hey, you know what?
- 8:39SPEAKER_01: I couldn't do the PWA, but I could do it with these, and maybe it takes a little bit more time than just a PWA.
- 8:45SPEAKER_01: But since I can't do it in a PWA, well, this is the cheapest option.
- 8:50SPEAKER_01: And so you need to figure out what you can and can't do.
- 8:53SPEAKER_01: And with that, this is where prototyping comes in.
- 8:56SPEAKER_01: I would highly encourage you to create small prototypes to test out the various features you're gonna want to make sure they're even possible on whatever platform you're considering.
- 9:08SPEAKER_01: That's number three.
- 9:09SPEAKER_01: Number four is are there other alternatives?
- 9:13SPEAKER_01: Too often people get stuck in the one option or even the two option system where they know about one or two ways of doing things, and that's all they consider.
- 9:24SPEAKER_01: I would encourage you to learn more early up front about whether other options might be available.
- 9:31SPEAKER_01: There is a whole spectrum of different ways to build applications.
- 9:36SPEAKER_01: The same application could be built dozens of different ways.
- 9:40SPEAKER_01: And that's a strength of software development.
- 9:42SPEAKER_01: It's not a weakness.
- 9:44SPEAKER_01: It's a weakness of developers when they don't know those options and so they can't then recommend, which is also why I say to continue to learn, continue to grow.
- 9:55SPEAKER_01: Because if you don't, then you don't know that maybe a Docker container for whatever reason is going to work for us.
- 10:02SPEAKER_01: But you, if you only know that's a possibility, then you don't know to suggest it.
- 10:07SPEAKER_01: You don't know that that could save you time, it could save you money, it could save you uh performance, it could make your customers' lives better and so much other.
- 10:16SPEAKER_01: So you need to make sure that you know about other alternatives, know how they work, and know if they're right for you or not.
- 10:24SPEAKER_01: Don't just get locked in the box of what you've been doing for the past 20 years or 10 years or five years or even the past year.
- 10:31SPEAKER_01: Things have changed.
- 10:33SPEAKER_01: Make sure you know how to evaluate alternatives.
- 10:37SPEAKER_01: Number five, what will the customer experience be for one versus the other?
- 10:43SPEAKER_01: So we talk about customer performance or runtime performance, but also there's the idea of customer experience in general.
- 10:51SPEAKER_01: I look at this from what Microsoft has done.
- 10:55SPEAKER_01: And Microsoft has made some stumbles recently when it comes to Windows and Office and other products.
- 11:02SPEAKER_01: But if we look at the customer experience, I think it kind of highlights why you should evaluate that more than it seemingly Microsoft has done.
- 11:11SPEAKER_01: For example, if we look at Outlook, if you've used Outlook recently or in the past few years, I'm sorry because Outlook has continued to go down in quality.
- 11:24SPEAKER_01: But one of the reasons why is it was a native app.
- 11:29SPEAKER_01: It was written natively, and they have switched it over to a web app or a web view app so that it's written once and deployed to multiple locations.
- 11:41SPEAKER_01: And the experience shows because there are things you just can't do.
- 11:47SPEAKER_01: A simple one that drives me nuts is I used to be able to say, when I close Outlook, empty out my trash can.
- 11:54SPEAKER_01: I can't do that anymore.
- 11:56SPEAKER_01: It's not an option.
- 11:57SPEAKER_01: And that's just one of dozens of little things that are a problem, besides the fact we're talking about performance as well.
- 12:06SPEAKER_01: This is separate from performance.
- 12:07SPEAKER_01: This is just how things work.
- 12:09SPEAKER_01: So evaluate what your customer experience will be for one versus the other, one versus the different options, and make sure that you land on something that your customers will be happy with.
- 12:21SPEAKER_01: Because if you have an application that's deployed to every app, every platform, but no one wants to use it, is it really valuable?
- 12:30SPEAKER_01: Or would it be better to deploy to one platform and be loved?
- 12:35SPEAKER_01: So make sure that you think about your customer, not just your development experience.
- 12:40SPEAKER_01: It comes back to that development experience versus runtime experience or the customer experience.
- 12:46SPEAKER_01: You need to evaluate both.
- 12:48SPEAKER_01: Just make sure that you don't put too much weight on the development experience and you don't forget about the customer experience.
- 12:56SPEAKER_01: Number six, you have to evaluate what your team can actually do.
- 13:01SPEAKER_01: There's lots of options out there.
- 13:04SPEAKER_01: But you don't want to go down the path of options that your team is just not familiar with, not comfortable with, not prepared for.
- 13:13SPEAKER_01: I have seen teams who have said, you know what, this new language is the right thing to do.
- 13:19SPEAKER_01: It's so much better of a language.
- 13:21SPEAKER_01: But none of the team could build in that language.
- 13:24SPEAKER_01: So what do they do?
- 13:25SPEAKER_01: They make their entire team into junior developers, really.
- 13:30SPEAKER_01: Now, a developer who's developed in one language can switch over to another and not just be an instant junior, but it does take time.
- 13:39SPEAKER_01: It takes time to learn beyond the syntax.
- 13:43SPEAKER_01: It takes time to learn the nuances and the depth and understand the trade-offs of doing different things different ways.
- 13:50SPEAKER_01: And you eliminate all of that when you just choose a new language or a new system, besides the fact that it's not just the language itself, it's all the tooling around it.
- 14:01SPEAKER_01: Maybe you're a.NET developer and you're used to Visual Studio, you're used to your shortcuts, you're used to your build systems, your way of doing things, you're used to NuGet, you understand the process in GitHub actions and so many other things.
- 14:13SPEAKER_01: And then you switch over to some type of like React, where it's JavaScript and NPM, and you've got a different deploy process, and you've got everything is different.
- 14:23SPEAKER_01: All your tooling is different.
- 14:25SPEAKER_01: Well, that slows you down, which you can do, but that's one of the trade-offs you're gonna make in choosing something outside of what your team is comfortable with.
- 14:37SPEAKER_01: I'm not saying don't do it.
- 14:38SPEAKER_01: I'm saying to evaluate it, to make sure your team can actually do it, do it well, and put that into your cost is the transition from one to another if you are gonna choose something new or different.
- 14:53SPEAKER_01: Everything is a trade-off.
- 14:56SPEAKER_01: You just need to make sure you're making the right trade-offs based upon as much information as possible.
- 15:03SPEAKER_01: The more information you have, the better you can make a decision around it.
- 15:07SPEAKER_01: Just make sure that you are looking at the right information, you're making the right evaluations, you're thinking of the customer, not just the development experience, and that you're evaluating what's possible, what's best, and making your choices off of that.
- 15:23SPEAKER_01: All right, thanks for listening.
- 15:24SPEAKER_01: And as always, I am Tim Corey.
- 15:27SPEAKER_00: Thank you for joining us for this episode of Dev Questions.
- 15:30SPEAKER_00: When you're ready to learn to think and code like a professional developer, head over to imtimcore.com and enroll in a course.