Добавлено: 14 сентября 2023 г.
Interfaces are at the heart of the “composition-over-inheritance” paradigm — let’s see what that means!
As you probably know, C# is a statically typed language. And as such, it is very helpful with type-checking and safe data conversions. Your IDE most likely knows when you’re feeding a variable of the wrong type somewhere and warns you, or even refuses to compile. However, you can actually take this flow checking one step...
далее...
Добавлено: 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...
далее...
Добавлено: 6 сентября 2023 г.
To write files with C#, you have to know how to do it. The basics aren’t rocket science. There are a few lines of code you need to know. But writing and reading files with C# is something every beginning C# developer should be able to do.
If you want to know how you can read the contents of a file using C#, you can read the article Reading Files With...
далее...
Добавлено: 5 сентября 2023 г.
Simplifying Data Transport in C#.
In modern C# development, data transport objects (DTOs) play a crucial role in exchanging information between different layers of an application, such as between a client and a server, and traditionally, developers have used classes to define DTOs, which involves writing boilerplate code for properties, constructors, comparison methods, and string representations.
With the introduction of C# 9.0, a new and more efficient alternative has emerged: records.
In this...
далее...
Добавлено: 18 августа 2023 г.
C# Data Structures Handbook!
Every decision in programming is a silent influencer of performance and clarity. In C#, one such vital choice is selecting the right data structure.
Data structures are foundational pillars. These structures are where data lives, breathes, and interacts, determining the efficiency and readability of our code. But, as with all tools, they must be used judiciously. The beauty of C# is its rich repertoire of data structures, each...
далее...
Добавлено: 15 августа 2023 г.
Whether you have an app with just a few users or millions of users per day, like Agoda, improving the user experience by optimizing application performance is always crucial.
In the case of very high-traffic websites in the cloud, this optimization can translate into significant cost savings by reducing the number of required app instances. During Agoda’s transition from ASP.NET 4.7.2 to ASP.NET Core 3.1, our primary focus was on achieving...
далее...
Добавлено: 25 июля 2023 г.
Web scraping is a technique that scrapes information from other online sources. This is a great way to combine different sources into one source. To create a web scraper you need a few things: online sources, some code that can access the internet, and a GUI. In this article, I am going to show you how web scraping using C# works.
Goals Of This Article
In this article, I will show you...
далее...
Добавлено: 25 июля 2023 г.
Unleashing the Power of Meta-Programming: A Comprehensive Guide to C# Reflection
Reflection, put simply, is a mechanism provided by the .NET framework that allows a running program to examine and manipulate itself. It’s like a coding mirror that gives your application the ability to look at its own structure, inspect its assemblies, types, and members, and even modify them-all at runtime.
The concept might seem abstract and complicated at first, but once...
далее...
Добавлено: 25 июля 2023 г.
Bending the Clean Architecture Principles
Async await meme
Introduction
Imagine you’re a chef in a kitchen full of ingredients, some fresh, some a bit past their prime, all thanks to Microsoft’s “We never throw anything away” policy. This is what programming asynchronously in C# is like — an overwhelming mix of new and old syntax all in one big pot.
This pot can turn to be a big ball of code mud, you could...
далее...
Добавлено: 23 июля 2023 г.
Unlocking Resilience and Transient-fault-handling in Your C# Code
In an ideal world, every operation we execute, every API we call, and every database we query, would always work flawlessly. Unfortunately, we live in a world where network outages, server overloads, and unexpected exceptions are common realities. To maintain robust, resilient applications, we must anticipate these mishaps. Enter retry logic.
Hope for the best, prepare for the worst.
What is Retry Logic
Retry logic is...
далее...