Добавлено: 22 ноября 2023 г.
There is a simple solution just around the corner
Null as a return value is so easy to implement, but it brings many problems. So people make mistakes. That is part of being human. Sometimes it turns out to be a billion-dollar mistake.
“I call it my billion-dollar mistake. It was the invention of the null reference in 1965.” — Tony Hoare — British Turing Award winner Tony Hoare at a conference...
далее...
Добавлено: 26 октября 2023 г.
Entity Framework Core Features in 2023
EF Core 2023 has rolled out some pretty cool stuff, and I’m excited to share it with you. So, grab a cup of coffee, and let’s get started!
1. Cosmos DB Provider Improvements
Azure Cosmos DB and EF Core are like two peas in a pod, but with EF Core 8.0, they’re even cozier. Enhanced support means tighter integration and smoother operations.
Code Example:
var cosmosOptionsBuilder = new DbContextOptionsBuilder<MyContext>()
...
далее...
Добавлено: 11 сентября 2023 г.
When crafting elegant and scalable software in C#, a keen understanding of Dependency Injection (DI) is more than a luxury — it’s a necessity. It’s a design pattern that underpins many modern .NET applications, providing a solid foundation for managing dependencies between classes. In its most basic form, Dependency Injection promotes loose coupling, simplifying the maintenance and testing of applications.
This article will explore the best practices for Dependency Injection in...
далее...
Добавлено: 24 июля 2023 г.
Small changes, Big wins: How little tweaks make your code easy on the eye
When we think of clean code, our brain jumps to SOLID principles, short classes, no comments, and good design patterns. While all of those apply, they are useless without the simplest thing of all: good naming.
I can spend 2 days writing a service that respects all SOLID principles, unit-testable, easy to change, but understood by nobody by...
далее...
Добавлено: 5 июня 2023 г.
Juan Alberto España Garcia
In this section, we’ll explore the world of unit testing in C# and .NET, learn what unit testing is, why it’s important, and the landscape of testing frameworks and tools available to developers.
What is Unit Testing?
Unit testing is the process of verifying the correctness of individual units of code, typically methods or functions, in isolation from the rest of the system. This ensures that each unit performs as expected and...
далее...
Добавлено: 2 июня 2023 г.
Cyclomatic complexity is a code metric (integer value 1 or more) used to measure how complex a function/method is.
It does not take into account lines of code but instead considers complexity to be the distinct paths through a function.
Microsoft defines cyclomatic complexity as measuring the amount of decision logic in a source code function.
Cyclomatic complexity: if if if if if else …
Because cyclomatic complexity concerns itself with decision branches through...
далее...
Добавлено: 31 мая 2023 г.
LINQ (Language Integrated Query) is a powerful querying tool in .NET that allows you to perform complex queries directly in C#.
The System.Linq.Expressions namespace is a part of LINQ that provides classes, interfaces, enumerations and structures to work with lambda expressions and expression trees.
Lambda expressions are a way to create anonymous methods inline where they’re used, usually with the purpose of manipulating data. For example, let’s say you have a list...
далее...
Добавлено: 29 апреля 2023 г.
JavaScript is a versatile programming language that allows developers to create dynamic and interactive web applications. One common task in web development is to refresh or reload a web page, either to update its content or to trigger certain actions.
In this article, we will explore different ways to refresh a page in JavaScript and understand the pros and cons of each approach.
Why refresh a page in JavaScript?
Refreshing a web page...
далее...
Добавлено: 5 апреля 2023 г.
Juan Alberto España Garcia
Learn the key differences between abstract classes and interfaces in C# programming, and understand when to use each one effectively.
In object-oriented programming, abstract classes and interfaces serve as blueprints for creating objects in C#. While they have some similarities, they each have unique features that make them suited for different situations.
In this article, we will take a deep dive into abstract classes and interfaces in C#, examining the nuances and...
далее...
Добавлено: 3 апреля 2023 г.
Clean code is a set of programming practices that emphasize the readability, maintainability, and simplicity of code. Writing clean code is essential because it helps developers to understand and modify code more efficiently, which can save time and reduce the risk of introducing errors.
Benefits of Clean Code:
Readability: Clean code is easy to read and understand, making it easier to maintain, debug, and update. When code is...
далее...