nameof gets its one missing feature in C# 11

preview_player
Показать описание

Hello everybody I'm Nick and in this video I will show you how the nameof keyword's functionality is changing in C# 11 to support the one usecase that it wasn't usable in

Don't forget to comment, like and subscribe :)

Social Media:

#csharp #dotnet #nameof
Рекомендации по теме
Комментарии
Автор

Looks like someone else enjoyed the sun the last few days 😁

allinvanguard
Автор

Very nice feature. I have only a minor worry about it. This feature looks to be magic. That causes mess in my mind (which spoils C# language a little bit). Question: what is the new scope of "args"?

marekbanaszkiewicz
Автор

@Nick that "eleven" reminded me of the parody with the Scottish elevator! hahaha Search for "Scottish elevator" if you haven't seen it! It's hilarious! Being able to use nameof function in the method definition is very helpful indeed! Thanks for the info!

panosru
Автор

Hey Nick.. Great video.. Can you explain further on how this context works ? where the param and CallerArgmentException reside in different contexts and are not visible to each other...

haribalachander
Автор

nameof needs a tree depth so we can call nameof(class.object.method, 2) and get "object.method" back as a string

cubbucca
Автор

How disappointed were you when Rider renamed 'param' for you xD

IMustHaveThatApe
Автор

Funny how Rider tried to sabotage your point here. It's such a great IDE

jebwatson
Автор

_"Don't worry about the ticket price... your company will pay for it"_ I am working for the wrong companies, then. I can't get to a ticket to a *local* conference, let alone a ticket to Oslo.

scott
Автор

That's an interesting feature but I think it's still somewhat of a flaw that you need to add an optional parameter, that you can manually set when you call the function. I don't know exactly how the C# lowerer deals with this though, so I might be wrong. Great video though!

catapillie
Автор

DID YOU JUST SAY CSHARP 6 ? What year are you living in Nick?

codewkarim
Автор

What would be even better than would be that the !! operator implement for you.

kiwiproductions
Автор

Switched to a python job 2 months ago and managed to forget about how ludicrous everything is in .NET land, what were they thinking

qcqe
Автор

Yo that's cool and all but... What happened to your nose? Did you get into a fight? Are you alright man?

I really love your videos. The moment I saw the title I knew exactly what you're going to talk about without knowing what's coming.

danielschmid
Автор

fullnameof when?
Not what I expected its one missing feature to be.
At least this means they are looking at nameof

stefanglintzer
Автор

Hi,
A video on porting legacy .net apps(4.6, 4.7) to .net5 or .net6 would be nice

Upgrade assistant for example.

Not much content on these I guess .

mahesh_rcb
Автор

Is it just me, or are these videos unnecessarily long?

MartinToernby
Автор

6 minute video for such a simple thing?

cheems
Автор

maybe it`s a good idea to reuse the reserved keyword than inventing new keyword or operators... 🤔 Anyway, love this feature!

williamliu
Автор

since properties in objects can remain un-initiaized and also be objects on their own, it´s been a pain (I try to make sure that Lists/ Collections/ etc. will always be initialized - but you cannot be 100% sure (=>EFcore)). There is one function in jQuery/JavaScript that I like: "IF (obj.A.B.C)" (quite error friendly! They should also make something for C# (like: var varPropA = obj.propC.propB.propA; ) - after all: "IF NOT (varPropA) " - something failed - so bye, bye.

lollo
Автор

Nice! Also whished is: void Func(int a=b, int b=10);