This is something I’ve mentioned in my recent AOP talks, and I think it’s worthy of a wider audience as it can be very useful to anyone who’s obsessed with performance as I am.
In C#, you can use the object/collection initialization syntax like this:
After reading this old post by Don Syme, I really liked the idea of wrapping the result of any computation into an option type to signify success and failure cases and stop subsequent computations on the first failure. It’s neat but I wanted to tweak a couple of things to make it more useful:
By default, arithmetic operations and conversions in C# execute in an unchecked context, you can use the checked keyword to switch a block of code to the checked context so that any arithmetic overflow that occurs in that block of code will cause…
View more presentations from Yan Cui
If you’re reading this post, you probably know about F#’s Units of Measure already, it’s very useful when working with real-world units and adds extra safety to code that needs to work with and convert from one unit to another.