I am a new programmer and I am learning to program with F# and currently learning about the documentation part. The F# built-in documentation syntax follows C# (XML).
My teacher wants us to write xml documentations, which I will of course learn. But on the side I read a lot of source codes which includes .md files instead, and have documentation online on GitHub for example.
Should I focus on learning the XML documentation method or should I focus on something else? Can someone hint me in a good direction on where to read a good and reliable guide on this?
Below is a short XML documentation (my first) I tried to write just documenting how a simple sum-function is working. Any kind of input would be greatly appreciated as well!
///<summary>Get the sum of numbers to n and with n included</summary>
///<example>
/// The code:
/// <code>
/// let sum(n : int) =
///
/// let mutable result: int = 0
/// let mutable i : int = 0
///
/// while i < n do
///
/// i <- i + 1
/// result <- result + i
///
/// result
/// </code>
///</example>
///
///<remarks>Input:
/// <code>
/// printfn "Sum af 1 + 2 + ... + n = %i" (sum(4))
/// </code>
///</remarks>
///<returns>Sum af 1 + 2 + ... + n = 10</returns>
///<param name="n"> Natural number, n > 0 n <> real numbers </param>
let sum(n : int) =
let mutable result: int = 0
let mutable i : int = 0
while i < n do
i <- i + 1
result <- result + i
result // result of sum of n
printfn "Sum af 1 + 2 + ... + n = %i" (sum(4))