
Nameof expression is amazing Say NO to magic strings - clw895
https://codingblast.com/nameof-expression
======
jepler
wow that totally fails to explain what nameof is. It seems to be a tiny bit
similar to the C preprocessor's stringize,

    
    
        #include <boost/preprocessor/stringize.hpp>
        #include <stdio.h>
        int main() {
            puts(BOOST_PP_STRINGIZE(3)); // will print "3\n"
        }
    

except that it can take a qualified name (like person.address.ZipCode) and
return just the last component (this is documented by Microsoft as resulting
in the string "ZipCode") [https://docs.microsoft.com/en-
us/dotnet/csharp/language-refe...](https://docs.microsoft.com/en-
us/dotnet/csharp/language-reference/keywords/nameof)
[https://stackoverflow.com/questions/31695900/what-is-the-
pur...](https://stackoverflow.com/questions/31695900/what-is-the-purpose-of-
nameof)

------
codingblast
Thank you jepler, for the valuable feedback. I improved the post a bit.

~~~
jepler
thanks for that

