ForEvolve

A piece of mind...

Potential const issue in a plugin-based system

cosnt vs readonly

Potential const issue in a plugin-based system

In this article, I’m following up on my comment on Dave Callan’s post about the difference between const and readonly in C# (embedded at the end). By simplifying my thoughts for a LinkedIn comment, I realized I was not clear enough, so I took the time to write this blog and showcase a complete working scenario, which is more complex and real-life-like than what I initially wrote.

Consider this setup:

Continue reading...

Architecting ASP.NET Core Applications

Unveiling the Third Edition

Architecting ASP.NET Core Applications

After hundreds of hours of work, a new team, and two new tech reviewers, I’m delighted to announce the release of the third edition of Architecting ASP.NET Core Applications, a unique guide for constructing resilient ASP.NET Core web applications.

But that was not the title of the first two editions?!? That’s correct. After thoughtful consideration, the book has a new title! Why? All editions were never only about design patterns, which is even more true for the 3rd edition, which expands even more than before into architectural styles and application organization, offering diverse strategies for structuring ASP.NET Core applications. Of course, I wanted to keep the essence of the first two editions, so here’s the subtitle that brings that continuity: An Atypical Design Patterns Guide for .NET 8, C# 12, and Beyond.

Have you noticed the and Beyond suffix? Well, that’s because the book is good not only for .NET 8 and C# 12, but you’ll also be able to leverage its content for future versions, and we wanted to clarify this.

Let’s start with the updated Table of Content:

Continue reading...

Introduction to C# variables

A beginner guide to programming with .NET 6 and C#

Introduction to C# variables

In this article, we explore variables. What they are, how to create them, and how to use them. Variables are one of the most important elements of a program, making it dynamic. Of course, there is more to variables than what we can cover in a single article; this is only the beginning.

This article is part of a learn programming series where you need no prior knowledge of programming. If you want to learn how to program and want to learn it using .NET/C#, this is the right place. I suggest reading the whole series in order, starting with Creating your first .NET/C# program, but that’s not mandatory.

Continue reading...

Creating your first .NET/C# program

A beginner guide to programming with .NET 6 and C#

Creating your first .NET/C# program

This article is the first of a learn programming series where you need no prior knowledge of programming. If you want to learn how to program and want to learn it using .NET/C#, this is the right place.

The first step of coding is to create a program. The program could be a simple console or a more complex application (web, mobile, game, etc.). To get started, we create a console application, which is the simplest type of program that we can make. The good news is that most of the topics covered in this series are reusable across all types of programs.

Furthermore, .NET and C# allow you to create a wide variety of programs and target most markets, from web to mobile to smart TVs. I believe this is a good choice of technology to start with.

Beforehand, let’s look at the prerequisites.

Continue reading...

Implementing Microservices Architectures

An Atypical ASP.NET Core 6 Design Patterns Guide

Implementing Microservices Architectures

This article aims to give you an overview of the concepts surrounding microservices and event-driven architecture, which should help you make informed decisions about whether you should go for a microservices architecture or not.

The following topics will be covered:

  • What are microservices?
  • An introduction to event-driven architecture

This article is an excerpt from my book, An Atypical ASP.NET Core 6 Design Patterns Guide ().

Continue reading...

Book: An Atypical ASP.NET Core 6 Design Patterns Guide

What's new in the second edition?

Book: An Atypical ASP.NET Core 6 Design Patterns Guide

An Atypical ASP.NET Core 6 Design Patterns Guide — Second Edition was released a few months ago and now includes many changes and improvements, including new C# 10 and .NET 6 features. The second edition is still a journey where we explore architectural techniques together, covering many subjects to learn to think patterns and design. We are learning not just about patterns but also architectural principles with a strong focus on the SOLID principles, taming the perceived complexity of such tenets throughout the book.

