| | |

.NET Performance: ToList vs ToArray

.NET 9 brings significant improvements to LINQ’s ToArray method, both in terms of speed, as well as memory allocation. To achieve this, the new implementation makes use of new runtime features such as InlineArray and ArrayPool to significantly reduce memory allocations and improve speed, especially when dealing with an IEnumerable<T> of unknown length. If you’re curious about…

An example of using C# 13 params with a ReadOnlySpan.
| | |

C# 13: Use params collections with any recognized collection type

The params modifier in C# has traditionally been associated with array types, allowing methods to accept a variable number of arguments. However, starting with C# 13, you can now use params collections with a variety of collection types, broadening its applicability and making your code even more versatile. Supported collection types The params modifier now…

| | |

How to switch to C# 13

While trying out C# 13 features, it’s possible you might come across errors similar to these: Feature is not available in C# 12.0. Please use language version 13.0 or later. or Error CS8652: The feature ‘<feature name>’ is currently in Preview and unsupported. To use Preview features, use the ‘preview’ language version. There are two…

|

C# language version history

C# 1.0 Introduced with .NET Framework 1.0 in January 2022, C# 1.0 established the foundation of the language with basic object-oriented programming features, including classes, structs, interfaces, events, properties, and delegates. The language had the following goals: C# 2.0 Introcudec in 2005, this version brought significant enhancements such as generics for type-safe data structures, anonymous…

|

.NET 8 performance: Dictionary vs. FrozenDictionary

With .NET 8 we are introduced to a new dictionary type which improves the performance of read operations. The catch: you are not allowed to make any changes to the keys and values once the collection is created. This type is particularly useful for collections that are populated on first use and then persisted for…

| |

Python: Detect text language using Azure AI Language service

The Azure AI Language service provides developers with an API for common text analysis techniques, such as the ability to detect language from text, perform sentiment analysis, key phrase extraction, and named entity recognition and linking. Provisioning The first step in analyzing text with Azure AI Language is provisioning a Language service resource in Azure….

|

How to: Detect text language using Azure AI Language service

The Azure AI Language service provides developers with an API for common text analysis techniques, such as the ability to detect language from text, perform sentiment analysis, key phrase extraction, and named entity recognition and linking. Provisioning The first step in analyzing text with Azure AI Language is provisioning a Language service resource in Azure….