The obvious benefit of extension methods is that they allow us to append methods to a type *after* it has been defined. But an undervalued advantage is that they append methods to *types*, with all the flexibility Scala gives us to specify those types precisely or generally.
-
-
That's true but if you don't control the type you extend, you need a magical import. This is a massive source of confusion for the users.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I still prefer methods asking for implicit evidence, as in my experience there are more easily discoverable for beginners, are at the right place in (automatic) documentation and don't risk to be magically overriden by other extension method imports.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.