C# Tip: IEnumerable vs ICollection, and why it matters
When working with Lists in C#, you are working on a data structure that implements both ICollection and IEnumerable. What’s the difference between ICollection and IEnumerable? Why should you care about them, especially when exposing functionalities to external clients? Continue readingC# Tip: 2 ways to use custom equality rules in a HashSet
With HashSet, you can get a list of different items in a performant way. What if you need a custom way to define when two objects are equal? Continue readingC# Tip: Mark a class as Sealed to prevent subclasses creation
The sealed keyword is often ignored, yet it can be important to define a proper class design. Continue readingC# Tip: Path.Combine and Path.Join are similar but way different.
When composing the path to a folder or file location, thePath
class can come in handy. Path.Join
and Path.Combine
may look similar, but their behavior differ in an unexpected way.
Continue reading
C# Tip: IFormattable interface, to define different string formats for the same object
Same object, different string representations. How do we achieve it in a standardised way? Continue readingC# Tip: ObservableCollection - a data type to intercept changes to the collection
ObservableCollection<T>
is a data type that allows you to react when an item is added or removed from the collection. Let’s learn more!
Continue reading