For F# developer who also has C# background, you might feel like Visual Studio F# editor is very primitive comparing to C# editor. You won’t have a way to collapse a function (or method in C#) or type (or class) like in C#. Using indentation to create code blocks does reduce noise from the code, but a lot of whitespaces can still be hard to read sometime. And of course we don’t have ReSharper for F# yet.
Here are C# and F# screenshots:
These two cool visual studio extensions, F# Outlining and F# Depth Colorizer, could give you a better experience. The F# Outlining extension allows you to collapse F# code blocks based on indentation level while the F# Depth Colorizer alter editor background color in each level of nesting.
Let’s see the same F# code after I install these two extensions.
What do you think? For me, it makes coding F# which is already pleasant language to code in Visual Studio better. If you don’t like the default colors, you could change them to this cool dark theme colors (I am a light theme guy :-), so I haven’t tried it yet myself)
If you have any F# extensions that you want to recommend, please let me know.
Happy F# coding!
NOTE: As of 11/18/2013, the F# Depth Colorizer in Visual Studio Gallery doesn’t support VS2013 yet. Fortunately, Brian McNamara who creates the extension has put the code in GitHub. So I just fork it and make it supports VS2013. I also put the VSIX installer here.
NOTE: 1/29/2014, our reader (Dennis) lets me know that the VSIX for 2013 doesn’t work with Dark theme. I guess the code in GitHub was an older version and didn’t support Dark theme out-of-the-box. Anyway, since the colors can be set via registry, you can download the file, dark-FSharpDepthColorizer.reg, from the same place, and run it.
NOTE: 4/12/2014, Depth colorizer is included in the Visual F# Power Tools. So you can just install the F# Power Tools and enable the depth colorizer feature instead.
If you want to switch back to light theme, you just run the file, light-FSharpDepthColorizer.reg, to remove colors from registry. (Although I have tested the reg files, please always back up your registry just in case).