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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Go Is a Shop-Built Jig

145 点作者 geetarista超过 10 年前

10 条评论

metafex超过 10 年前
Lack of generics seems to always be <i>the</i> argument against Go. I have been coding in Go for over a year now nearly every day and it really became an annoyance only once: CRUD operations in a web-service expecting JSON-objects. That&#x27;s literally the only time where the code-duplication was a problem for me.<p>Now, not everything else has been all good (mostly minor issues with community libs), but the one thing that never ceases to amaze me with go is that: You hammer out a few hundred lines of code, compile, fix those few syntax errors, compile again and 9 out of 10 times your code just works. The simplicity of the language is the key. It&#x27;s a tool that feels right and gets the damn job done.
评论 #8334621 未加载
sat超过 10 年前
Seriously, in good faith, I attempted to learn and write a simple web application in go.<p>I found it hard coming from a world where IDE support was available in other languages that do autocompletion and things like that and development just moves faster. In go, there is some level of support in sublime text, go for vim etc, but it is not nearly as full featured as say, IntelliJ. Want to learn about the javadoc - Command + J. Want to refactor code, much easier than in go. So tooling is a big problem I encountered.<p>Next in line is lack of reusable data structures. Sure, embedding of structs is supported, but lets see...what will you do with a person struct (name, age, gender) that should be part of a employee struct and also the executive struct. You have 2 options 1) copy paste the person struct fields into each of the other structs or 2) you have interfaces and implementations of those interfaces so you can only deal with it through interfaces using embedded structs. What we really want is a flattened struct (just like inheritance). Most time people use inheritance not because its the right thing to do for that piece of functionality, but because it allows easily flattening out a data structure so you have reuse of a common data structure with common properties across other data structures. This one killed it for me with go. I can&#x27;t reuse. I am not google to have loads of dollars and when I try to make things work, I need to be able to keep an eye out for bugs that can creep in with go where re-use is artificial or takes excessive work to get.<p>All in all, maybe go has its niche, but for a small shop that runs on scanty resources and needs to build robust and reliable applications, a heavy weight like Java or .Net is still ruling the roost.
评论 #8333255 未加载
评论 #8333086 未加载
评论 #8333256 未加载
评论 #8334329 未加载
评论 #8333981 未加载
评论 #8333917 未加载
kristianp超过 10 年前
This piece reminded me of &quot;Zen and the Art of Motorcycle Maintenance&quot;, with its talk of the practical qualities of the language through analogy to a shop-built gig.
dkarapetyan超过 10 年前
Notice the author would still rather use Swift when he&#x27;s doing fun stuff. I get this sentiment and more than once I&#x27;ve wished there were more constraints in the language to mitigate the damage some kid with a chip on their shoulder could do but it says something about the psychology of programmers, &quot;I know personally I&#x27;m good enough to do magical, wizardly stuff with all the cool stuff that Swift gives me but you, well, you need some training wheels so we&#x27;re gonna use Go for this project&quot;.<p>I don&#x27;t know about you but I&#x27;d rather work with people that understand the tools they are using and when it&#x27;s OK to do fun stuff and when it is important to exercise restraint and &quot;dumb it down&quot; for the good of the team. Using the language to solve the problem of uneven programmer ability feels a bit off. It&#x27;s something out of 1984. You can&#x27;t say &quot;great&quot; in Go you can only say &quot;good++&quot;.
评论 #8334339 未加载
评论 #8334852 未加载
评论 #8334215 未加载
评论 #8334320 未加载
评论 #8333913 未加载
评论 #8334520 未加载
bascule超过 10 年前
&quot;Go feels under-engineered because it only solves real problems&quot;<p>This belies a multitude of real problems Go doesn&#x27;t solve, like generics or preventing data races
评论 #8334217 未加载
评论 #8333890 未加载
评论 #8334853 未加载
评论 #8334375 未加载
ANTSANTS超过 10 年前
Props to whoever built this presentation software. With Javascript disabled, it gracefully degrades to a basic HTML page. Most others leave you with a single broken slide.
threeseed超过 10 年前
What is with Go supporters ? I don&#x27;t understand why if I don&#x27;t use Go then I am not solving real world problems and instead building over engineered monstrosities. Working in the enterprise features like exceptions and generics makes it easier to ensure consistency across the platform and our 20+ developers.
评论 #8333242 未加载
评论 #8333234 未加载
评论 #8334143 未加载
评论 #8333922 未加载
评论 #8334686 未加载
fineline超过 10 年前
But you can&#x27;t deploy your Go to iOS. Or your Swift to Linux.<p>I&#x27;m getting interested in Nimrod (or Nim as I think it&#x27;s planning to become). Compiles to native binaries via C, C++ or ObjectiveC. Even compiles to JavaScript. So it will run on all consumer and server platforms, on microcontrollers and in browser.<p>And it has generics, exceptions, macros, inheritance, and (optional, time-boxed) garbage-collection.<p>It&#x27;s a tiny community which hasn&#x27;t even managed to get a Wikipedia page to stay up, but I&#x27;m barracking for it.
评论 #8333655 未加载
评论 #8335568 未加载
评论 #8334594 未加载
chvid超过 10 年前
Am I the only one who is very confused by these examples?<p>A function named &quot;frobulate&quot; - what is frobulate? I dunno. The function calls: thingsToFrobulate, logit, cleanupOldest, processOld, doNewThing, cleanup and somehow FrobulatingMessage is set on the way.<p>Honestly; you can do the most clever functional programming in the world but if you naming is like this then your code is just going to be bananas.<p>And BTW: both Swift and Go are missing exceptions; I think those would be very helpful here.
评论 #8338925 未加载
lukasm超过 10 年前
I would switch from python to Go but<p>- Type system needs to be improved e.g. generic code<p>- Verbosity, duplication of code are painful<p>- Lack of functional features<p>- Tooling<p>- Maturity
评论 #8333904 未加载
评论 #8333746 未加载
评论 #8334351 未加载
评论 #8334256 未加载