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.

Go is a terrible language (2020)

51 pointsby nassimsoftwareover 3 years ago

18 comments

bedobiover 3 years ago
The worst problem with almost all popular programming languages are null and shitty error handling, such that, when you call foo() where foo is String foo(){ blabla } you can get a String, null OR an exception&#x2F;hidden error response, but most compilers happily let you treat it as if it only ever returns a String. (What!!!?)<p>I hope some day null is no longer a thing, and that Functional Programming types like Option, Either, Try etc in the native libraries is the new default. (BTW, there&#x27;s really nothing &quot;Functional Programming&quot; about them, they&#x27;re just objects like any other in &quot;Object Oriented&quot; languages)
评论 #28823226 未加载
mftbover 3 years ago
This article is a poor choice for submission. He did a companion article that is the exact opposite, and a follow-up article a year later. The follow-up would be a much better choice. It gives links to both prior articles and his thoughts after a year of reflection - <a href="https:&#x2F;&#x2F;debugged.it&#x2F;blog&#x2F;20000-lines-under-the-go-cean&#x2F;" rel="nofollow">https:&#x2F;&#x2F;debugged.it&#x2F;blog&#x2F;20000-lines-under-the-go-cean&#x2F;</a> .
eyelidlessnessover 3 years ago
I’ve never written a line of Go, though I’ve read a fair bit. I was expecting to object to the criticism of its error handling but I ultimately agree. If you can return and ignore an error, that’s another way of saying throw&#x2F;raise. If error isn’t typed it’s no different from “anything can throw anything anywhere in the stack”. I had thought, not paying much attention to Go in particular, it must deal with this with something like an Either type. Even some language facilities to automatically unwrap Either and rewrap for callers if unhandled would be a great answer to the checked exceptions debate. But what I take away from this is errors in Go are just as amorphous as in JS but harder to find. That’s quite a feat!
评论 #28823271 未加载
评论 #28823169 未加载
klodolphover 3 years ago
&gt; ...functions don&#x27;t declare what kind of errors they return.<p>We&#x27;ve gone down this route with Java and my conclusion is that declaring the kind of errors a function returns is, for most users, just a pain.<p><a href="https:&#x2F;&#x2F;www.artima.com&#x2F;articles&#x2F;the-trouble-with-checked-exceptions" rel="nofollow">https:&#x2F;&#x2F;www.artima.com&#x2F;articles&#x2F;the-trouble-with-checked-exc...</a><p>My experience with Go is that decent libraries only have a small number of error return types, and then forward or wrap errors from libraries that they use. You can use errors.Is(), errors.As(), errors.Unwrap() to figure things out as necessary.
评论 #28823540 未加载
systemvoltageover 3 years ago
This post should not have been flagged. It is a completely valid criticism of Go. Author&#x27;s tone could have been better but I&#x27;d rather hear straightforward opinions and not polished speech to offend those that cannot defend Go. Personally, I am a huge fan of Go but these are some valid points.<p>Anyone supporting such flagging behavior is completely against the spirit of what made this place great. Please reconsider your actions and what flagging does on HN.
nassimsoftwareover 3 years ago
follow-up post : <a href="https:&#x2F;&#x2F;debugged.it&#x2F;blog&#x2F;20000-lines-under-the-go-cean&#x2F;" rel="nofollow">https:&#x2F;&#x2F;debugged.it&#x2F;blog&#x2F;20000-lines-under-the-go-cean&#x2F;</a>
评论 #28823179 未加载
评论 #28823178 未加载
评论 #28823187 未加载
teerayover 3 years ago
&gt; However, the larger problem is that functions don’t declare what kinds of errors they return.<p>They don’t need to. Static analysis (guru) can answer the question “what kinds of error can this error be?” There’s no need to go source diving as the author suggests.
评论 #28823075 未加载
ed_elliott_ascover 3 years ago
So the general complaints of the article is that go isn’t Java?
评论 #28823210 未加载
评论 #28838312 未加载
animexover 3 years ago
@dang will HN ever support code blocks in comments? pls.
评论 #28823096 未加载
评论 #28823089 未加载
BrandoElFollitoover 3 years ago
I am an amateur dev (for 25 years), using mostly Python. I was blackmailed by a friend to try Go.<p>Boilerplate, no exceptions, slices, ... all felt terrible.<p>And then I started to appreciate the typing and the fact that I had to give some thought about where to actually handle errors.<p>I know kinda like Go, except for the weird way maps are handled, and the lack of types in errors (compared to Python where it is fantastic).<p>There are certainly pros and cons (I am not a good enough developer to have advanced thoughts on that) but the cross compilation makes a lot of things easier when deploying self-contained executables.
nunezover 3 years ago
Make sure you read the OP&#x27;s follow-up before cargo-culting on the &quot;Golang bad&quot; ship: <a href="https:&#x2F;&#x2F;debugged.it&#x2F;blog&#x2F;20000-lines-under-the-go-cean" rel="nofollow">https:&#x2F;&#x2F;debugged.it&#x2F;blog&#x2F;20000-lines-under-the-go-cean</a><p>(I actually quite like Go, despite it being more difficult to write tests for than other languages, and error messages usually being very cryptic.)
NelsonMinarover 3 years ago
I don&#x27;t love that Go doesn&#x27;t have exceptions. But it was a choice made thoughtfully:<p><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> <a href="https:&#x2F;&#x2F;go.dev&#x2F;blog&#x2F;errors-are-values" rel="nofollow">https:&#x2F;&#x2F;go.dev&#x2F;blog&#x2F;errors-are-values</a>
评论 #28823632 未加载
mixmastamykover 3 years ago
The language is rough but the performance, tools, and deployment is top notch. That dichotomy was quite surprising to me.<p>If someone could write a &quot;coffeescript&quot; for it, perhaps a python+pascal love-child, while keeping the fantastic lower-level parts of go, I&#x27;d be all over it.
ohCh6zosover 3 years ago
The last two companies I have been at switches from other languages to Go. At this point I don&#x27;t see what people like about Go. This article touches on problems, but it is only the tip of the iceberg.
nassimsoftwareover 3 years ago
The thing with Go is that I find the syntax very ugly to look at however it is so convenient to install, run, deploy, make performant applications.
评论 #28823126 未加载
评论 #28823153 未加载
评论 #28823004 未加载
nobody0over 3 years ago
Is there possibility that go adds algebraic datatype and pattern matching? error handling will be nicer that way generally.
deltasixeightover 3 years ago
Go is an ugly language. Practical but ugly.
评论 #28823120 未加载
jgrant27over 3 years ago
<p><pre><code> Have you debugged.it ? </code></pre> Debugging seems to be the author&#x27;s coding philosophy which says it all.<p><pre><code> While I had over a decade of experience in other languages, such as Python, PHP, Java, etc. I found it extremely difficult to wrap my head around Go. </code></pre> This could be because the author&#x27;s introduction to programming and most of their experience has been with some very problematic languages.<p>Maybe it&#x27;s not Go that is a terrible language but just that the author is not a systems programmer who has worked with large code bases ?
评论 #28823231 未加载
评论 #28823247 未加载
评论 #28823202 未加载