-3

Description for the tag is:

In C#, nameof expressions are a form of reflection. They return the string representation of the argument, as seen by the compiler.

But reflection means ability of a program to know/adjust its structure at runtime, see Reflection (computer programming). nameof, at least in C#, is evaluated at compile time by the compiler (another program) and hence not a reflection or its form.

I thought something like this:

Operator to obtain the simple (unqualified) string name of a variable, type, or member.

should be less confusing.

Is there a possibility to modify the tag's description?

9
  • 6
    Go to the tag info and click on Edit Tag Info. Have fun :) Jun 21, 2018 at 11:07
  • 1
    Tip: provide a reference in your edit description. Reviewers might not be experts in the subject, and inclined to reject changes that are both shorter, simpler and have a different meaning. Providing references for factual changes helps it get accepted faster.
    – Erik A
    Jun 21, 2018 at 11:13
  • @ErikvonAsmuth Good hint!
    – Rekshino
    Jun 21, 2018 at 11:14
  • I have queued an edit for the tag, so previous description, if edit will be approved, can be found in history.
    – Rekshino
    Jun 21, 2018 at 11:20
  • I would in any case add the fact that nameof gets evaluated at compile time. Jun 21, 2018 at 11:20
  • @ThomasSchremser It would be possible, but from the over side there are SO questions about it, so information can be found and description remains short.
    – Rekshino
    Jun 21, 2018 at 11:23
  • True, there are questions. But I think that this is the biggest misunderstanding people have about this operator. Jun 21, 2018 at 11:27
  • @ThomasSchremser Maybe you are right, but I'm not sure, that it belongs to description. Feel free to adjust the description.
    – Rekshino
    Jun 21, 2018 at 11:30
  • @DragandDrop I can't follow you.. What do you mean?
    – Rekshino
    Jun 21, 2018 at 12:20

2 Answers 2

5

I have serious doubts about the usefulness of this tag. There are only so many questions to be asked about nameof before the majority of them should be closed as duplicates.

I'd rather see it deleted instead of working out a tag description.

1
  • In my opinion this tag is also not really usefull, but it doesn't disturb me comparing with wrong description of it.
    – Rekshino
    Jun 22, 2018 at 6:01
0

There's runtime reflection and there's compile-time reflection - it's not just the latter. The two uses are, in particular, in use among C++ language developers/enthusiasts. And I would definitely see a nameof() language construct as a reflection feature.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .