views:

56

answers:

3

Hello everybody

Below comment is just a piece of xml comment in VS but my problem is characters like < > that break the xml structure. How can I use them in an xml comment?

/// <param name="index">square index on board which 1<=index<=64</param>
+3  A: 

I would reword it to be more a sentence and less an equation:

/// <param name="index">square index on board, between 1 and 64</param>
Kate Gregory
Between means 1 and 64 included ?
Freshblood
If you are concerned that your audience for the comment might think a chessboard could be 2 <= index <= 63, you could say "between 1 and 64 inclusive." I think the importance of the comment is really to distinguish "0-63" from "1-64". But word it as you feel you need to for those who will read it.
Kate Gregory
+2  A: 

Try encoding them? using &lt; and &gt;

Psytronic
I think that will look awful when you're reading the code. I also think more people will read the code than will read the doc you generate from it.
Kate Gregory
+1  A: 
/// <param name="index">square index on board which 1&lt;=index&lt;=64</param>

OR

/// <param name="index">square index on board which 1〈=index〈=64</param> 

The latter option is unicode: 〈 〉

Joshua
Why use unicode if less than and greater than are part of the xml spec? Not a criticism, just a wonder.
Psytronic
Depending on fonts, it might be immediately readable both in the comment and the xml extract.
Joshua