TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why I Don't Like Golang

40 pointsby dlcmhalmost 9 years ago

9 comments

ianleeclarkover 8 years ago
AFter writing a few non-trivial projects (only thousands-ten-of thousands of lines), I&#x27;m starting to really understand every gripe about Go.<p>The standard library is very nice, but the language constantly feels like it&#x27;s working against me or I&#x27;m having to circumvent some intended feature (no generics, while not a problem in the beginning, has continually worn down on me). Besides that, reason 9 is a huge nuisance which needs to be resolved,
znpyover 8 years ago
One thing I&#x27;d like to see in Go, is the possibility to ask the compiler to not bother me for defined-but-not-used and&#x2F;or imported when doing prototypes.<p>You know, &quot;I just changed this little thing and I want to see what happens&quot;.
评论 #12358411 未加载
spepsover 8 years ago
The Go authors and contributors probably know a lot of those issues and how the community feels in general. However, they made a strong point not to change v1 to accomodate for changes like generics. We&#x27;ll see what happens with v2... one day.
ngrillyover 8 years ago
1. Unlike the author, I think using capitalization for exported identifiers is great. It&#x27;s hard to believe that having to name unexported constants &quot;entirely in lower case&quot; can be a &quot;recurring source of discomfort&quot;.<p>2. This is called &quot;structural typing&quot; and it&#x27;s one of Go&#x27;s greatest features. It looks like the author prefers &quot;nominal typing&quot;. Both approaches have their pros and cons. See <a href="https:&#x2F;&#x2F;golang.org&#x2F;doc&#x2F;faq#implements_interface" rel="nofollow">https:&#x2F;&#x2F;golang.org&#x2F;doc&#x2F;faq#implements_interface</a>.<p>3. Go by design doesn&#x27;t have exceptions. See <a href="https:&#x2F;&#x2F;golang.org&#x2F;doc&#x2F;faq#exceptions" rel="nofollow">https:&#x2F;&#x2F;golang.org&#x2F;doc&#x2F;faq#exceptions</a>. github.com&#x2F;kisielk&#x2F;errcheck can be used to make sure errors are checked everywhere (but I agree this is not ideal).<p>4. I don&#x27;t get that part. Sounds like nitpicking to me.<p>5. I don&#x27;t get it either. If there is a &quot;collision&quot;, you can use an alias. And I personally don&#x27;t like having to repeat fully qualified package names everywhere. On this topic, I prefer Go&#x27;s approach to Java.<p>6. Go has been designed to automatically generate code! A lot of tools do that all the time, the best example being gofmt. The compiler being strict is more an advantage than a liability for this purpose. But I agree with author about the issues created by packages sharing the same default name. Would be curious to know the advice of the Go team on this.<p>7. I mostly agree about missing the ternary operator, sometimes. But I don&#x27;t miss the code I read in other languages that abuse it. I&#x27;m 50&#x2F;50 on that.<p>8. I agree about sorting being &quot;clumsy&quot;. This is being worked on at <a href="https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;issues&#x2F;16721" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;go&#x2F;issues&#x2F;16721</a>.<p>9. I agree about Go not providing anything builtin or well-known for dependency versioning, but I completely disagree about vendoring. See <a href="https:&#x2F;&#x2F;golang.org&#x2F;cmd&#x2F;go&#x2F;#hdr-Vendor_Directories" rel="nofollow">https:&#x2F;&#x2F;golang.org&#x2F;cmd&#x2F;go&#x2F;#hdr-Vendor_Directories</a>.<p>10. Missing generics is probably the most talked topic about Go. I miss them sometimes. I keep hoping Go solves this one day. Here is Russ Cox explaining why Go doesn&#x27;t have generics today: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9622417" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9622417</a>.
评论 #12359004 未加载
评论 #12360651 未加载
regecksover 8 years ago
&gt; but its import system is actively hostile to vendoring<p>? It literally has built-in support for a vendor directory.<p>Great cover image though, I lol&#x27;d.
velodromeover 8 years ago
I wish the author mentioned a better Golang alternative. Rust?
评论 #12360658 未加载
评论 #12358370 未加载
评论 #12359739 未加载
评论 #12360321 未加载
评论 #12361540 未加载
评论 #12358307 未加载
pawaduover 8 years ago
#2 maybe, #7 for sure...<p>But the rest are either (A) it doesn&#x27;t work the way I want it to work or (B) I haven&#x27;t read the manual and it&#x27;s your fault.
评论 #12358070 未加载
评论 #12358006 未加载
评论 #12358268 未加载
lazyantover 8 years ago
# 4 &quot;This is all part of the “convention over configuration” movement. It’s fine for small projects but bites you on large ones, and Go was meant to address the problem of “programming in the large”.&quot;<p>Isn&#x27;t that the opposite? conventions (even ugly ones, or annoying ones) help with consistency across many developers or large projects.
fithisuxover 8 years ago
The only problem that makes me angry with Golang is that a pointer to a struct and a struct member can both be referenced with the dot &#x27;.&#x27;. For me it makes the code unacceptably non readable.