A code snippet illustrating the usage of tuples in C# to return multiple values

Tuples in C#: Too simple or too complex?

Too simple to be a complex type, too complex to be a simple attribute. That’s what tuples in C# are. Perfect for returning multiple values from a method. No need to create a class (or even a record). Easy to read. Take a look at the image post and see how to use it. Do you use tuples, or do you prefer DTOs/records? 👉 Adapted from my original post on LinkedIn . ...

July 20, 2025 · 1 min · 72 words · Eduardo Potumati
An example showing implicit operator conversions in C# with potential pitfalls

Implicit Operators in C#: Convenience vs. Clarity

In C#, implicit operators enable automatic type conversions without the need for explicit casting. This functionality not only enhances code readability but also boosts development agility while safeguarding against runtime conversion exceptions. However, be careful. While implicit conversions offer convenience, excessive usage can potentially compromise code clarity. It’s essential to tread carefully as an overreliance on implicit conversions may obscure the precise moments and locations where conversions occur. 👉 Adapted from my original post on LinkedIn . ...

March 22, 2025 · 1 min · 77 words · Eduardo Potumati
A diagram or code snippet illustrating the Dependency Inversion Principle

Dependency Inversion (D) in SOLID: Why Is It So Important?

Dependency Inversion (D) in SOLID: Why Is It So Important? The Dependency Inversion Principle (D) reminds us that “high-level modules should not depend on low-level modules; both should depend on abstractions.” This means clients (code consuming functionalities) should rely on interfaces or abstractions, not concrete implementations. This practice reduces coupling, simplifies changes, and makes code more testable. For example, instead of directly coupling a notification service to a concrete class like EmailSender, use an interface such as IEmailSender. This allows you to easily swap implementations (e.g., SMTPClient, API service, message queue, etc) without modifying the client. ...

December 15, 2024 · 1 min · 124 words · Eduardo Potumati
A code comparison showing a foreach loop converted into a LINQ expression

Convert a foreach Loop to LINQ

Convert a foreach loop to LINQ LINQ transforms a query into a first-class language construct in C#. It can reduce the amount of code, enhance readability, and enable similar query expression patterns across different data sources. 👉 Adapted from my original post on LinkedIn .

November 15, 2024 · 1 min · 45 words · Eduardo Potumati
Code snippet demonstrating pattern matching to protect against nulls in C#

Pattern Matching in C#: Getting Protected from Nulls

Pattern Matching: Get Protected from Nulls C# pattern matching provides a substantially more concise syntax for testing expressions and taking decisive action when an expression matches. By leveraging these structural features, you can gracefully bundle type checks, variable declarations, and null validations into a single, highly readable statement-significantly reducing boilerplate code and the risk of unexpected NullReferenceExceptions. 👉 Adapted from my original post on LinkedIn .

May 15, 2024 · 1 min · 66 words · Eduardo Potumati