Make interface implementation explicit #15682
Replies: 3 comments 10 replies
-
Not every developer thinks it's a bad way of doing things. And "implements" seems too... "OOPy". However, that's what discussions are for. |
Beta Was this translation helpful? Give feedback.
-
I really like the interface specs of Go and V. On the other hand, I agree that readability is bad. My opinion is that this inconvenience should be compensated for by the IDE, not by the language specification. |
Beta Was this translation helpful? Give feedback.
-
This was implemented in #22214 and available in https://github.com/vlang/v/releases/tag/0.4.8 . |
Beta Was this translation helpful? Give feedback.
-
As in go, v does not require to explicitly write that a struct/class implements an interface. This is one of the worst design decisions the go team made. In a big project, it is hard to track down in the code what interface a struct implements. Code readability gets worse with this decision.
Also, implementing an interface in other languages also kind of acts as a contract that a struct/class has these methods, and the ide will warn you if not, which is really nice.
Almost all of the developers I know that use go, dont like that design decision.
Please introduce a keyword "implements" or some kind of syntax that makes this explicit.
Beta Was this translation helpful? Give feedback.
All reactions