Questions tagged [extension-methods]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
245 views

What if all static methods in Java or C# could be extension methods just by default?

C# 3.0 introduced extension methods to "enhance" behavior of existing types without interface bloating to avoid modifying/breaking existing interfaces. This was the first time I learned of ...
terrorrussia-keeps-killing's user avatar
3 votes
2 answers
367 views

What are the advantages and disadvantages of extension methods?

They allow you to add methods to an existing class without extending the class directly. Normally, you can only create mutation methods by creating your own class that extends String as I have below. <...
Starship - On Strike's user avatar
8 votes
2 answers
112 views

How to dynamically dispatch extension methods?

Swift allows you to define extension methods on any type or protocol. While extension methods on protocols are frequently used to provide default implementations, only methods listed in the main ...
Bbrk24's user avatar
  • 8,857