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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Go is not an easy language (2021)

71 点作者 psxuaw超过 1 年前

9 条评论

dtdynasty超过 1 年前
I was writing a more involved change in golang for the first time and was surprised to find golang didn't support higher order functions like map and filter. It's not a big deal to have to implement them in a custom for loop but for a language that sells on simplicity, I was surprised to find these missing. I guess I have a different idea of simple than the golang team.
评论 #38989242 未加载
评论 #38990625 未加载
评论 #38993829 未加载
评论 #38988591 未加载
评论 #38988889 未加载
评论 #38992131 未加载
评论 #38998725 未加载
评论 #38988988 未加载
cryptos超过 1 年前
Go is so minimalistic that it forces developers to reinvent the same things again and again. Just think about how common certain collection operations are and how easy they are in some languages (e.g. Java, Kotlin, C#, Rust), but in Go you&#x27;d write list and for loops like in the last century. This wastes developer time, makes the code harder to understand and adds chances for bugs.<p>So, this cite applies to Go: “Everything should be made as simple as possible, but no simpler.”
评论 #38998960 未加载
__mattya超过 1 年前
Go is simple like C is simple. Add a garbage collector and concurrency and it’s easier to do some things but the simplicity of the language means you have to intimately understand more of the runtime to not shoot yourself in the foot.
bborud超过 1 年前
People tend to underestimate how much effort it takes to a) learn how to be a good programmer, and b) learn a given programming language. Sometimes they confuse the two.
评论 #38989868 未加载
DoesntMatter22超过 1 年前
This has been my argument since I started using it. It&#x27;s definitely simple but the easiest stuff can be such a pain.
评论 #38990498 未加载
anacrolix超过 1 年前
I feel like the argument is van to front here. Go <i>is</i> easy, the problem is it&#x27;s not simple.
评论 #39012514 未加载
HenriTEL超过 1 年前
pop() would have been a much better example, as ruby providing delete_at is a mistake IMO, since it runs in O(n), chances are that you&#x27;re using the wrong data structure. Go providing append but not pop is inexplicable
评论 #38993755 未加载
评论 #38997880 未加载
t0mk超过 1 年前
Just a side note, Golang has generics now: <a href="https:&#x2F;&#x2F;go.dev&#x2F;doc&#x2F;tutorial&#x2F;generics" rel="nofollow">https:&#x2F;&#x2F;go.dev&#x2F;doc&#x2F;tutorial&#x2F;generics</a><p>Google says that only since Feb 2022, and the article was written in 2021, but I think it was a planned feature and if the author did some research, he&#x27;d realize that generics are coming.
richrichie超过 1 年前
I was quite unhappy when they added generics to golang. That seemed like a slippery slope to C++ or Rust like monster.<p>I much prefer the pre generics Go. Crisp and compact.<p>Go is like Prostaff 90 upgrade to the great PS 85. It is not the plasticky Babolat APD 100 that beginners love.