Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Learn C#: Method Hiding (and Why You Will Want To Avoid It)

Автор: Zoran on C#

Загружено: 2024-03-11

Просмотров: 5952

Описание:

Become a sponsor to access source code ►   / zoranhorvat  
Join Discord server with topics on C# ► https://codinghelmet.com/go/discord
Enroll course Beginning Object-Oriented Programming with C# ► https://codinghelmet.com/go/beginning...
Subscribe ►    / @zoran-horvat  

Learn from related videos:
How Do Virtual Methods Work? ►    • Learn C#: How Do Virtual Methods Work?  
Abstract or Virtual Method, Which Fits Better Here? ►    • Learn C#: Abstract or Virtual Method, Whic...  

Method hiding is one of the most obscure programming techniques in C#. It lets you redefine a method in a derived class without actually overriding it.
Does method hiding produce polymorphic types? No, it does not. Is it not polymorphic, then? Well, no, sometimes it is. What the hack?!
Some programmers accept to hide an inherited method with another one with the same signature in an attempt to accomplish various goals. What they fail to understand, though, is that every such implementation can only work as expected in a narrow set of use cases. At the same time, it will behave erratically in other cases.
Worse yet, in the narrow window of opportunity within which you can effectively invoke a method in the derived class, at least two other programming techniques exist that work as expected under any circumstances! One is to define a method whose name does not conflict with the base class. Another is to apply interface implementation rather than class derivation.
The world is your oyster if you are ready to ditch method hiding from your tool belt!
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
⚡️RIGHT NOTICE:
The Copyright Laws of the United States recognize a “fair use” of copyrighted content. Section 107 of the U.S. Copyright Act states: “Notwithstanding the provisions of sections 106 and 106A, the fair use of a copyrighted work, including such use by reproduction in copies or phono records or by any other means specified by that section, for purposes such as criticism, comment, news reporting, teaching (including multiple copies for classroom use), scholarship, or research, is not an infringement of copyright." This video and our youtube channel, in general, may contain certain copyrighted works that were not specifically authorized to be used by the copyright holder(s), but which we believe in good faith are protected by federal law and the Fair use doctrine for one or more of the reasons noted above.

#csharp #dotnet #objectorientedprogramming

Learn C#: Method Hiding (and Why You Will Want To Avoid It)

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Unveil the Mystery of the Liskov Substitution Principle

Unveil the Mystery of the Liskov Substitution Principle

When Should You Use record, class, or struct - And Why That Matters?

When Should You Use record, class, or struct - And Why That Matters?

Validating Records in C#: Everything You Ever Wanted To Know but Had No One To Ask

Validating Records in C#: Everything You Ever Wanted To Know but Had No One To Ask

Learn C#: How Do Virtual Methods Work?

Learn C#: How Do Virtual Methods Work?

This Explains Why C# 14 Feels So Much Like F#

This Explains Why C# 14 Feels So Much Like F#

Я ненавижу длинные цепочки If-Elif: этот шаблон проектирования решил эту проблему раз и навсегда

Я ненавижу длинные цепочки If-Elif: этот шаблон проектирования решил эту проблему раз и навсегда

Avoid This Common Mistake in DDD Modeling

Avoid This Common Mistake in DDD Modeling

Favor Method Chaining Over Nested Calls | Clean Code

Favor Method Chaining Over Nested Calls | Clean Code

C# 14 Isn't Just Adding New Syntax — It's Removing the Old One!

C# 14 Isn't Just Adding New Syntax — It's Removing the Old One!

Декораторы Python — наглядное объяснение

Декораторы Python — наглядное объяснение

This New Feature Gives Superpower to C# Record Types

This New Feature Gives Superpower to C# Record Types

Самые важные паттерны в программировании

Самые важные паттерны в программировании

Путин резко меняет планы / Срочный приказ президента

Путин резко меняет планы / Срочный приказ президента

Learn To Love DDD-Style Strongly Typed IDs

Learn To Love DDD-Style Strongly Typed IDs

5 Fundamental F# Features C# Will Never Have

5 Fundamental F# Features C# Will Never Have

Have You Ever Signaled async/await Progress in These Three Ways?

Have You Ever Signaled async/await Progress in These Three Ways?

Let C# Tuples Become Your Best Friends

Let C# Tuples Become Your Best Friends

Что такое

Что такое "Reverse Engineering". Показываю как ломают софт.

Record Types Validation is Simpler Than You May Think

Record Types Validation is Simpler Than You May Think

Линус Торвальдс в ярости из-за предложения RISC-V

Линус Торвальдс в ярости из-за предложения RISC-V

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]