<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/sources/andrewlock/best-of/2024" -->

---
title: Best .NET Escapades posts of 2024 | daily.dev
description: The most upvoted .NET Escapades posts of 2024, curated by the daily.dev community.
canonical: https://daily.dev/sources/andrewlock/best-of/2024
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:url: https://daily.dev/sources/andrewlock/best-of/2024
og:type: website
og:site_name: daily.dev
og:title: Best .NET Escapades posts of 2024 | daily.dev
og:description: The most upvoted .NET Escapades posts of 2024, curated by the daily.dev community.
og:image: https://media.daily.dev/image/upload/s--VAY5ToZt--/f_auto/v1724209435/public/daily.dev%20-%20open%20graph
---

# Best of .NET Escapades — 2024

1. 1  
[](/posts/understanding-c-8-default-interface-methods-raqyowuyw "Understanding C# 8 default interface methods")  
[![andrewlock's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/74ebd66cf7e840b6b29913eae3da9189)](/sources/[source]/best-of/[year])  
8m read time • Jan 30, 2024  
### Understanding C# 8 default interface methods  
This post explains the concept of C# 8 default interface methods, how they work, and their benefits. It also highlights some issues and considerations when using default interface methods.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/a5b84466f5445926b8bf45c933bfd8cd?_a=AQAEufR)  
67  
2
2. 2  
[](/posts/an-introduction-to-primary-constructors-in-c-12-gd7h0oklf "An introduction to primary constructors in C#12")  
[![andrewlock's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/74ebd66cf7e840b6b29913eae3da9189)](/sources/[source]/best-of/[year])  
7m read time • May 14, 2024  
### An introduction to primary constructors in C#12  
This post introduces the primary constructors feature in C#12 and discusses its use in reducing duplication in classes. It explains two approaches to use primary constructors and how they work behind the scenes. The post also mentions the advantages and disadvantages of using primary constructors.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/6d2df7071cf945ed9e163ada6c7124a9?_a=AQAEuiZ)  
42  
3
3. 3  
[](/posts/replacing-exceptions-as-flow-control-with-the-result-pattern-6k6kclg35 "Replacing Exceptions-as-flow-control with the result pattern")  
[![andrewlock's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/74ebd66cf7e840b6b29913eae3da9189)](/sources/[source]/best-of/[year])  
15m read time • Oct 08, 2024  
### Replacing Exceptions-as-flow-control with the result pattern  
The post discusses the inefficiencies of using exceptions for flow control in .NET applications and introduces the result pattern as a more efficient alternative. It starts with a simple API implementation without error handling, adds exceptions for common error cases, and then replaces these exceptions with a Result<T> type to demonstrate the result pattern. However, the initial implementation of the result pattern is cumbersome, leading to the next post in the series where the pattern will be simplified further.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/b0a9a5be15234bc9da165e18a412224c?_a=AQAEuiZ)  
22  
1
4. 4  
[](/posts/is-the-result-pattern-worth-it--k6rf6vzri "Is the result pattern worth it?")  
[![andrewlock's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/74ebd66cf7e840b6b29913eae3da9189)](/sources/[source]/best-of/[year])  
10m read time • Oct 29, 2024  
### Is the result pattern worth it?  
The post concludes a series discussing the use of the result pattern over exceptions for flow control in C#. It highlights how LINQ can simplify nested lambda methods, improving readability. The discussion contrasts heavy and lightweight versions of the result pattern with perspectives from industry experts. It addresses the argument for substituting exceptions with the result pattern and presents LINQ as a readable but complex alternative for error handling. The post suggests that while LINQ can simplify code, developers must evaluate whether its complexity is justified in their specific use cases.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/8685d2b00f063af13959aa668a9ed2cd?_a=AQAEuiZ)  
19  
1
5. 5  
[](/posts/combining-multiple-docker-images-into-a-multi-arch-image-i4ltgeo9u "Combining multiple docker images into a multi-arch image")  
[![andrewlock's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/74ebd66cf7e840b6b29913eae3da9189)](/sources/[source]/best-of/[year])  
15m read time • Aug 13, 2024  
### Combining multiple docker images into a multi-arch image  
Learn how to create multi-arch Docker images by combining separate x64 and arm46 images into a single Docker image. This guide details both simple and advanced methods using Docker's buildx and manifest commands, and discusses the importance of provenance attestation for securing your software supply chain.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/f5353f8b906fe987c7b6621e6c6d153d?_a=AQAEuiZ)  
18
6. 6  
[](/posts/introducing-collection-expressions-in-c-12-5cul2fi5g "Introducing collection expressions in C#12")  
[![andrewlock's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/74ebd66cf7e840b6b29913eae3da9189)](/sources/[source]/best-of/[year])  
10m read time • Jun 11, 2024  
### Introducing collection expressions in C#12  
This post introduces collection expressions in C#12\. It explains the code generated when using collection expressions and how they work compared to collection initializers. The post highlights the benefits of collection expressions, such as a unified syntax for different collection types, performance improvements, and additional features. It also mentions the use of spread elements to build collections from existing collections.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/8c86e70c362eb5767a4fad17a22b327f?_a=AQAEuiZ)  
18
7. 7  
[](/posts/safety-and-simplicity-with-linq-dsebwks5e "Safety and simplicity with LINQ")  
[![andrewlock's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/74ebd66cf7e840b6b29913eae3da9189)](/sources/[source]/best-of/[year])  
14m read time • Oct 15, 2024  
### Safety and simplicity with LINQ  
Explore how LINQ's query syntax can be utilized with Result<T> in C# to improve code readability and maintainability. Discover how methods like Select and SelectMany can be implemented for the Result<T> type, transforming cumbersome error-handling code into more intuitive and elegant constructs. The post also discusses the caveats of overusing the result pattern and emphasizes the importance of applying such patterns judiciously.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/f5d8b8ab9ec26d506fd178cc379665a0?_a=AQAEuiZ)  
15
8. 8  
[](/posts/thoughts-about-primary-constructors-3-pros-and-5-cons-xgl3lsawv "Thoughts about primary constructors: 3 pros and 5 cons")  
[![andrewlock's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/74ebd66cf7e840b6b29913eae3da9189)](/sources/[source]/best-of/[year])  
11m read time • May 21, 2024  
### Thoughts about primary constructors: 3 pros and 5 cons  
Learn about the main approaches to primary constructors in C#, the best use cases for them, and some potential issues and limitations to be aware of.

+1  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/e6160ea6025d4b84ace1c021beab6869?_a=AQAEuiZ)  
14  
1
9. 9  
[](/posts/exploring-the-generated-code-t-span-t-and-immutable-collections-dmxslqsn3 "Exploring the generated code: T[], Span<T>, and Immutable collections")  
[![andrewlock's profile](https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/74ebd66cf7e840b6b29913eae3da9189)](/sources/[source]/best-of/[year])  
13m read time • Jun 25, 2024  
### Exploring the generated code: T\[\], Span<T>, and Immutable collections  
The post delves into the code generated by C#12 for collection expressions, specifically focusing on arrays, Span<T>, ReadOnlySpan<T>, and immutable collections. It highlights the compiler optimizations for primitive types in arrays, the use of direct memory copying for ReadOnlySpan<T>, and the inline array approach for Span<T>. The post also touches on the creation of immutable collections from readonly spans for efficiency.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/0d3fc8cc57b121eee02c2cebb31dc48f?_a=AQAEuiZ)  
12

[See all .NET Escapades archives](/sources/andrewlock/best-of)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","@id":"https://daily.dev/sources/andrewlock/best-of/2024#page","url":"https://daily.dev/sources/andrewlock/best-of/2024","name":"Best .NET Escapades Posts of 2024","description":"The most upvoted .NET Escapades posts of 2024, curated by the daily.dev community.","isPartOf":{"@type":"WebSite","url":"https://daily.dev"}},{"@type":"ItemList","@id":"https://daily.dev/sources/andrewlock/best-of/2024#items","numberOfItems":9,"itemListElement":[{"@type":"ListItem","position":1,"url":"https://daily.dev/posts/understanding-c-8-default-interface-methods-raqyowuyw","name":"Understanding C# 8 default interface methods"},{"@type":"ListItem","position":2,"url":"https://daily.dev/posts/an-introduction-to-primary-constructors-in-c-12-gd7h0oklf","name":"An introduction to primary constructors in C#12"},{"@type":"ListItem","position":3,"url":"https://daily.dev/posts/replacing-exceptions-as-flow-control-with-the-result-pattern-6k6kclg35","name":"Replacing Exceptions-as-flow-control with the result pattern"},{"@type":"ListItem","position":4,"url":"https://daily.dev/posts/is-the-result-pattern-worth-it--k6rf6vzri","name":"Is the result pattern worth it?"},{"@type":"ListItem","position":5,"url":"https://daily.dev/posts/combining-multiple-docker-images-into-a-multi-arch-image-i4ltgeo9u","name":"Combining multiple docker images into a multi-arch image"},{"@type":"ListItem","position":6,"url":"https://daily.dev/posts/introducing-collection-expressions-in-c-12-5cul2fi5g","name":"Introducing collection expressions in C#12"},{"@type":"ListItem","position":7,"url":"https://daily.dev/posts/safety-and-simplicity-with-linq-dsebwks5e","name":"Safety and simplicity with LINQ"},{"@type":"ListItem","position":8,"url":"https://daily.dev/posts/thoughts-about-primary-constructors-3-pros-and-5-cons-xgl3lsawv","name":"Thoughts about primary constructors: 3 pros and 5 cons"},{"@type":"ListItem","position":9,"url":"https://daily.dev/posts/exploring-the-generated-code-t-span-t-and-immutable-collections-dmxslqsn3","name":"Exploring the generated code: T[], Span\u003cT\u003e, and Immutable collections"}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sources","item":"https://daily.dev/sources"},{"@type":"ListItem","position":3,"name":".NET Escapades","item":"https://daily.dev/sources/andrewlock"},{"@type":"ListItem","position":4,"name":"Best of","item":"https://daily.dev/sources/andrewlock/best-of"},{"@type":"ListItem","position":5,"name":"2024"}]}]}
```

