IEnumerable<T>interface has numerous extension methods associated with it, including a number that return a single element if a match occurs, or return the default value for the type if that fails:
ElementAtOrDefault. These methods create two code smells due to the nature of .NET’s type system. As of version 1.5.0, Succinc<T> offers alternatives to these methods that overcome those smells.
Continue reading “Using Succinc<T> to overcome IEnumerable code smells”
- You are still happily using inheritance,
if/elsecollections, have methods that are hundreds of lines long etc. You possibly haven’t heard of TDD or DI. There’s a very good chance that, if this is the case, you’ll likely never see this post as you likely do not read blogs by other developers.
- You do read around, you are aware of why inheritance,
switch, deeply nested and long code blocks are frowned upon by the well-informed. You are at least aware of TDD, even if you haven’t quite started using it yet. Also, you are likely aware of the growing excitement around functional languages and perhaps look on with envy at some of their features. If this is you, you possibly already use SHOF’s without knowing it.
During early 2013, I was indulging myself in a “thought experiment” language: Lapsang. One such thought experiment was around the idea of whether a language could sensibly support the concept of not throwing exceptions for petty, unexceptional, reasons. Continue reading “Introducing Succinc<T> — functional additions to C#”