Implicit Operators – Clean Code Secrets Or Buggy Nightmare?
Implicit operators in C# are a feature that can make our code more readable and expressive. But beware! Misuse can backfire and cause a great deal of headaches!
Implicit operators in C# are a feature that can make our code more readable and expressive. But beware! Misuse can backfire and cause a great deal of headaches!
Exceptions and exception handling are a core part of C# and many other programming languages. But what If we didn't need to be throwing them?
If you're newer to C# or programming in general, you may have used an iterator and not even realized it. Iterators can be a performant and effective tool that we have access to as .NET developers that allow us to traverse collections of data. Because one of the requirements of an iterator is that it must implement the IEnumerable interface, the results of an iterator can only be enumerated over. For example, you could use the results of an iterator in a foreach loop but you could not directly index into the iterator results (like you could an array) without some additional steps. Another requirement of iterators is that they use a special keyword called "yield" so that they can yield and return the individual elements that are to be provided to the caller of the iterator. In a nutshell,…
New to C# and looking to understand more about the IEnumerable interface? Check out this article for a crash course on getting started with C# IEnumerable!