p*****2 发帖数: 21240 | |
n****1 发帖数: 1136 | 2 The author is plainly stupid. All his problem with Go can be attributed to
the lack of generics, so he choose java... good choice, except that:Java is
just doing type erasure!!!
He can simply declare a stub interface in Go and implement this interface in
all his 6 data types. Then write his generic functions only on this
interface, that is all java did. |
j********x 发帖数: 2330 | 3 Srinivas JONNALAGADDA
Works at Ojus Software Labs Private Limited, Hyderabad
Lives in Hyderabad, India
2爷说相声还是靠谱的。。。 |
f******y 发帖数: 46 | 4 Hi nod101
Would you mind showing some sample code of your proposal? Thanks
is
in
【在 n****1 的大作中提到】 : The author is plainly stupid. All his problem with Go can be attributed to : the lack of generics, so he choose java... good choice, except that:Java is : just doing type erasure!!! : He can simply declare a stub interface in Go and implement this interface in : all his 6 data types. Then write his generic functions only on this : interface, that is all java did.
|
b*******s 发帖数: 5216 | 5 看上去是这个人希望go有比较成熟的泛型库,但没有,就自己实现了一个效率很糟糕的
是这样吗?
【在 p*****2 的大作中提到】 : Another go at Go ... failed! : http://oneofmanyworlds.blogspot.co.uk/2014/01/another-go-at-go-
|
n****1 发帖数: 1136 | 6 擦, 没注意到原来是三哥
二爷的坑我以后不跳了
【在 j********x 的大作中提到】 : Srinivas JONNALAGADDA : Works at Ojus Software Labs Private Limited, Hyderabad : Lives in Hyderabad, India : 2爷说相声还是靠谱的。。。
|
j********x 发帖数: 2330 | 7 这不是一个普通的三哥,是在印度本土上班的纯种三哥。。。
【在 n****1 的大作中提到】 : 擦, 没注意到原来是三哥 : 二爷的坑我以后不跳了
|
n****1 发帖数: 1136 | 8 没怎么写过go, 懒得去查语法了,给个C++里面class例子好了:
class baseT{}; //class is just a dumb interface
class Linklist{
baseT* payload;
Linklist* next;
};
这样任何实现了baseT都能被与Linklist有关的函数操作了. 在Go里做个stub
interface就和这里的baseT是一个意思.
这个等价于C++模板里面做出的linklist container.
【在 f******y 的大作中提到】 : Hi nod101 : Would you mind showing some sample code of your proposal? Thanks : : is : in
|
c*******0 发帖数: 5247 | 9 这个人谴责Go没有generics, 他就得maintain multiple implementations of similar
things and ultimately led him to rewrite it all in Java because of the
overhead in maintaining the different-but-similar things and backporting
features between those different implementations.
是他不会用interface还是他在搞笑?
而且他的整个程序没有用channel......让他给代码出来帮他profile他说IP issue不能
给...
有时候程序员烂了,挡都挡不住 |