Latest / DevQuestions with Tim Corey / 036 Should I Build a Desktop or Web Application?
Transcript
- 0:00SPEAKER_00: Welcome to the Dev Questions Podcast with Tim Corey.
- 0:03SPEAKER_00: Join us each episode as we tackle the questions you are asking about a career in software development, understanding the industry, and new technology.
- 0:12SPEAKER_00: If you're just starting out or you want to grow stronger as a developer, this is the place to get your questions answered.
- 0:19SPEAKER_00: Now, here's your host, expert developer and online educator, Tim Corey.
- 0:25SPEAKER_01: Should I build a desktop application or a web application?
- 0:29SPEAKER_01: Which one's better?
- 0:30SPEAKER_01: Is there one that I should always do over the other?
- 0:34SPEAKER_01: And why would I ever pick one?
- 0:36SPEAKER_01: So that's a great question as asked by Marco specifically, but comes up over and over again in my conversations with developers.
- 0:45SPEAKER_01: And the first thing I want to say about building an application is if you don't know the benefits and drawbacks of each, then you aren't making an informed decision.
- 0:57SPEAKER_01: And if you're not making an informed decision, you may be limiting or harming your application.
- 1:03SPEAKER_01: You may lock into the right answer, but that's not how you want to approach development.
- 1:08SPEAKER_01: So let's talk about the benefits and drawbacks of each type.
- 1:13SPEAKER_01: Let's start with desktop applications.
- 1:17SPEAKER_01: Desktop applications, I think the the key word here is power.
- 1:22SPEAKER_01: You have power when you're building your application.
- 1:26SPEAKER_01: You have full access to the file system.
- 1:28SPEAKER_01: You have full access to even manipulate the computer itself.
- 1:32SPEAKER_01: If you want to make changes on the PC or use more RAM or more storage or um more CPU time, you can do all of that because you have basically full control.
- 1:44SPEAKER_01: Now, some desktop applications don't.
- 1:47SPEAKER_01: For example, UWP operates in a sandbox.
- 1:51SPEAKER_01: It's limited to whatever you have, whatever permissions you've given it.
- 1:55SPEAKER_01: So it's a little more limited.
- 1:57SPEAKER_01: But in general, desktop applications have pretty much full reign of the computer they run on.
- 2:03SPEAKER_01: Now that may also be limited by the user's permissions.
- 2:06SPEAKER_01: You may operate under the given user permissions versus an administrative permissions.
- 2:12SPEAKER_01: But that's a lot of power.
- 2:14SPEAKER_01: There's a lot of things that you can do with that that maybe the web can't do for you.
- 2:21SPEAKER_01: This is why often, when you see heavy input operations.
- 2:27SPEAKER_01: So, for example, if you have a data entry job, typically data entry jobs are done with desktop applications, not with web applications.
- 2:36SPEAKER_01: And the reason why is because that power allows them to very quickly capture information.
- 2:43SPEAKER_01: It allows for full access to key bindings and shortcuts and all the rest.
- 2:48SPEAKER_01: And you can even store data locally in large quantities.
- 2:53SPEAKER_01: So even if the server is offline, you can have offline storage in unlimited capacity or nearly unlimited.
- 3:01SPEAKER_01: So that's that's the big benefit of a desktop application is that power.
- 3:06SPEAKER_01: You have access to the video card, you have access to the CPU, you have access to the RAM, you have access to the hard drive.
- 3:13SPEAKER_01: These are all benefits.
- 3:14SPEAKER_01: And that's really a benefit in comparison to the web applications.
- 3:20SPEAKER_01: Web applications have gotten a lot better, but they still have only limited access to the file system, meaning uploading and downloading files is still a permissions-based thing, and it's still pretty limited.
- 3:35SPEAKER_01: You don't have access to a ton of storage.
- 3:38SPEAKER_01: Yes, there's local storage and session storage, but those are volatile, meaning they can go away at any time, and you have to be prepared for that.
- 3:48SPEAKER_01: And they're usually limited in size.
- 3:51SPEAKER_01: I think browsers right now limit to about, I think it's five megabytes.
- 3:55SPEAKER_01: It might be 10 in some browsers.
- 3:57SPEAKER_01: Um, total storage space for that website.
- 4:00SPEAKER_01: Total.
- 4:00SPEAKER_01: That's it.
- 4:01SPEAKER_01: That's all you get.
- 4:02SPEAKER_01: So there's a limitation there.
- 4:04SPEAKER_01: There's a limitation when it comes to the speed you can get out of a web application because it's it's going through a number of layers before it gets to your actual CPU.
- 4:14SPEAKER_01: And so you'll find that even applications that run as desktop installed web applications like a PWA or Electron, some things like that, they're typically slower than a traditional desktop application because they're going through a number of layers and they traditionally don't have as many access rights as a full desktop application.
- 4:40SPEAKER_01: So the power really is in the web's hand, or I'm sorry, the desktop's hands.
- 4:45SPEAKER_01: Even though the web is taking more and more of that power, the web has access to some uh desktop CPU, RAM, and graphics abilities.
- 4:55SPEAKER_01: It has access to some storage abilities.
- 4:57SPEAKER_01: It's just not full.
- 4:59SPEAKER_01: Okay, so power really shifts to the desktop.
- 5:03SPEAKER_01: But the desktop drawbacks are that you have to have a more complicated installation process.
- 5:11SPEAKER_01: So when you have a desktop application, how do you get to the user?
- 5:15SPEAKER_01: Well, you can use the Windows Store possibly if you want to go that way.
- 5:20SPEAKER_01: You can create an installer and then have your desktop users install that, which relies on them to do the work and know what how to answer those prompts, like where do I install it, what are the settings for it, and so on.
- 5:35SPEAKER_01: But that's a little bit more difficult than just a website where you type in, you know, google.com and all of a sudden you have access to Google.
- 5:46SPEAKER_01: So the ease of use when it comes to installation definitely shifts towards the web because the web is just there.
- 5:55SPEAKER_01: People know how to go to a website.
- 5:58SPEAKER_01: For a desktop application, there needs to be an installation process.
- 6:01SPEAKER_01: There also needs to be an upgrade process.
- 6:04SPEAKER_01: So a new version comes out.
- 6:06SPEAKER_01: How do you give that version to the users?
- 6:09SPEAKER_01: That's not a simple process of just saying, here it is.
- 6:14SPEAKER_01: You usually have to have a prompt saying, hey, there's a new update.
- 6:17SPEAKER_01: Do you agree to this?
- 6:18SPEAKER_01: And have a UAC prompt come up and say, Do you give admin rights to install this update?
- 6:23SPEAKER_01: And you know, restart the application.
- 6:25SPEAKER_01: All those things are barriers.
- 6:28SPEAKER_01: Now we understand how to do this.
- 6:30SPEAKER_01: We have things like Microsoft Office installed, or I install Notepad.
- 6:36SPEAKER_01: I have Visual Studio installed.
- 6:38SPEAKER_01: We know how to install things, and it's not the end of the world, it's just a barrier to entry.
- 6:43SPEAKER_01: Whereas the web is just there.
- 6:46SPEAKER_01: So it's a whole lot easier when it comes to the web, when it comes to distribution.
- 6:51SPEAKER_01: So that's definitely a plus to the web and a minus for desktops.
- 6:57SPEAKER_01: Now, let's talk about ease of development.
- 7:00SPEAKER_01: This one can be a toss-up because for getting things up and running fast, the story used to be that it was really desktop applications that were the rapid application uh development project type.
- 7:16SPEAKER_01: In fact, WinForms, that's kind of its its claim to fame, is the fact that it's a rapid application development tool.
- 7:25SPEAKER_01: And that's still the case.
- 7:26SPEAKER_01: They have not slowed down when it comes to Winforms.
- 7:30SPEAKER_01: In about 30 seconds, you can create a new project, drag a couple of uh text boxes and a button on there, and away you go.
- 7:37SPEAKER_01: You got something running.
- 7:38SPEAKER_01: Web applications are a little more complex than that.
- 7:42SPEAKER_01: And so, yes, it does take a little more time to develop a web application, but that gap is slowly closing.
- 7:51SPEAKER_01: Things like Blazor Server make it a whole lot faster to get something up and running.
- 7:56SPEAKER_01: Instead of creating, like with MVC, where you create your views and your controllers and have a communication system back and forth, and it's a little complex.
- 8:06SPEAKER_01: With Razor, I'm sorry, the Blazor Server, it's pretty much like the wind forms of the web.
- 8:13SPEAKER_01: It's pretty easy to get those two things working, the back end and the front end.
- 8:18SPEAKER_01: So web is coming up in that, but desktop is still somewhat easier to get up and running fast, which also means that it takes less time to develop an application.
- 8:32SPEAKER_01: In general, a desktop application will be faster than a web application because a web application has a lot more moving parts.
- 8:41SPEAKER_01: With a desktop application, if you want a little animation, no problem, just add it.
- 8:45SPEAKER_01: With a web application, if you want a little animation, sure, there's a JavaScript library for that.
- 8:50SPEAKER_01: Now I need to import that library.
- 8:52SPEAKER_01: I need to get to interopt with my Blazor server, and I need to make sure that it's on this page, it's a little more complex.
- 8:59SPEAKER_01: Um, so in that way, I think that desktop apps are still a little easier.
- 9:04SPEAKER_01: Now, this does depend on your skill.
- 9:09SPEAKER_01: Because if you are super skilled in the web and you're not in desktop, this is not gonna be the true for you.
- 9:15SPEAKER_01: You're gonna say, no, no, no.
- 9:16SPEAKER_01: If I want a rapid application development, I do web.
- 9:19SPEAKER_01: And that's because of your skills.
- 9:20SPEAKER_01: So with all skills being equal, though, equally skilled in both desktop and web, usually you'll find that desktop applications are a little faster to create.
- 9:32SPEAKER_01: Now, let's talk about hosting.
- 9:35SPEAKER_01: The benefits of a desktop application are that you host your application on the client's machine.
- 9:42SPEAKER_01: There's not really a scale issue here.
- 9:45SPEAKER_01: The only scale issue is your back end.
- 9:48SPEAKER_01: Whether it be you know an API that you're hosting on or something of that nature, that would be the only scaling issue you have.
- 9:56SPEAKER_01: Now, if you have a complete uh self-contained application on the user's machine, then there is no scale issues.
- 10:03SPEAKER_01: For example, Notepad Plus Plus.
- 10:05SPEAKER_01: I use that all the time.
- 10:07SPEAKER_01: Well, there's no scaling issues when it comes to Notepad.
- 10:10SPEAKER_01: It's a desktop application that could be installed on one billion machines, and we could all use it at the exact same time, and there'd be no problems because it's on your own machine.
- 10:23SPEAKER_01: Your machine is using your resources to get your Notepad to work.
- 10:29SPEAKER_01: Web applications are not that way.
- 10:32SPEAKER_01: Typically, your web application is going to be centralized.
- 10:37SPEAKER_01: And in fact, you're gonna have to have some pieces that are centralized.
- 10:41SPEAKER_01: Your web server is a centralized piece.
- 10:44SPEAKER_01: Now you may say, well, Tim, I want to do a client-side application.
- 10:48SPEAKER_01: So Angular, React, Vue, uh, Blazor, WebAssembly.
- 10:53SPEAKER_01: These are all client-side frameworks where you download your application to the client side and run it there.
- 11:01SPEAKER_01: And yes, there is a big benefit there because you are allowing your users to take some of the load off of your server.
- 11:10SPEAKER_01: Therefore, you can scale much, much larger.
- 11:12SPEAKER_01: But there still is that centralized server that provides those files.
- 11:17SPEAKER_01: And because you're downloading every time you're downloading your full application, that causes a lot of extra download, which is an issue.
- 11:28SPEAKER_01: Now there can be caching, you can have um some caching in place or a CDN in place to help with that, but that's still an issue to address.
- 11:38SPEAKER_01: You don't hear about um the Microsoft Word going down or Notepad going down because a new version came out or because it was mentioned in the news.
- 11:50SPEAKER_01: But you hear all the time about a website that's mentioned in the news and it crashes because so many people try to get to it.
- 11:58SPEAKER_01: That the demand was so high that it just crashed the website.
- 12:02SPEAKER_01: Demand is a big deal when it comes to web applications, and it's something to think about.
- 12:07SPEAKER_01: And the the hardest part here is that in general, you won't need to worry about demand.
- 12:12SPEAKER_01: I know it sounds uh opposite, but in general, you don't have that massive drive.
- 12:18SPEAKER_01: It's just those peak small times that you have that issue.
- 12:22SPEAKER_01: You may have 50 users maximum per day, and then you're mentioned on um you know the news or on Google's homepage or something like that, and all of a sudden you have 5 million people in a day.
- 12:36SPEAKER_01: You don't have the capacity to always have um be ready for 5 million necessarily, and yet normally you're a sub a super small website, and so that's a thing to work through.
- 12:49SPEAKER_01: How do you do that?
- 12:50SPEAKER_01: So there's a lot more complexity when it comes to hosting and maintaining your web application compared to your desktop application.
- 13:01SPEAKER_01: So these are the benefits and drawbacks, and I want you to come at the situation of the question, which should I build a desktop application or a web application, knowing these benefits and drawbacks and not being biased.
- 13:17SPEAKER_01: Because the more you can be open-minded about the benefits and the the negatives of each, and the more you can be honest about them, the better decision you can make about your application.
- 13:33SPEAKER_01: Because your application has needs.
- 13:46SPEAKER_01: And to try and do a one size fits all just hurts your application.
- 13:53SPEAKER_01: Look honestly at your application and say, these are the needs of my application, these are the things that I need to make sure my application can do.
- 14:01SPEAKER_01: And when you know what your application needs, you can compare that against the benefits and drawbacks of desktop applications and web applications and figure out which one fits better.
- 14:13SPEAKER_01: And maybe it's a mixture.
- 14:15SPEAKER_01: Maybe you do a little bit of both.
- 14:17SPEAKER_01: Um, in our uh Timco Retail Manager series, we're building an application that is a WPF desktop application supported by an API.
- 14:28SPEAKER_01: It's already a mix of web and desktop.
- 14:30SPEAKER_01: But then we're gonna add Blazor WebAssembly because there's a need for that to get to the users, but our desktop applications work better for our checkout system that is controlled by the company.
- 14:44SPEAKER_01: So there's a benefit and a drawback for each kind, and there's a room for both user interfaces inside of our ecosystem.
- 14:52SPEAKER_01: So we make the best choice for the situation.
- 14:56SPEAKER_01: We don't just say, I like web applications or I like desktop applications.
- 15:02SPEAKER_01: Now, when you're making a decision about desktop versus web, there is some gray area here.
- 15:09SPEAKER_01: Some applications really need to be one or the other.
- 15:12SPEAKER_01: So if you're doing, for example, I did an application for a college where we took an image from a camera.
- 15:20SPEAKER_01: The camera took the picture automatically through C sharp, and then we captured that image, we renamed the image, and we create an ID card and sent that to a printer.
- 15:31SPEAKER_01: Well, that's not a web application.
- 15:33SPEAKER_01: That really can't be a web application.
- 15:35SPEAKER_01: I'm dealing with a printer talking to it, I'm dealing with a camera and talking to it.
- 15:40SPEAKER_01: I'm dealing with a database.
- 15:42SPEAKER_01: So of those three, the only thing I can really do web-based is talk to the database.
- 15:47SPEAKER_01: The other two need to have a physical installation that is on the desktop so it can talk directly to those USB devices.
- 15:57SPEAKER_01: So in those cases, that it made it simple.
- 16:00SPEAKER_01: Here was a desktop application.
- 16:02SPEAKER_01: If you want to push out an application to thousands and thousands of users, they're gonna casually look at your stuff and might jump on board and do something.
- 16:15SPEAKER_01: You probably want a web application, at least first, because you're not gonna get somebody to install something before they know that they need it.
- 16:23SPEAKER_01: So, web application.
- 16:24SPEAKER_01: There's a lot of gray areas where a desktop application could work, or a web application could work.
- 16:30SPEAKER_01: And this is where another key part that people often overlook is what are the strengths and weaknesses of your team.
- 16:38SPEAKER_01: Just like the strengths and weaknesses of a desktop or a web application, you need to know what the strengths and weaknesses of a team are.
- 16:47SPEAKER_01: When I worked at one job, the um we had a web-based application that was all web forms, and we needed to move it forward into the future.
- 16:57SPEAKER_01: And so we decided to go to Web API and Angular for the front end.
- 17:02SPEAKER_01: But my team was not strong in JavaScript.
- 17:06SPEAKER_01: And so, because of that, we made choices.
- 17:09SPEAKER_01: Even though we had an Angular friend, I made a really simple Angular friend.
- 17:15SPEAKER_01: We didn't do anything complex in there, it was just controllers, and pretty much that was it.
- 17:21SPEAKER_01: There was there was not a lot of in-depth, detailed um pieces and parts and things all over.
- 17:28SPEAKER_01: I try to keep it really, really simple because it was important that I evaluated my team and realized what their skills were and what their skills were not.
- 17:38SPEAKER_01: And that made an important uh point when it came to deciding how to build our application.
- 17:46SPEAKER_01: So, to answer this question kind of a long way around, you need to know what the benefits and drawbacks of both are.
- 17:53SPEAKER_01: You need to know what the benefits and drawbacks of your team's skills are, and you need to know what your application needs are.
- 18:01SPEAKER_01: And based upon all of those different pieces of data, it will become increasingly clear what the best choice for you is.
- 18:11SPEAKER_01: And based upon that, you can make the best decision for your application, for your team, and in general, for your customers as well.
- 18:20SPEAKER_01: So hopefully that answers your questions.
- 18:22SPEAKER_01: I know that there's not a clear answer here, and that's intentional.
- 18:27SPEAKER_01: Um, whenever you ask a question of a developer, if you don't get the answer, it depends.
- 18:31SPEAKER_01: They're probably not being straight with you.
- 18:34SPEAKER_01: So, yes, it depends.
- 18:36SPEAKER_01: Okay, but you need to know the the reasons or how to think through this so that you make an informed decision.
- 18:44SPEAKER_01: So thanks for answering the question, Marco.
- 18:46SPEAKER_01: If you'd like your question answered, either use the form of the podcast page at IamTimCorey.com or you can comment on the YouTube video.
- 18:54SPEAKER_01: Now, if you found this episode helpful, I'd appreciate it if you'd share with your social network.
- 18:59SPEAKER_01: Thanks for listening.
- 19:00SPEAKER_01: As always, I am Tim Corey.
- 19:02SPEAKER_00: Thank you for joining us for this episode of Dev Questions.
- 19:05SPEAKER_00: Tim is committed to making it easier for you to become a developer.
- 19:08SPEAKER_00: If you would like to help make more content like this possible, please like, subscribe, rate, and share Dev Questions.
- 19:15SPEAKER_00: You can also send your questions to questions at Iamtimcorey.com.
- 19:20SPEAKER_00: Until next time, remember, you are too smart and your time too valuable to waste it making all the mistakes Tim did.
- 19:28SPEAKER_00: When you're ready to learn to think and code like a professional developer, head over to IamtimCorey.com and enroll in a course.