Тёмный

Finalize vs Dispose | C# Interview Questions 

Code Radiance
Подписаться 14 тыс.
Просмотров 42 тыс.
50% 1

Learn about the difference between the Finalize and Dispose methods and how and when to use them.
Dispose Pattern:
docs.microsoft.com/en-us/dotn...
Learn More About Safe Handles:
docs.microsoft.com/en-us/dotn...
►►►Like this Video? Please be sure to SUBSCRIBE for more:
ru-vid.com?s...
----------My Social Links:
🔴 My Channel: / codefirst
🔴 View Playlists: / codefirst
🔴 My Github: github.com/Nitij
#FinalizeVsDispose

Наука

Опубликовано:

 

5 фев 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 21   
@VSH077
@VSH077 4 года назад
Fantastic explanation. Thanks a lot.
@manishjawarkar84
@manishjawarkar84 4 года назад
very nicely explained...thank you
@anushinfobase3159
@anushinfobase3159 9 месяцев назад
Beautiful, well explained.. Thanks ಚೆನ್ನಾಗಿದೆ ವಿವರಣೆ... 👌
@nabhoyar
@nabhoyar 2 года назад
Its best explanation. Just as how everyone suggested, you can slow down your speed as your contents are more when you are explaining. In between you can resummarize your points as well for better understanding. Other than that, it is the best explanation for GC. Keep it up
@martapfahl940
@martapfahl940 5 месяцев назад
So is it somewhat comparable to e.g. removing event handlers in React in the useEffect cleanup function? I am javascript dev curious about C# programming. Thank you.
@stoic2454
@stoic2454 7 месяцев назад
Let’s say my implementation uses dispose pattern, i wrap my object inside a using block there dispose will be called and unmanaged resource will be released, but what about managed resources for instance we maybe having a list or some variables like that, do we need to free their memory as well ? given the fact that we suppress finalise when we explicitly call dispose
@kadamrahulk
@kadamrahulk 3 года назад
Not understood 4:28 onward. I think It will not stop to dispose unmanaged resources.
@DoGGy1110
@DoGGy1110 7 месяцев назад
Why u freeing umanaged where u should free managed?
@chennaiahp5765
@chennaiahp5765 4 года назад
good explanation
@AjaySingh-fq4fz
@AjaySingh-fq4fz 4 года назад
Awesome
@theoceandragongaming
@theoceandragongaming 9 месяцев назад
Why are you calling safe handle in the managed code section?
@bishnupriyapradhan7768
@bishnupriyapradhan7768 3 года назад
I think you meant destructor and not destructure
@raghurambhagawatula7025
@raghurambhagawatula7025 3 года назад
4:28 and 5:24 doesnt make sense!!
@wowpravin
@wowpravin 2 года назад
Good one! But not sure why recommend not implementing Finalizer? You are assuming that the clients of your class will always call Dispose.
@AvgDan
@AvgDan 9 месяцев назад
When you add " : IDisposable" to a new class and select the potential fix for "Implement Interface with Dispose pattern", the boilerplate code will include this: "TODO: override finalizer only if 'Dispose(bool disposing)' has code to free unmanaged resources". Maybe the presenter is just regurgitating what MS says in the boilerplate code, I don't know. However, I did notice that not including the finalizer on a very small test class allowed me to create new instances of it ~3x faster. I think it's fair to expect programmers to dispose of objects that implement IDisposable. Perhaps a future version of Visual Studio will provide an informational underline under variable names which are instantiated as a type which implements IDisposable and they didn't do the instantiation in a using statement nor call Dispose.
@vignesharunkumar6005
@vignesharunkumar6005 3 года назад
Nice explanation but very fast. Just give some gap
@merajkhan5078
@merajkhan5078 10 месяцев назад
Please slow down your speed
@SupriyaMondal3
@SupriyaMondal3 3 года назад
too fast, please give a pause between sentences.
@CodeRadiance
@CodeRadiance 3 года назад
Sure.
@PyramidSpiritualSeekers
@PyramidSpiritualSeekers Год назад
not clearly understood and too fast explanation.
@wd669
@wd669 Год назад
Not clear explanation
Далее
IDisposable and Finalizers
23:00
Просмотров 21 тыс.
C# Delegates explained
8:47
Просмотров 514 тыс.
.NET Core Garbage Collection
14:54
Просмотров 22 тыс.
Garbage Collection [An Introduction in .NET 5.0]
17:29
Don't throw exceptions in C#. Do this instead
18:13
Просмотров 252 тыс.
C# Disposable pattern, Dispose Vs Finalize
26:11
Просмотров 93 тыс.
Самый дорогой кабель Apple
0:37
Просмотров 318 тыс.