DEV Community

Discussion on: What's a useful programming language feature or concept that a lot of languages don't have?

Collapse
 
lefebvre profile image
Paul Lefebvre

I think this is more of an underutilized features rather than an uncommon one, but I really like Extension Methods. They allow you to "attach" a method to a class that you otherwise can't or don't want to modify.

For example, rather than:

Foo(FrameworkClass)

You can write:

 FrameworkClass.Foo

In Xojo you'd do this with the Extends keyword in the global method definition:

Public Sub Foo(Extends FrameworkClass As c)