The syntax for declaring an InlineArray in C# 12.

C# 12 – Inline arrays

Inline arrays enable you to create an array of fixed size in a struct type. Such a struct, with an inline buffer, should provide performance comparable to an unsafe fixed size buffer. Inline arrays are mosly to be used by the runtime team and some library authors to improve performance in certain scenarios. You likely…

A Flutter error message stating that property accentColor cannot be found on class ThemeData

Flutter – Fix The getter ‘accentColor’ isn’t defined for the class ‘ThemeData’

The most likely cause of this error is an update to Flutter (flutter upgrade) which led to some imcompatibility with your existing code or your project’s dependencies. The Theme.of(context).accentColor property has been deprecated since Flutter 1.17 and is entirely removed from the current version, thus the error your are seeing. What to use instead Or, if…

What does megabyte mean?

The megabyte is a unit of digital information, denoted by the symbol MB. In the International System of Units (SI), the prefix “mega” represents a multiplier of 1,000,000 (10^6). Hence, one megabyte is equivalent to one million bytes of information, and this definition is now an integral part of the International System of Quantities. However,…

An example of a tuple alias, introduced in C# 12

C# 12 – Alias any type

The using alias directive has been relaxed in C# 12 to allow aliasing any sort of type, not just named types. This means that you can now alias tuples, pointers, array types, generic types, etc. So instead of using the full structural form of a tuple, you can now alias it with a short descriptive…

Examples of serialized JSON formatted using snake case and kebab case.
|

.NET 8 – JSON serialize property names using snake case and kebab case

.NET 8 introduces several new naming policies that can be used with the System.Text.Json serializer. To name them: Let’s look at the serialized output for each of them. For this, we’re going to use a Car class with the following definition: And we are going to serialize the following object instance: Lower snake case (snake_case)…

Performance comparison of read operations between Dictionary and FrozenDictionary
|

.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…