We also cover automated testing and use tests as consumers of our code in multiple code samples. Automated testing is key to modern development approaches like continuous integration and DevOps. The strong focus on dependency injection is also still there, making sure readers learn techniques that will help them build ASP.NET Core 6+ applications.

Last but not least, the book still covers numerous design patterns, from multiple of the famous Gang of Four (GoF) patterns to application-level patterns like layering, microservices, and vertical slice architecture.

Continue reading...

Boolean algebra laws

A beginner guide to programming with .NET 5 and C#

Boolean algebra laws

This article explores multiple Boolean algebra laws in a programmer-oriented way, leaving the mathematic notation aside. Those laws can be beneficial when working with boolean logic to simplify complex conditions. This article is very light in explanation and exposes the laws using C#. Don’t worry, I’m not recycling myself as a math teacher.

This article is part of a learn programming series where you need no prior knowledge of programming. If you want to learn how to program and want to learn it using .NET/C#, this is the right place. I suggest reading the whole series in order, starting with Creating your first .NET/C# program, but that’s not mandatory.

This article is part of a sub-series, starting with Introduction to Boolean algebra and logical operators. It is not mandatory to read all articles in order, but I strongly recommend it, especially if you are a beginner. If you are already reading the whole series in order, please discard this word of advice.

Continue reading...

Using the switch selection statement to simplify conditional statements blocks

A beginner guide to programming with .NET 5 and C#

Using the switch selection statement to simplify conditional statements blocks

This article explores how to simplify certain complex conditional blocks by introducing the switch statement. The switch keyword is very standard in programming languages. We use it to compare a variable with many values.

Please note that we are not covering switch expressions in this article.

This article is part of a learn programming series where you need no prior knowledge of programming. If you want to learn how to program and want to learn it using .NET/C#, this is the right place. I suggest reading the whole series in order, starting with Creating your first .NET/C# program, but that’s not mandatory.

This article is part of a sub-series, starting with Introduction to Boolean algebra and logical operators. It is not mandatory to read all articles in order, but I strongly recommend it, especially if you are a beginner. If you are already reading the whole series in order, please discard this word of advice.

Continue reading...

Using if-else selection statements to write conditional code blocks

A beginner guide to programming with .NET 5 and C#

Using if-else selection statements to write conditional code blocks

In this article, we are exploring conditional execution flows. What is a code path? What is a conditional? What’s an if statement? These are the subject that we cover here. As part of the beginner journey, we focus on the if-else selection statements LEGO® block, laying down the foundation for more advanced use-cases.

In this article, we are exploring conditional execution flows. What is a code path? How will we do that? These are the subject that we cover here. As part of the beginner journey, we focus on the if-else selection statements LEGO® block, laying down the foundation for more advanced use-cases.

This article is part of a learn programming series where you need no prior knowledge of programming. If you want to learn how to program and want to learn it using .NET/C#, this is the right place. I suggest reading the whole series in order, starting with Creating your first .NET/C# program, but that’s not mandatory.

This article is part of a sub-series, starting with Introduction to Boolean algebra and logical operators. It is not mandatory to read all articles in order, but I strongly recommend it, especially if you are a beginner. If you are already reading the whole series in order, please discard this word of advice.

Continue reading...

Introduction to Boolean algebra and logical operators

A beginner guide to programming with .NET 5 and C#

Introduction to Boolean algebra and logical operators

In this article, I introduce you to Boolean algebra, a branch of algebra that evaluates the value of a condition to true or false. This is a fundamental part of programming that you can’t escape, and you will use this until the end of your programmer career and maybe even beyond that point.

The article is not focusing on mathematical applications and representations but on programming. The objective is to give you the knowledge you need for the next article of the series.

This article is part of a learn programming series where you need no prior knowledge of programming. If you want to learn how to program and want to learn it using .NET/C#, this is the right place. I suggest reading the whole series in order, starting with Creating your first .NET/C# program, but that’s not mandatory.

This article is the first part of a sub-series showcasing the following articles:

Continue reading...