Friday, February 11, 2011

.NET // vs /// Comments convention

I am just checking out F#, so apologies if this is a silly question, but in the VS2008 F# CTP 1.9.6.2 'Tutorial' project, both // and /// are used for commenting code.

Is there a functional difference between the two slash vs three slash commenting, or is it convention (as it appears in the tutorial code) to comment a function with /// and use // for everything else?

  • /// is for documentation comments. VS will use it when generating intellisense information.

  • Using three slashes (///) is a C# convention for XML Documentation Comments that is adopted by F# as well.

  • It's similar to /* comment */ vs /** documented comment */ in Java.

    The latter works the same, but is also recognised by documentation software to be developer documentation - not just a note.

    Scott Dorman : Which only helps if you know what those comment constructions do in Java, which wasn't the question.
    From Dean

0 comments:

Post a Comment