On 01/02/2020 02:48, Richard Damon wrote:
On 1/31/20 9:28 PM, Christopher Barker wrote:
I am really confused by this whole thread:
My understanding is that the impetus of the request is that if you start from an expression like nameof(foo.bar) to get to "bar" then if you refactor your code you have a chance that the tool will be able to see the variable expression foo.bar, and process that like other references to the item, and thus be able to change it. Just using the string "bar" would be very hard to see the connection between foo.bar and "bar".
Maybe I haven't been paying attention but, if accurate, this is the most helpful explanation in the thread. Some sort of conventional mark-up for variable names seems more appropriate than a (pseudo-)function. Possibly something the compiler is made to ignore in strings, but that the IDE treats as identifying a variable name. It would work in comments too. Single quotes do it pretty well, making it a coding standards and IDEs question. Jeff Allen