Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> It's not for you, though.

It is "not for me" though because of the reason I said: Too much boilerplate for common usage. If it had less it would be for "me" and everyone else too, just like the nameof() is.

So it is a niche tool exactly because of the implementation. I bet a lot of people expected nameof() to be niche too, but it isn't.



No, it's a niche tool because it's a niche tool. This feature has very limited use; even more limited than CallerMemberName. It actually makes a lot of sense not to invent a lot of new syntax or compiler logic to handle something this rarely used.


agreed, if they made it to be eg. expressionof() - which to be fair might happen in the future - then it would be just as usable as nameof()




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: