Z
Z
Zakharov Alexander2019-05-15 08:34:48
C++ / C#
Zakharov Alexander, 2019-05-15 08:34:48

Is it possible to annotate Visual Studio local variables [not allowed]?

Hello. ?
5cdba48556902043548313.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
F
Foggy Finder, 2019-05-15
@AlexZaharow

If you mean xml documentation, then you can't.
Local variables are implementation details. Try to give self-documenting names, and additionally accompany complex sections of code with comments.

D
ddd329, 2019-05-15
@ddd329

Well, if only one line comment. In general, this is a very bad practice, because. From the name it should be clear what kind of variable it is and what it is intended for. Well and accordingly some context where this variable is used is necessary. If you have a total or sum
variable declared in the visual form code , for example, then of course it will not be clear why they are here, but if, for example, they are declared in the ORDER class , then it is clear that this is the amount of the order, i.e. we figured it out from the context of the variable declaration...

E
Eatric, 2019-05-15
@Eatric

I don't think XML documentation is used only to describe classes, properties and methods. What is the point of documenting a local variable?
Management

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question