TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

What Go Might Be Like With Generics

39 点作者 sentiental超过 11 年前

9 条评论

Sir_Cmpwn超过 11 年前
Is the only argument that Go users can come up with against generics is that they don't like the syntax? The pretentious nature of the Go community really puts me off from the language, especially when combined with some of the pretentious designs of Go itself.
评论 #7087414 未加载
评论 #7087299 未加载
评论 #7087344 未加载
评论 #7087263 未加载
f2f超过 11 年前
is this trying to solve a particular problem or just pandering to the &quot;... but generics!&quot; crowd of trolls?<p>because it doesn&#x27;t look like it&#x27;s solving anything, it feels positively ugly, and there&#x27;s no way we&#x27;ll every shut those people up no matter how hard we try. there&#x27;s no generics solution that will do that.<p>thankfully go&#x27;s authors don&#x27;t usually favour the internet&#x27;s opinion on these matters, or we&#x27;d be dealing with something even uglier now.
评论 #7087225 未加载
rollo超过 11 年前
Eventually those who need static typing and parametric polymorphism will switch to Haskell anyway, where both are done in a much better way, both syntactically and implementation wise.
bvaldivielso超过 11 年前
It is undeniable that generics are a quite demanded feature for golang.<p>We&#x27;ll see how the language evolves, but I can&#x27;t see them coming for a &quot;long&quot; time.
评论 #7087273 未加载
chimeracoder超过 11 年前
I have been writing Go daily at work for about a year and a half. It is now my primary language, and my default choice for any new projects, the way Python used to be. Before that, I come from a background in functional programming (and still find functional programming to be my favorite paradigm).<p>It seems to me that there are two disjoint sets of people: those who write Go regularly, and those who complain about generics in Go.<p>Of course, you can interpret this either way you wish!<p>1) Perhaps those latter people would like Go despite its lack of generics if they only bothered to get familiar with idiomatic Go.<p>2) Perhaps the lack of generics is precisely what prevents them from writing Go on a daily basis.<p>But as someone who actually does write Go on a daily basis, and has for a year and a half, I can honestly say that I&#x27;ve only ever missed them a handful of times. And I say this as a functional programmer who is used to being able to call &quot;map&quot; everywhere.<p>In fact, if I had to prioritize the things that I wish I could change about Go, generics would not be in the top three - not even in the top five[0]. They&#x27;re just really something that I don&#x27;t miss anymore.<p>[0] I could tell you what they are, but that&#x27;d be making it too easy - give Go a shot, long enough to realize you really don&#x27;t need generics as much as you think you do, and then you&#x27;ll probably have a good idea of the good, bad, and ugly when it comes to Go.
评论 #7087516 未加载
评论 #7087442 未加载
评论 #7087544 未加载
评论 #7087757 未加载
fiorix超过 11 年前
&lt;T&gt;errible to my eyes.
mseepgood超过 11 年前
tl;dr: &lt;T&gt;
评论 #7089031 未加载
embwbam超过 11 年前
I use generics every day in typescript. I&#x27;m waiting to use go until it has them.
reality_czech超过 11 年前
I&#x27;m more interested in what Go might be like without whiners.