C# 14's 'params' for Collections: Say Goodbye to Arrays!

Ever used the params keyword in C#? If you write C# code regularly, you probably reach for it whenever you need to pass a variable number of arguments to a method. It’s super handy, letting you skip the tedious step of creating arrays first. But until now, there’s been a limitation: params only worked with arrays. This meant every call created memory allocations with potential performance costs. The good news? C# 14 is changing the game by extending params to work with modern collections like IEnumerable<T>, Span<T>, and more. ...

June 21, 2025 · 6 min · 1194 words

Array vs ArrayList in C#: Understanding the Key Differences

Arrays vs ArrayLists in C#: Which One Should You Pick? If you’ve been coding in C# for a while, you’ve probably used both arrays and ArrayLists. Let’s break down the real differences between these two collection types and talk about when you might want to use each one. The Basics: What’s the Difference? An array in C# is pretty straightforward, it’s a fixed-size collection where all elements must be the same type. Once you create it, that’s it, the size is locked in. ...

June 20, 2025 · 4 min · 657 words

Dictionary vs HashTable in C#: Key Differences and Best Practices

Introduction If you’ve been working with C# for any length of time, you’ve probably needed to store data as key-value pairs. The two main contenders for this job are Dictionary<TKey, TValue> and HashTable. They both do similar things, but there are some crucial differences that might make you choose one over the other. In this post, I’ll walk you through both options so you can make the right choice for your project. Trust me, this decision matters more than you might think! ...

June 20, 2025 · 5 min · 883 words