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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Go, robots and refactoring

98 点作者 mattetti大约 11 年前

8 条评论

enneff大约 11 年前
I would suggest naming the method "Device" instead of "GetDevice". The word "Get" is almost always redundant.
评论 #7668180 未加载
wyager大约 11 年前
&gt;Go aka golang is an amazing language<p>By what standard? I&#x27;ve been very underwhelmed.<p>The type system is very mediocre. Support for generic programming is awful. What kind of language idiomatically involves casting to the top type? That would be like if Java idiomatically involved casting to Object, or C++ idiomatically involved casting to void*, just to get any sort of genericism. Look at almost any big Go project; the abundance of {}interface typed variables is alarming<p>And then how about language extensibility? Go relies heavily on built-in keywords, like range and make(). You want to range over a tree or a linked list? Too bad. You can only use built-in types. Or maybe you can wrap your data structure in a chan and range over that. Goodbye performance and simplicity.<p>Go is not a bad language. I use it on a number of web projects, and it works very well. But Go is not, by any metric I can think of, an &quot;amazing&quot; language. At best, it is a decent language with lots of corporate support, a good standard library, and some good tools like golint, go get, and go fmt.
评论 #7668786 未加载
评论 #7669033 未加载
评论 #7668695 未加载
评论 #7668780 未加载
codegangsta大约 11 年前
Nice post Matt! I would love to see more of these eyewitness accounts of refactoring in the go community. Maybe a refactoring video should be in the works ;)
评论 #7668187 未加载
2mur大约 11 年前
This is really helpful. I&#x27;m getting started with Go now and common idioms and refactoring are useful when moving past the tour and introduction stage.
joefitzgerald大约 11 年前
This is a really helpful article - nice work Matt.
评论 #7667794 未加载
djb_hackernews大约 11 年前
Go looks interesting. Anyone else not a fan of the single character variable names?<p>Also, Is there a better way, in terms of clarity, to do this:<p>&lt;- c<p>Even with the comment I would think the developer forgot to fill in the first half of that and assume it was a bug.
评论 #7670261 未加载
solojavier大约 11 年前
Thanks for sharing this Matt.. really good insight.
wolfeidau大约 11 年前
Great post really enjoyed it.<p>Also a big fan of golang, loving the posts by people using it in anger.<p>Thanks