Monday, October 30, 2023

Debate: Should I use only .NET LTS for production?

.NET is a popular and versatile framework for developing applications across multiple platforms. It offers two types of releases: Long Term Support (LTS) and Current. LTS releases are supported for at least three years and receive only critical fixes and security updates. Current releases are supported for three months after the next release and receive new features and improvements.

Many developers wonder whether they should use only .NET LTS for production environments, or whether they can benefit from using the non-LTS version. In this post, I will present some arguments for and against each option, and share my personal opinion on the matter.

Why use only .NET LTS for production?

The main reason to use only .NET LTS for production is stability. LTS releases are more tested and reliable than Current releases, and have fewer bugs and compatibility issues. They also have a longer support cycle, which means you don't have to worry about upgrading your applications frequently or losing security patches. Using only .NET LTS for production can reduce the risk of downtime, errors, and vulnerabilities in your applications.

Another reason to use only .NET LTS for production is simplicity. By sticking to one release, you can avoid the hassle of managing multiple versions of .NET on your servers and machines. You can also reduce the complexity of your code base, as you don't have to deal with breaking changes or deprecated features that may occur in Current releases. Using only .NET LTS for production can make your development and deployment process easier and more consistent.

Why use non-LTS .NET for production?

The main reason to use non-LTS .NET for production is innovation. Current releases offer new features and improvements that can enhance the functionality and performance of your applications. They also keep up with the latest trends and standards in the industry, such as cloud-native development, microservices, and machine learning. Using non-LTS .NET for production can give you access to cutting-edge technologies and capabilities that can make your applications more competitive and attractive.

Another reason to use non-LTS .NET for production is flexibility. By using the latest release, you can take advantage of the latest bug fixes and optimizations that may not be available in LTS releases. You can also experiment with new features and APIs that may not be stable or mature enough for LTS releases. Using non-LTS .NET for production can give you more freedom and control over your development choices and outcomes.

My opinion

In my opinion, there is no definitive answer to whether you should use only .NET LTS for production or not. It depends on your project requirements, preferences, and resources. Some factors that may influence your decision are:

  • The size and complexity of your application
  • The frequency and urgency of your updates
  • The availability and cost of your resources
  • The expectations and needs of your users
  • The level of risk and uncertainty you are willing to accept

Personally, I prefer to use a hybrid approach, where I use both .NET LTS and non-LTS for production, depending on the situation. For example, I may use .NET LTS for mission-critical applications that require high stability and security, and non-LTS for experimental or non-essential applications that require high innovation and flexibility. This way, I can balance the trade-offs between each option and get the best of both worlds.

What do you think?

I hope this post has given you some insights into the debate of whether you should use only .NET LTS for production or not. I would love to hear your thoughts and opinions on this topic. Please leave a comment below or contact me via email or social media. Thank you for reading!

Friday, October 27, 2023

Shiny new .NET 8 features

.NET 8 is the latest version (at the time of writing) of the popular cross-platform framework for building web, desktop, mobile, and IoT applications. It comes with many new features and improvements that make development easier, faster, and more enjoyable. Here are some of the highlights:

  • Source generators: These are a new kind of compiler plugin that can generate code at compile time based on your project's source code. They can be used for various purposes, such as generating serialization code, logging code, or boilerplate code. Source generators can improve performance, reduce dependencies, and simplify maintenance.
  • Minimal APIs: These are a new way of creating web APIs in ASP.NET Core with minimal code and configuration. You can use simple lambda expressions to define your endpoints, parameters, and responses. Minimal APIs are ideal for building microservices, prototypes, or simple CRUD APIs.
  • C# 10: The latest version of the C# language brings many new features and enhancements, such as record structs, global using directives, file-scoped namespaces, constant interpolated strings, and improved pattern matching. C# 10 also supports nullable reference types by default, which can help you avoid null-related bugs.
  • Blazor Desktop: This is a new way of building desktop applications with Blazor, the framework that lets you use C# and HTML to create interactive web UIs. Blazor Desktop allows you to host a Blazor web app inside a native desktop window using WebView2 or Electron. You can access native features such as menus, dialogs, and notifications through interop services.
  • Hot reload: This is a new feature that enables you to make changes to your code while your app is running, without losing the app state. You can use hot reload for any kind of .NET app, whether it's a web app, a desktop app, or a mobile app. Hot reload can boost your productivity and shorten your feedback loop.

These are just some of the shiny new .NET 8 features that you can try out today. To learn more about .NET 8 and how to get started, visit https://dotnet.microsoft.com/download/dotnet/8.0.