views:

152

answers:

1

While there is no One True Correct Style, some points of general agreement exist in the C# community regarding coding standard / style; usually, they are variations of the .NET Framework Design Guidelines.

When you look into F#, though, the standard is visibly different from what is considered normal in C#. As an example, the functions accessible on List or Seq (almost) all start in lower case: List.fold, List.map (but List.Cons and List.Empty don't...), whereas it is usually accepted that a method or property in C# should be capitalized.

So my question is, are there widely accepted coding conventions for F#? Is there an equivalent to the Framework Design Guidelines, or a good coding standard out there? And, as a bonus, in the whitespace-based F# world, do people have topics to argue endlessly about, similar to the timeless C# curly-brace position?

+7  A: 

The F# team has drafted a document that sounds like exactly what you're asking for. (We're currently in the process of incorporating feedback from community/insiders we've sent the draft to.) It is likely to be published in the near future. I'll be sure to link it here when it's published.

EDIT

The document is online now:

http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/fsharp-component-design-guidelines.pdf

Brian
Very cool. The lack of a standard is not my biggest problem by a long stretch, but I really like consistency, and this would help. Any thoughts on having something like StyleCop for F#?
Mathias
I don't personally have any thoughts, and I am not aware of anyone planning to create such a tool. (You could create it and become important to the F# community! :) )
Brian
I think that most of the coding conventions comes from the OCaml background.
Tuomas Hietanen