After months of studying, I have also decided to develop primarily in F#. I will still need to use C# for UI coding, and in other areas where F# support is found wanting; however, F# has turned out to be such an amazing language that I can not justify not using it as much as humanly possible.
To put it simply and succinctly, F# is capable of doing things that are entirely impractical--or even impossible--to do in C#.
Consider the following:
let inline getSuccessChance chanceBias sourceValue targetValue =
let chance = sourceValue / (sourceValue + targetValue)
chance + ((1.0 - chance) * chanceBias)
let getHitChance = getSuccessChance 0.25
let getJumpChance = getSuccessChance 0.50
let getClimbChance = getSuccessChance 0.33
let getBlindChance = getSuccessChance 0.15
I now have four functions that accept a source value (to hit, to jump, etc) and a target value (to evade, jump difficulty, etc), returning the chance of success. The equivalent in C# would be:
double getSuccessChance(double chanceBias, double sourceValue, double targetValue)Aside from being four times as long (and full of useless and obvious information, like the data types and names of the variables being re-routed to getSuccessChance), the C# version is less efficient. The former F# code, when compiled, will actually inline the chanceBias values into the original function, meaning there will be only one function call, and the 0.25, 0.50, etc, will not need to be passed in memory to another function.
{
float chance = sourceValue / (sourceValue + targetValue);
return chance + ((1.0 - chance) * chanceBias);
}
double getHitChance(double sourceValue, double targetValue)
{
return getSuccessChance(0.25, sourceValue, targetValue);
}
double getJumpChance(double sourceValue, double targetValue)
{
return getSuccessChance(0.50, sourceValue, targetValue);
}
double getClimbChance(double sourceValue, double targetValue)
{
return getSuccessChance(0.33, sourceValue, targetValue);
}
double getBlindChance(double sourceValue, double targetValue)
{
return getSuccessChance(0.15, sourceValue, targetValue);
}
Note that the above code is not what will be used, but it serves as an ample demonstration of F#'s superiority over C#. In a quarter of the code, F# created a set of immensely more readable (and thus maintainable) functions, which will consume less server resources to execute.
I'll post more information as it becomes available. Between work, the kids, and diablo 3, my time has been at a premium.