In C#, when you define an event in your class, e.g.:
There’re a number of built-in literal types in F#, and one of the cool things you can do is to get the byte or byte array representation of a char or string using the ‘B’ suffix, the result is the same as Encoding.ASCII.GetBytes:
In C#, you define an empty class, struct, or interface like this:
So how do you define an empty type in F#?
Well, whenever you define a new class in F#, the compiler infers the class and end…
I stumbled upon this interesting question on StackOverflow today, Jon Harrop’s answer mentions a significant overhead in adding and iterating over a SortedDictionary and Map compared to using simple arrays.
Generic type parameters were introduced in C# 2.0, and they gave us the ability to write code that works against any type that matches a set of constraints and remove the need to create type-specific overloads, e.g.:
Note: don’t forget to check out the Benchmarks page to see the latest round up of binary and JSON serializers.
A little while ago I put together a quick performance test comparing the BCL’s BinaryFormatter with that of Marc…
It’s taken days to put my new dev machine together, but totally worth it!
My old Core2Duo had a meagre Window Experience Index (WEI) of 4.5: