Blog for Junior Developers C#/.NET

Sunday, November 03, 2024

I mentioned to you in the previous article that we can create many different types of applications in C#. From console applications through desktop and mobile applications, to web applications. When creating a new project, we only need to indicate in which framework we want to create our application and a basic template is created right away, in which we can further develop our application. In today's article, I will describe the most frequently created applications and show you how to run them in Visual Studio.

you-can-create-such-applications-in-csharp-dotnet.jpg


1. Console applications


Console applications are the simplest programs that run on the command line. They are often used to test and experiment with code. Typically, if you are learning programming, this is the type of application you will start with. We don't have a pretty user interface here, but this type of application is perfect for learning and consolidating the programming language itself.


2. Desktop applications - Windows Forms


Another type of application that I recommend getting to know, at least at a basic level, are desktop applications. These are applications that run on a computer and already have a graphical user interface. You can run such applications directly on your operating system. However, if we create such applications for a client, then we usually also create an installer and the client can install such an application on their computer. Such applications, although they are less popular now, I used to write a lot of them in my programming career. You can use the basic Windows Forms framework here.


3. Desktop applications - WPF


In addition to Windows Forms, desktop applications can be created in the more advanced WPF framework, Windows Presentation Foundation. It is, so to speak, a successor to Windows Forms, and if you want to write desktop applications, I recommend that you focus on WPF with the MVVM (Model View ViewModel) approach. We have greater possibilities here, we can create a better user interface and write cleaner, more easily extensible and testable code. I have also written a lot of such applications and there is still demand for them. Currently, I am still developing such applications for several clients. It is true that there is less work in such typical desktop applications than in web applications, but on the other hand, there is also less competition on the market, so it can be a good niche and a good choice to start with. In addition to Windows Forms and WPF, desktop applications can also be created in C# in UWP, but I do not recommend this path. Here, as I mentioned, I would focus on WPF.


4. Mobile applications - Xamarin


Another type of application that we can create in C# is the application that runs on mobile devices such as smartphones and tablets. In C# we can use Xamarin framework to create mobile applications for different platforms such as iOS or Android. So, if you want to create applications for phones, then you can also do it in C#.


5. Mobile applications - .NET MAUI


When it comes to mobile applications, Xamarin has also been replaced by the new .NET MAUI for some time now, so if you are just starting out and would like to move towards mobile applications, I would rather recommend you start with .NET MAUI right away, which is a new Microsoft solution.


6. Web applications - ASP.NET Core MVC


We move on to the most popular applications at the moment, i.e. web applications that run in a web browser. When it comes to the .NET platform and the C# language, we have quite a lot of possibilities here. If you would like to create complete web applications in C#, it is worth choosing the ASP.NET Core MVC framework, which allows you to create applications from A to Z. You can also create both the entire frontend of the application and the backend of the application. For the frontend, we use Razor (i.e. a combination of HTML and C#), while the backend is created in pure C#. This is also the most common choice for web application developers. There are many applications on the market that were created in ASP.NET and ASP.NET Core, so there are many job offers here and I highly recommend this choice. In my career, I have created and continue to create the most such applications.


7. Web applications - ASP.NET Core Web API


When it comes to web applications, we also cannot forget about creating Web API, which you can also create in the previously mentioned ASP.NET Core, but here we are specifically interested in the ASP.NET Core Web API template. In fact, MVC and Web API are based on almost the same code, and if you learn MVC, you will also find yourself in Web API and the same the other way around. Web API is most often used by client applications, i.e. some SPA (Single Page Application) type applications and other mobile and desktop devices. In Web API, you can create the entire backend of the application and make it available to the client application, in which only the frontend is created. These types of applications are also very popular at the moment and there are also a lot of job offers for programmers who create Web API.


8. SPA web applications - Blazor


When it comes to web applications, we also cannot forget about Blazor, which allows us to create the so-called Single Page Application, i.e. it is a framework that works like Angular, React, or Vue. However, here we have a big advantage, because we can create it in C# itself. So we do not have to learn JavaScript additionally, we can create such an application in C# in Blazor. Although Blazor is a fairly new solution, I have already managed to create several applications for clients in it, so for now I am satisfied and I will be happy to share my experiences with this framework with you in the future.


9. Services - Windows Service and ASP.NET Core


In addition to standard applications, we can also create services that do not have a user interface, but can run on your operating system in the background and perform some tasks. You can create such applications in Windows Service and ASP.NET Core.


10. Libraries - Class Library


In C# we can also create our own libraries. We can also create some code, some function, then we wrap it in a library and we can use it in our other projects or applications. To create such a library, you need to choose the project type - Class Library.


11. Computer games - Unity


Finally, the Unity engine, in which we can create computer games in C#. However, this path has never interested me, so I don't have much experience here and I can't help you much here. However, if you yourself would like to go this route and create computer games, you also have this option in C#.


Practice


So as you can see, we have a really large selection of applications and a lot of possibilities here. It is worth emphasizing that the core of all these applications is created in C#, so if you master the C# language itself, you will also be able to create any application of this type.

If you want to create an application in C#, you will need to install a development environment, the most common choice is Visual Studio in the Community version. During installation, you need to indicate which components should be installed. So, if some type of application is not visible in Visual Studio, you probably need to go back to the installer, select these components and install them.


Which path to choose?


Currently, if you are starting to learn, I would recommend you to choose one of 2 paths, depending on what you will enjoy the most. The first option is creating Desktop Applications, here I suggest choosing WPF (but also with basic knowledge of Windows Forms) and the second option, and this is the path that I would recommend to you the most at the moment, which is writing Web Applications, specifically in ASP.NET Core (also with at least basic knowledge of ASP.NET MVC). If you learn ASP.NET Core MVC and Web API well, you will be able to write complete advanced web applications. There are the most job offers in ASP.NET Core, so in my opinion it is the most future-proof path. However, whichever path you choose, you will certainly not complain about the lack of job offers.

If you liked this article, be sure to join my community. Sign up for the free newsletter, where every week I share valuable materials, especially regarding C# and the .NET platform (free subscription - newsletter).

Author of the article:
Kazimierz Szpin

KAZIMIERZ SZPIN
Software Developer C#/.NET, Freelancer. Specializes in ASP.NET Core, ASP.NET MVC, ASP.NET Web API, Blazor, WPF and Windows Forms.
Author of the blog CodeWithKazik.com

Previous article - Want to Become a Programmer? Find Out Why C#/.NET Is the Best Choice for Beginners
Next article - How I Learned to Program? My Story
Dodaj komentarz
© Copyright 2024 CodeWithKazik.com. All rights reserved. Privacy policy.
Design by Code With Kazik and Modest Programmer.