What is Reflection? - C# Gotcha Interview Questions

preview_player
Показать описание
Reflection is a core concept in C# and Dotnet. It allows you to peek inside an object to get its types, members and properties, and even dynamically access and execute what you found during runtime.

Reflection can even help prevent the "Code smell" of sprinkling Switch statements all over your code.

I remember reflection with the mnemonic "D-SIMPLE" which stands for:
Dynamically
See (and)
Invoke
Members (and)
Properties (for)
Loading (and)
Examination

The code for this is available on github at:
Рекомендации по теме
Комментарии
Автор

Imagine learning Reflection in 5min instead of 50, great job Ryan

MedAmineMatmati
Автор

I found so many hour+ long videos and this was 5 minutes and I've never understood it until this one.

gregathee
Автор

For some reason, watching your videos really makes me want to work with you. You’re incredibly smart and seem like a lot of fun

PKrud
Автор

Appreciate the time you spent making this video, you really make advanced topics easy

cksharp
Автор

Thank you, thanks for all the acting. Very creative and fun to learn the concept. lol

hutchm
Автор

I came across your channel on a Reddit post that you commented. I quite like your teaching style. Thanks for making these!

MrDozturk
Автор

Whoa, stumbled upon this channel by pure chance and boy do I love your D&D theme in this video, hahah! Subbed, o' wizard of digital spells.

Johannes
Автор

Wow, I just read the official microsoft article about reflection, and 2 other articles
It was not clear enough so I thought, okay, youtube then
First video I find is this
Halfway through, it all clicks and I'm smiling
Genius video :D
I'm definitely checking out your content

briza_md
Автор

Took me a couple of minutes to understand why you had to create an instance so I'll try to explain for anyone that is having trouble: The Invoke method of the MethodInfo class (which we got an object of using the GetMethod reflection) takes an object as the first parameter, which is an object that has the method to be invoked. The _CurrentCharacter implements the interface ICharacter and it has no Backstab() method, so the instance of the specific type is needed. Hope it helps.

Gabahulk
Автор

Wow! Your style of explanation is unique, compact, effective and so simple!

chandankarmakar
Автор

Love the geeky insightful aspect of your presentation. Reminds me when "Programmers" were insightful and every intelligent. Keep going Sir

suniljadhav
Автор

un capo total, gracias maestro! you managed to explain a difficult core concept with ease... kudos sir!

KoniKone
Автор

This is the best video for reflections on YT ....finally understood Reflections...thanks. Peace

rohanmahapatra
Автор

never seen so much excitement about back-stabbing in 1 video

paxvostrum
Автор

"They shall not pass." We'll, your content is King. I'll pass it on.

nwus
Автор

Wow! This is so incredibly useful as a simple explanation! I've totally fallen into that ridiculous enums-everywhere pitfall. Definitely going to start using this!

jonathaneytchison
Автор

Best explanation available on internet.

sahil
Автор

Finally someone explains reflection so clear and fast. And also I now see how useful it can be. I had been told reflection was kind of a bad practice or something like that so I had stayed away from using it.

yaguarete
Автор

This is some well-crafted educational content. Thanks!

jonathanrhoads
Автор

I love the example used here, especially as a dnd player.

redghost
welcome to shbcf.ru