Hacker News new | ask | show | jobs
by sszz 2188 days ago
Thanks for this—easier to digest than other posts I’ve seen. The ability to restrict interfaces to specific types is pretty cool (unique?) but otherwise seems like generics as usual, but with a distinct Go flavor. Looking forward to using this and cleaning up some boilerplate!
1 comments

Unless I'm missing something I can't see any constraining ability that isn't possible in C#[0], for example?

[0] https://docs.microsoft.com/en-us/dotnet/csharp/programming-g...

Maybe you are missing that this is not possible in Go yet?
OP specifically said the constraining mechanism was unique, hence why GP (and myself) are curious about what makes it more interesting/powerful than what exists in other languages like C#.
I was questioning the uniqueness of the feature is all - it seems to me that there isn't anything unique about the constraints available in Go.
I do wish people would resist the reflex to overtly digress onto their own favorite programming language in any given programming HN thread. I'm not talking about insightfully comparing two languages; I'm talking about going completely off-topic because you want to talk about your own favorite language.
If this is in reference to my bringing up of C# - I did so in order to talk about whether or not Go has generic constraints which are unique (which would be awesome!). I used C# as an example of a language that has constraints that are the same as/as powerful as those in this Go proposal so as not to be making an unsubstantiated claim.