Generic methods approved for Go, devs miss other features
Briefly

Generic methods approved for Go, devs miss other features
"The change of view is that methods are useful for organizing code even if they do not implement an interface, so there is no reason not to have them support type parameters - generics - in the same way as functions."
"Griesemer said that the new feature is fully backward-compatible with existing Go code, though tools will need to catch up. The interface issue remains, though, and Griesemer added that providing generic methods doesn't preclude the implementation of generic interface methods at some point, should we find an acceptable implementation solution."
"Developer reaction to the approved proposal is positive, though many recognize that the feature is incomplete. My internal utility library has a bunch of workarounds for missing generic methods and they all annoy the hell out of me, said one."
The Go team has approved generic methods for the language, reversing a longstanding FAQ position. Co-designer Robert Griesemer proposed the feature, which will now move to implementation. Previously, generic methods were rejected because they could not implement interfaces, making generic functions sufficient. The new perspective recognizes that methods organize code effectively even without interface implementation, justifying generic method support. The feature is fully backward-compatible with existing code, though tools require updates. The interface limitation remains unresolved, though Griesemer indicated generic interface methods could be implemented later if a solution emerges. Developer reaction is positive despite acknowledging the feature's incompleteness.
Read at Theregister
Unable to calculate read time
[
|
]