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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Lies we tell ourselves to keep using Golang (2022)

342 点作者 reillyse6 个月前

66 条评论

devjab6 个月前
This article makes a lot of great points about the shortcomings of Go. I don’t think explicit error handling is one of them however. I’ve previously spoken about my loathing of exception handling because it adds a “magic” layer to things which is way too easy to mess up. From a technical standpoint that isn’t necessarily a good argument, but from a pragmatic standpoint and decades of experience… well I will take explicit error handling which happens exactly where the errors occur every day. You can argue that Rust does it in a more elegant way, and I prefer it for personal projects. For big projects with a lot of developers of various skill level joining and leaving I think Go’s philosophy is one of the sanest approaches to error handling in the modern world.<p>Staying in that lane. In my part of the world Go is seeing adoption that no other “new” language has exactly because of its simplicity. It’s not the best language, but it’s often the best general purpose language because it has a lot of build in opinions which protect you from yourself.
评论 #42243706 未加载
评论 #42243680 未加载
评论 #42243826 未加载
评论 #42244344 未加载
评论 #42243599 未加载
评论 #42243586 未加载
评论 #42243860 未加载
评论 #42243601 未加载
评论 #42244407 未加载
评论 #42244591 未加载
评论 #42252830 未加载
评论 #42243714 未加载
sureglymop6 个月前
Rust and Go are very different and I feel people want a middle ground that just doesn&#x27;t exist currently.<p>A garbage collected relatively simple language that compiles into a statically linked binary but has a type system similar to rust, rest types etc.<p>Syntactically, Gleam and Kotlin come somewhat close but not really. I like Rust but I do believe it is too complicated for many people who are capable of creating something but are not CS grads nor working as programmers. If you&#x27;re only gonna use the language every once in a while you won&#x27;t remember what a vtable is, how and when things are dropped etc. I understand that &quot;the perfect language&quot; doesn&#x27;t exist but I think both Go and Rust brought amazing things to the table. I can only hope someone takes inspiration from both and creates a widely usable, simple programming language.
评论 #42244421 未加载
评论 #42244966 未加载
评论 #42248588 未加载
评论 #42244507 未加载
评论 #42246031 未加载
评论 #42245082 未加载
评论 #42244717 未加载
评论 #42244356 未加载
评论 #42244499 未加载
评论 #42244887 未加载
评论 #42244782 未加载
评论 #42244259 未加载
评论 #42244293 未加载
KingOfCoders6 个月前
<p><pre><code> Go: &quot;I&#x27;m a simple language!&quot; User uses Go for some time. User: &quot;I hate you, you&#x27;re a simple language!&quot; </code></pre> Perhaps it&#x27;s because I&#x27;m 50+, I love a simple language.<p>I feel the &quot;critique&quot; is not very balanced, and I view judgements that are not balanced as weak, as everything in technology is about tradeoffs.<p>I of course come to a different conclusion: <a href="https:&#x2F;&#x2F;www.inkmi.com&#x2F;blog&#x2F;why-we-chose-go-over-rust-for-our-startup" rel="nofollow">https:&#x2F;&#x2F;www.inkmi.com&#x2F;blog&#x2F;why-we-chose-go-over-rust-for-our...</a>
评论 #42244526 未加载
评论 #42243931 未加载
评论 #42245829 未加载
评论 #42244518 未加载
评论 #42244309 未加载
评论 #42244612 未加载
评论 #42244982 未加载
spirit-sparrow6 个月前
I wonder what makes someone go such a great length to bash a language, any language. I say bashing, because even the few valid points in the post are not written in a constructive style. After all is there a language that can&#x27;t be criticised?<p>Is the post written to make one feel better having a failed a project the language? (It&#x27;s not me, it&#x27;s the language) Or is it the failure to understand that not everyone thinks &#x2F; works the same and what one finds unacceptably bothersome, others barely notice? Languages that do not cater for a real need would likely vanish on their own, they rarely need help.<p>As for Go, despite the differences compared to &quot;more sophisticated&quot; languages it works brilliantly for the projects I&#x27;ve encountered. I hope the author is not forced to work with Go though. For the rest of the community, we keep churning out services, giving our feedback to the Go team and seeing the slow evolution of the language without breaking our stuff in production.
评论 #42244673 未加载
评论 #42244726 未加载
评论 #42244712 未加载
评论 #42244934 未加载
评论 #42244593 未加载
评论 #42249361 未加载
评论 #42244600 未加载
评论 #42244736 未加载
impulser_6 个月前
Every time I work in a different language I&#x27;m always wanting to go back to Go even if it&#x27;s not the perfect language.<p>I just love the fact that it literally just works. You install Go, you download code, and write code that&#x27;s it.<p>No figuring out what version, runtimes, configurations, build tools, package managers to use. Just install and Go.<p>I think maybe Rust is the only other programming language that provides the same experience.<p>Maybe these are just lies I&#x27;m telling myself, but every time I use Python, Typescript, or Java I dread programming because I just want to write code and I&#x27;m often debugging things or figuring out related to configurations, package managers, build tools and versioning.
评论 #42244606 未加载
评论 #42271779 未加载
jchw6 个月前
Every time I read a critique of Go, I feel the same way: I&#x27;m still going to continue to use it anyways. The reason why I am going to continue to use it anyways is because while I understand that it has plenty of easily documented issues in theory (and that people regularly do actually run into in practice), I still find that it is one of the better programming languages in practice anyways. Some of the things that people commonly list as shortcomings I don&#x27;t agree with (I <i>like</i> the explicit error handling everywhere) and for other things... I often agree, but it doesn&#x27;t bother me much more than the shortcomings of other programming languages, of which there is certainly no shortage.<p>I guess I feel bad for people who are particularly sensitive to the areas that Go does not succeed in, because they are probably going to be complaining about it for the rest of their lives. The truth is though, I don&#x27;t use a bunch of rationale about what is the best programming language to choose which one to work on for a project, I choose a language that I feel works well for me, that I feel I can consistently write good software in, that feels, well, nice to work in. Being a person that values correctness, I do sort of wish that language could be something more like Rust, but for now, it&#x27;s just not, though it&#x27;s not like I hate Rust, it&#x27;s just not what I reach for in a pinch.<p>Enough has been written about how terrible Go is by this point. At least now I know what it&#x27;s like to have been a fan of PHP a few years ago! (That&#x27;s an exaggeration, but it&#x27;s not that big of one in my opinion.)
评论 #42243956 未加载
评论 #42243974 未加载
评论 #42243725 未加载
评论 #42244455 未加载
评论 #42243867 未加载
评论 #42244452 未加载
评论 #42243780 未加载
gnabgib6 个月前
(2022) Discussions at the time:<p>(130 points, 148 comments) <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=34188528">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=34188528</a><p>(748 points, 544 comments) <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31205072">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31205072</a>
elcritch6 个月前
&gt; I&#x27;ve started caring about semantics a lot more than syntax, which is why I also haven&#x27;t looked at Zig, Nim, Odin, etc: I am no longer interested in &quot;a better C&quot;.<p>Well the post rambles a fair bit, IMHO. The whole bit about Go being “accidental” is BS given that Rust is just as much “accidental” in its origin and design.<p>One thing stuck out to me is that Nim certainly isn’t a “better C”. It has a GC or you can use reference counting. You can use it as a better C if you really want.<p>Nim’s type system avoids many of the problems that Go has, though it’s not nearly as pedantic as Rust.<p>At the end of the day lots of software has been written and shipped in Go which runs fast, has minimal downtime, generally seems effective, and has minimal security issues. I’d argue (much) fewer software projects have been shipped in Rust. Firefox is still 95%+ C++.
评论 #42245629 未加载
afiodorov6 个月前
Not sure why Go is compared to Rust all the time, whilst most appropriate comparison is Java.
评论 #42243622 未加载
评论 #42243850 未加载
评论 #42245599 未加载
评论 #42243638 未加载
评论 #42243965 未加载
poulpy1236 个月前
It&#x27;s weird. At a time I was looking for a &quot;better&quot; python. Something simpler and safer than C&#x2F;C++ but faster than python and more importantly that can produce a single binary. So I looked at everything from Rust to obscure language like Hare.<p>Go should have been the obvious choice but for a reason I don&#x27;t understand I dislike its syntax. For Rust I understand: it uses a lot of special characters that aren&#x27;t easy to remember and to type with a non qwerty keyboards (plus other unrelated pain points). For the different lisp, it was the parenthesis and the reverse polish notation. But for Go, I&#x27;m unable to rationalize why I don&#x27;t like it.<p>For the anecdote, I settled on compiling my python code with nuitka. No speed gain that I&#x27;m aware of but I can now provides a binary. I&#x27;m also looking more and more at C# because of its progressing AOT compilation and although I dislike the verbosity of its base mode and the fact it&#x27;s so tied to windows.<p>I liked a lot nim and crystal but the small community was a barrier, although I&#x27;m really impressed by what nim is managing to do with such a small community and it may me think it&#x27;s an excellent language<p>(I will try to motivate myself to pick up one of the language I mentionned above also)
评论 #42244209 未加载
评论 #42247115 未加载
a-french-anon6 个月前
One of my biggest beefs with Go and dozens of other languages is: static typing without a sufficiently developed type system is masochism.<p>If I can&#x27;t get at least ADTs and parametric typing, give me gradual like CL.
atemerev6 个月前
I wish I could take the Rust pill like everyone else and be happy.<p>I am not a stranger to the programming world. I am fluent in Python, Java, Scala, Erlang. I can write acceptable Haskell and C++ and Common Lisp. I am well versed in functional programming (though I don’t hate OOP — it is still a good thing when done correctly, and I am a big fan of Smalltalk).<p>However, for some reason, I am completely unproductive in Rust. It always fights me. There’s always something I want to do (graph structures? spliced lists?), and it’s always “you don’t need that” and “it’s not the Rust way”. There’s always explicit lifetimes and you miss something and you need to rewrite huge swaths of your code. And nothing is refactorable. It’s not even a good functional language, there are no persistent data structures, and it’s a pain to make them, and no ways to express yourself functionally like I used to do with Scala.<p>But apparently, everyone and their dog like Rust and are insanely productive in it. What am I missing?
评论 #42244423 未加载
serbuvlad6 个月前
I love Go, so I am biased. However, the beautiful thing about Go is that it doesn&#x27;t even attempt to prevent classes of bugs by making them impossible. It&#x27;s a car with ABS but no lane assist, with power steering but no collision detection.<p>Out of all the bugs which Go permits I have yet to see one which could survive in production for some time without being discovered. Almost all of them would cause a failure the first time a segment of code is run.
评论 #42244023 未加载
Jare6 个月前
&gt; Evidently, the Go team didn&#x27;t want to design a language.<p>This excerpt should be enough for you to know if you will find the article insightful or useless.
评论 #42244113 未加载
misonic6 个月前
While the article raises some valid critiques, it often overlooks the fundamental tradeoffs that make Go successful in its niche. Go’s simplicity is not a flaw but a deliberate choice, enabling rapid onboarding and maintainable code for large teams. Its explicit error handling may seem verbose but ensures clarity and avoids hidden surprises common in exception-heavy languages. The complaints about ecosystem isolation and tooling ignore the fact that Go provides powerful built-in tools like pprof and dlv, which are better suited for Go’s runtime than general-purpose alternatives. Go isn’t trying to be Rust or Python—it’s a pragmatic tool for scalable, performant systems.
评论 #42243929 未加载
gregwebs6 个月前
I’m successfully using Go and agree with the author at the same time. For me it’s not a choice between Go and Rust- Rust is not as productive for high level code because every API maximizes performance.<p>Since this article was written Go introduced generics which does solve some of the complaints. The rest I mostly solve with linters, libraries, and conventions.<p>Go has a syntax that is well designed (arguably one of the best) if you’re aiming for familiarity with C style syntax in an imperative language. Other than that it’s a poorly designed language with by far the best engineering work having gone into things that aren’t actually the language per say (cross compilation, asynchronous runtime, GC, module system, super fast builds, etc). They wrote an ACM Queue article essentially stating that: <a href="https:&#x2F;&#x2F;cacm.acm.org&#x2F;research&#x2F;the-go-programming-language-and-environment&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cacm.acm.org&#x2F;research&#x2F;the-go-programming-language-an...</a>
cedws6 个月前
Go is just an evolution of C, it works at a higher level but shares many ideas. If you can’t appreciate the simplicity of C, then you probably won’t appreciate the works of Bell Labs, and I have lost all interest in the debate.
0x_rs6 个月前
CTRL+F &quot;rust&quot;, 24 matches, I had a feeling that would be the case. What does Golang, for the most part, have to do with Rust? I also find the following bit somewhat funny:<p>&gt;The success of Rust is due in large part to it being easy to adopt piecemeal and playing nice with others.<p>And as if Rust itself didn&#x27;t suffer from the same kind of imperfections one can find in Golang. So much for that &quot;nothing new under the sun&quot; back in 2012! But then it starts talking about the &quot;rust shills&quot; boogeyman, and one has to wonder if it&#x27;s not trying to justify one&#x27;s choices. (which is fine, anyway) And I agree wholeheartedly to each and every single one of the &quot;lies&quot; listed in the article, that you could very easily rewrite half of which to fit Rust, and the other half requires no changes to apply.
评论 #42246286 未加载
troupo6 个月前
Even async in Go isn&#x27;t that good, ultimately. You can&#x27;t monitor channels, you can&#x27;t properly react to errors, you can&#x27;t shutdown and restart them. A panic in a channel will kill your program. Etc.<p>It&#x27;s &quot;we learned about green threads and didn&#x27;t bother to learn anything else&quot; approach (also prevalent in many other languages)
评论 #42244516 未加载
im_dario6 个月前
I remember it took a me a bit of investigation to make Ruby call Go functions, but it wasn&#x27;t really hard: <a href="https:&#x2F;&#x2F;dario.cat&#x2F;en&#x2F;posts&#x2F;portal-between-ruby-and-go&#x2F;" rel="nofollow">https:&#x2F;&#x2F;dario.cat&#x2F;en&#x2F;posts&#x2F;portal-between-ruby-and-go&#x2F;</a><p>The argument about FFI and CGO was the most unappealing to me. If you really need to do that, it feels that at some point some decisions were made that weren&#x27;t the right fit for the project.<p>Also, I feel that many arguments in the article are potential pitfalls for unintended side effects I&#x27;ve experimented in other languages, like Ruby itself. Keyword arguments are nice, but I know that they&#x27;ve bitten me several times.<p>Go forces the developer to be explicit about their intentions, that&#x27;s why I also don&#x27;t find something bad that your struct functions need to have the pointer receiver. It can be annoying when you forget, but that&#x27;s what linters are for.
bvrmn6 个月前
&gt; I&#x27;ve started caring about semantics a lot more than syntax, which is why I also haven&#x27;t looked at Zig, Nim, Odin, etc: I am no longer interested in &quot;a better C&quot;.<p>A strange take. Zig, Nim and Odin are about fixing semantics not to bring syntax sugar.
SomeoneOnTheWeb6 个月前
The title lacks a (2022) Otherwise great article :)
gwd6 个月前
His criticisms include:<p>- No sum types<p>- Default zero values<p>- &quot;Go is an island&quot;: Fully integrated toolstack makes it easy to use the same tool top-to-bottom, but makes it difficult to use with any other project<p>None of those are lies; apart from the first, they all have advantages and disadvantages. Sure, there&#x27;s an advantage to forcing you to specify every value, but there are disadvantages too. And sure, there are disadvantages from Go being an &quot;island&quot;, but he lists some of the advantages right there in his post.<p>If those are deal-breakers for him, then sure, go use something else. But lots of us like the advantages more than we dislike the disadvantages.
fabian2k6 个月前
I liked the idea of a language with minimal syntax that is easy to learn and easy to understand because the code is forced to be straightforward. It didn&#x27;t work out that way to me in practice.<p>It&#x27;s a bit too low level for many use cases in my opinion, and that does get in the way somewhat. It also works against the &quot;easy to learn&quot; part unless you start with developers familiar with low level programming.<p>I also found some types of library code surprisingly difficult to read, especially when empty interfaces where used.<p>The standard library was great though, it covered stuff that others don&#x27;t and it just worked out of the box.
WesolyKubeczek6 个月前
The article is great. The bigger picture, of course, is that it’s always “pick your poison”.<p>On one hand, say, I love operator overloading, I love how Python does it (once you satisfy an interface, its operators Just Work).<p>On the other hand, I can appreciate the choice not to do it at all because half of the ecosystem will do it, and another half won’t. Also, it would require implementing function overloading, and it is a can of worms.<p>Or generics and rich type systems, which all come with their own tradeoffs. I hear that Rust cajoles you into tinkering with the type system, and wach tweak requires refactoring of more codebase than anyone would like (don’t take my word for it, it’s just what I heard from a few different sources). I know that Nim is so expressive that it can be annoyingly trivial to be too clever and run into a valid edge case that will make the compiler barf and die. Go sidesteps the issue by not wading into that territory, and that may be perfectly okay, albeit verbose.<p>It’s always picking your poison, so I guess check your tolerances and allergies so it doesn’t kill you before you get the job done…
评论 #42244150 未加载
rednafi6 个月前
I want to build things and could care less about intellectual masturbation. It was built for proletarians like myself. I like Go because it&#x27;s neither Rust nor Python. But I do understand that there are times when having some nice abstractions over common patterns doesn&#x27;t hurt. At the same time, Go has come a long way over the years.
neonate6 个月前
Should be called &quot;Lies we tell ourselves to keep Go-ing&quot;
fire_lake6 个月前
&gt; Because they&#x27;re Go experts, they know the cost of using Go upfront, and they&#x27;re equipped to make the decision whether or not it&#x27;s worth it<p>Well maybe not.<p>If I’m an expert in only Java 6, I might not be aware of all sorts of useful features that other languages have, such as sum types, traits, type inference… I only know one side of the trade off.<p>I might be vaguely aware of those ideas and dismiss them because I can’t imagine how they would fit in my Java 6 workflow.<p>And yet when some of them arrive in later Javas, I begrudgingly use them. Years later I can’t imagine how I ever lived without them!<p>We’ve seen this play out so many times.<p>Remember when lambdas were just for weird functional languages?
RandomThoughts36 个月前
The article is arguing that Rust is a better choice which is laughable. Go is a small GC-ed language. Rust is an obnoxiously complex language with strong emphasis on memory management. I don’t see any projects where you could legitimately hesitate between the two.<p>Truth be told I quite like Go. It’s small and simple. It does the job. You can onboard people on it quickly and in practice with the toolchain you don’t run into the issue mentioned.<p>Would I rather use Ocaml most of time? Of course but it doesn’t have the same ecosystem. Would I rather use Rust? Heck no, I’m not going to deal with the borrow checker and life cycles if a GC is fine.
bitbasher6 个月前
I have recently started to port a large codebase from Go to Rust. I thought it was going to take more code in Rust, but I have been surprised at how much less code it takes. As of right now, the Rust version is 60% smaller in terms of LOC.<p>I think a large part of this is due to error handling in Rust and the sugary `?` syntax which is so incredibly useful.. I can&#x27;t count how many times I have done the following in go<p>x, err := Foo()<p>if err != nil { return nil, err } &#x2F;&#x2F; or something like this<p>I&#x27;m pretty sure a large chunk of the LOC reduction was in that alone. Though, a large chunk is also some crates that make a lot of boilerplate go away (serde, serde_json, etc).
jamiejquinn6 个月前
Seems like Zig is actually meeting much of the writer&#x27;s expectations for good language design. Although I&#x27;m still not wholly convinced by it&#x27;s move from LLVM and hell-bent desire for incremental compilation.
baalimago6 个月前
&gt;After spending years doing those FFI dances in both directions, I&#x27;ve reached the conclusion that the only good boundary with Go is a network boundary.<p>It works perfectly well with stdin&#x2F;stdout as well, as seen in many LSPs
vander_elst6 个月前
Currently onboarding to go. For me personally, it&#x27;s too opinionated e.g. for: error handling, mutability, unit testing, naming conventions, lack of features like sum types.<p>As a new joiner, some things have a &quot;religious&quot; feeling, like: the go gods have given us THE language and we must use it their way, without questioning too much.<p>I have the feeling other languages are less opinionated and this allows for more ergonomics and comfort when developing.
评论 #42243835 未加载
alper6 个月前
Then why am I still messing around with Axum and friends and people using Go are shipping microservices like there&#x27;s no tomorrow?
voidhorse6 个月前
Go is great for a variety of projects. Smaller codebases, little cli tools, simple servers, etc. It has its quirks, as any language does, but it is foolish to write off an entire language when some of the very properties you dislike may actually be a good fit for the problem at hand.<p>When engineers focus on language features they focus on the wrong things. Yes, languages like Java and Rust are fantastic for large codebases because generics and strong encapsulation become especially important as the number of engineers working on a project scales. Contrarily, Go would probably be a million times better for a small project of one to three staff that primarily revolves around a few well-designed data structures and basic array manipulation. In this context, the more sophisticated features of a Rust or Java are actually hindrances and end up making things more elaborate than needed.<p>Languages are a resource and a tool, not an identity marker. Use the language that makes sense for your constraints. Programming is all about <i>modeling problems</i>. No language will do this for you and each one has features that help or hinder and some are better or worse form problems of different shapes. Learn about how computers and compilers actually work so that you are empowered to use a wealth of languages and can choose the best one for your project on rational grounds.<p>Or, you can embrace Haskell and use the only perfect programming language to have been thus far invented :)
PittleyDunkin6 个月前
I find it fascinating the extent to which language choice makes a programmer emotional looking around at these comments.
评论 #42244797 未加载
kazinator6 个月前
The argument that a language is inconsistent if it allows all structure members to be defaulted to zero, but does not default function arguments to be omitted such that they default zero, seems to me like someone climbing out on a limb, out of the window of lunatic asylum.
tomburgs6 个月前
&gt; and most importantly, you adopted a language that happened by accident.<p>Is the author implying that Go was created by accident?
评论 #42246346 未加载
bowsamic6 个月前
The author&#x27;s last post they referenced is a bit bizarre. I don&#x27;t think that some overly simplified and error prone std library APIs is a particularly compelling reason to dislike a language. I didn&#x27;t read the <i>entire</i> thing though because it was extremely long
mjevans6 个月前
There _are_ two problems with Golang that I _would_ like to wave a magic wand and fix if that was a power I had.<p>1) Sum types (E.G. C&#x2F;C++ union types) - Yeah, something similar to that should exist... it&#x27;s syntax sugar over #2<p>2) &#x27;casting&#x27; &#x2F; reshaping perspective on data ; as long as something has the same struct size a programmer should be able to tell the compiler &#x27;but this is actually that&#x27;. Which also implies a way of fixing the layout of a given data structure. I figure that&#x27;s why Golang doesn&#x27;t allow this already.<p>Yeah, 24 bytes (len, cap, pointer) per slice (dynamic array) has a cost, but if that really gets your goat use a fixed size array, or pointer&#x2F;reference to such [n]thing.<p>3) Seriously, for a slice, make it like a map, a pointer&#x2F;reference to a len,cap,blob - so that when I pass a slice by value I pass the WHOLE slice, not a COPY of len and cap and a reference to the slab. Current golang has the worst of all worlds with passing slices around, in that changes mutate, UNTIL it&#x27;s resized or manually copied. The current design has the behavior it does to support slices of slices, which requires the pointer to the blob. A more complex scheme of a container behind the slice, and references to that could also work, but would be an entirely different datatype.
评论 #42244986 未加载
kgk90006 个月前
The superpower of go is goroutines and channels. The kryptonite of go is its limited libraries. Go is a great choice for many concurrent applications. I couldn’t finish reading the article because it lacked focus.
icar6 个月前
I just want to say that I started working with Go a few months ago at my new work, and I&#x27;ve been disappointed. The type system doesn&#x27;t even have union types, and the implicit implementation of interfaces has caused a couple headaches that I would&#x27;ve never had with explicit languages such as Typescript (strict).<p>At this point, I prefer strict Typescript with very restrictive ESLint rules than Go. I don&#x27;t understand how this language was pushed for web servers, it lacks common constructions to represent very frequent data types in API design.<p>Also, the whole go func(){} and channels is nice if you are coming from a language with worse ergonomics (C?), but when doing multiple web requests to other places and wanting them to happen in parallel, it gets messy fast. It lacks a pretty abstraction -- I very much miss an await-like construction which uses wait groups under the hood.<p>So, I very much agree with the post. I like errors as values, though.
rd10006 个月前
It really does not matter. There are so many critical services running off of Go. You don&#x27;t wanna use it? Go to hell.
yapyap6 个月前
Okay so I’m wondering, if you’re not in the Golang universe yet, what language is better to start with learning?
评论 #42244193 未加载
评论 #42244268 未加载
jonathaneunice6 个月前
I see this false promise all the time: Simple tools are simple to use.<p>NO. Not necessarily. Use a handsaw to fell a forest if you like, or a hoe to till 1,000 acres. But I will not. Tool simplicity will come back to bite you if the task you&#x27;re trying to accomplish is complex or high-scale. And simplicity of design in no way correlates to simplicity of outcome, or of your workflow using the tool.<p>Golang has, to be fair, more going for it than just its relative simplicity. But in many ways the OG criticism rings solidly true. The &quot;we&#x27;ll do just enough language features and tooling&quot; becomes an abdication and an excuse in a complex world.
gigatexal6 个月前
So what’s the alternative then to go?
k_bx6 个月前
When the article started the part &quot;but Tailscale still uses it&quot; I almost felt watched
Sudheersandu16 个月前
One thing what i observed is any language you right ask AI to optimize in Rust..why its so much of a debate when scale comes. In 6months AI will make any rewrite possible with full context aware. So don&#x27;t spend your energy on things that can be done by machines and focus on things which u can get deep on for distributing the software.
iamcalledrob6 个月前
There&#x27;s a lot of valid critique of Go, but I&#x27;ve never found anything like it that lets me build lasting, high quality, bug free software.<p>Explicit error handling means that I actually think about and handle errors. No surprises in production. No random exceptions throwing deep inside some dependency. I&#x27;ve been running some Go services for years with no crashes.<p>The brain-dead simplicity means I am not tempted to waste time being clever.<p>The tooling means my code is trivial to build, even years later on a new machine.
voodooEntity6 个月前
Well, i feel like this is the 100th article i read about why golang is bad &quot;mkay&quot;.<p>For my personal background, i started with golang about 6 years ago and im using it mainly for private and open source projects.<p>Yes golang for sure isn&#x27;t perfect, but what language is tho? I think the major point is - the language you use should match your use case. If it doesn&#x27;t it will always feel &quot;bad&quot; or you will more likely tend to find points why the language isn&#x27;t perfect (for your needs).<p>Sure you could write a website builder in ASM or you can write an Operation System in Javascript - but why should you?<p>Just look at your use case - check your needs and decide what language fits the best.<p>If its golang? Fine use it. If its not golang, than don&#x27;t. But don&#x27;t take a language and try to match it on &quot;everything&quot; and than complain that it doesn&#x27;t do the job - because no language will.<p>Thats my 5 cent&#x27;s on this topic....
xlii6 个月前
So I’m completely new to the Go but I have very specific need and I couldn’t fit it anywhere else:<p>I want to orchestrate asynchronous, highly fallible tasks. I could use Rust but I feel I would drown in correctness of handling various edge cases over which I’d rather panic and wind down everything I can.<p>Elixir&#x2F;Erlang would also be an option, but getting it installed in specific version isn’t simple (and ASDF was guilty for long time of installing Elixir built on different OTP than defined one) and also problem lies in interacting with IOs, which also bring consequences.<p>And so, yeah, Go is simple enough so that I feel confident that if aj get hit by a bus there won’t be enough magic so that it won’t be picked up by someone and it… works.<p>After being in pull rope competitions with bash, sh, Perl and Python I have fun working with it.
kif6 个月前
My biggest problem with Go is readability of some projects. In many cases, the code is split across files in an unintuitive way, and you can only navigate with the help of an IDE.
akira25016 个月前
&gt; I&#x27;ve mentioned &quot;leaving struct fields uninitialized&quot;. This happens easily when you make a code change from something like this:<p>Really? Are you not using gopls? It absolutely will warn you about this. And the mutex case. And a lot of the other similar criticisms.<p>&gt; Go not letting you do operator overloading, harkening back to the Java days where a == b isn&#x27;t the same as a.equals(b)<p>In languages that have it I&#x27;ve never used operator overloading to produce anything good or that was obviously better than just using methods.<p>&gt; The Go toolchain does not use the assembly language everyone else knows about.<p>Honestly I&#x27;ve never noticed or had to care. And you can build plenty of things that don&#x27;t require CGO.<p>The whole &quot;gnostic&quot; tone in language articles on HN is becoming overbearing. There are parts of the language to criticize but couching it in this &quot;lies _we_ tell ourselves&quot; and somewhat kitchy writing that presents minor matters of taste as fully existential issues makes this an unsatisfying read.
评论 #42243774 未加载
optician_owl6 个月前
The worst thing - default values as a solution for absent values. What can go wrong with implicit value assignments?!
评论 #42247374 未加载
rob746 个月前
Oh well, here we go again... (2022)
jonathanstrange6 个月前
This is a silly article, though I can only speak for myself. First of all, language design is pretty much the last reason anyone should consider when choosing a language. For me as a solo developer who needs to get results in time, the main criteria for choosing Go were compilation speed, development speed, general tooling, and third-party support. Especially the latter is extremely important; I cannot develop all kinds of libraries like e.g. an Excel or Word document parser in-house, I have to use whatever MIT-licensed libraries that are there.<p>I&#x27;ve developed in all kinds of languages in the past: Pearl, Java, C++, REALBasic, PowerMOPS (a Forth derivate in the 90s), Ada, Rust, Python, Java, Racket and various scheme dialects, CommonLisp, ObjectPascal&#x2F;Lazarus, just to name a few. Out of these, REALBasic was by far the one in which I was most productive. Alas, it became unaffordable and the vendor lock-in really burned me. No more commercial languages or IDEs it is for me.<p>If Ada had a garbage collector, I would probably use it even though the development time is a bit longer. Likewise, I&#x27;d love to use CommonLisp and think it&#x27;s the best dynamic language. But it simply doesn&#x27;t have enough 3rd-party support, and I&#x27;d also be wary about how it runs on mobile platforms.<p>I&#x27;ve got to say I&#x27;m pretty happy with Go so far. Is it the ideal language for me? No, because full OOP with multiple inheritance would make my life much easier. But it works, is easy and fast to develop in, and the results speak for themselves. I have no problems with bugs. The explicit error handling may be a bit cumbersome but it forces you to think about and deal with every error, unlike people in languages with exception system who often ignore errors until so far up the call chain that they don&#x27;t even know what actually happened any longer. I don&#x27;t see the point of that. If you have an illegal state of an object it doesn&#x27;t matter if you call the object <i>nil</i> or <i>DefunctInstanceOfBla</i>, you&#x27;re going to have to deal explicitly with the illegal state.<p>Notably, C# was also in my final selection of languages. For my principal use case - distributed client&#x2F;server applications with GUI - Go&#x27;s GUI options were not so stellar and I was thinking about using C# instead. AFAIK, C# is very suitable and a great language, too. I decided against it because of the C#&#x27;s bizarrely complex runtime library situation and naming schemes (WTF?) and simply because I would have had to learn it first and already knew Go fairly well.<p>Beware the language aficionados and purists. I used to be one of them, too, advocating Scheme &amp; CL. However, in the end purely practical considerations are always more important. Programming languages are tools for getting things done.
vrnvu6 个月前
“An idiot admires complexity, a genius admires simplicity, a physicist tries to make it simple, for an idiot anything the more complicated it is the more he will admire it, if you make something so clusterfucked he can&#x27;t understand it he&#x27;s gonna think you&#x27;re a god cause you made it so complicated nobody can understand it. That&#x27;s how they write journals in Academics, they try to make it so complicated people think you&#x27;re a genius” ― Terry Davis<p>Please note, no offense intended, I just like this quote to describe Go success.
blixt6 个月前
I feel like the author is fed up with being disagreed with, yet makes very opinionated statements about how others should (or will, at some point in the future) feel. They make good points about problems in Go, but I gotta say they also make a lot of points that might never become a problem at all.<p>I&#x27;ve written code that runs in production for 20 years now and every language I ever shipped software with, from ASP, PHP, and C# to Swift, TypeScript and Rust, one thing is always true: there&#x27;s a pretty good reason the language was picked, and yet a long list of grievances. The reason a language is picked is most often productivity, some belief that software will ship more safely and often if we pick this language. Of course that belief can be uninformed and proven wrong later. But it&#x27;s really hard to say, for any language, that &quot;you will regret picking this language&quot;.<p>Sure maybe you shouldn&#x27;t pick PHP for your new startup backend because you&#x27;ll have a harder time finding developers. Maybe you shouldn&#x27;t pick Python because despite asyncio there&#x27;s still that one call you accidentally did that will lock up your highly concurrent service. Maybe you shouldn&#x27;t pick Java because it&#x27;s got verbose factories and something about billion dollar mistakes. Possibly picking Rust is a mistake because your developer team will spend 80% of their time fighting the borrow checker. Picking Swift to do your backend seems rather odd, and C++ is too risky with all its undefined behaviors and segmentation faults. Beware of Node.js unless you&#x27;re ready to dedicate beefy RAM instances to it.<p>That is of course all hyperbole, I&#x27;ve seen productive code in all of the above languages. And I should add that many of them were not designed any more than Go was, to address one of the author&#x27;s concerns. I&#x27;ve picked Go many times since it hit 1.0 and I don&#x27;t regret it, even with production code that is over 10 years old. Go does concurrent processes and I&#x2F;O really well. The GC works very well for long-running programs with lots and lots of individual goroutines. I also saw developers that had never touched Go enter the code base and make productive edits, which I consider a benefit of Go&#x27;s simple design (or non-design, as per the author). I&#x27;ve also done similar systems in other languages, especially Node.js, Python, and Rust, but they haven&#x27;t been as productive in my experience for this use case.<p>Ironically code written in Rust did wake me up in the middle of the night more than Go did, possibly because it was harder to express the mental model the way originally intended, and instead the code was written to satisfy the computer&#x27;s memory model. I would still use Rust every day for things where that matters more, but the author seemed to imply somehow avoiding Go avoids unexpected errors, but they happen in every language.<p>TLDR: Programming languages live on because they make people feel productive. Maybe this feeling is aligned with the business needs, maybe not. But don&#x27;t go saying that everyone should avoid a language entirely because of your personal experiences.
评论 #42255304 未加载
Mawr6 个月前
Context for those unaware: This article was a response to a 2022 HN thread [1] about the original article of the author&#x27;s. Then the following discussion happened: [2].<p>First off, let&#x27;s appreciate the fact the author has managed to write this humongous article in a day. That&#x27;s some writing skill.<p>And indeed, leveraging writing skills to unleash a flood of words in order to overwhelm anyone trying to respond is just the first tactic of many used by the author to sound more convincing, which is going to be the point of my post. I&#x27;m going to analyze each rhetorical device, fallacy, and bias present in the article.<p>&gt; The author is a platypus<p>The point of this paragraph is not to present any arguments, it is devoid of them, but to elicit sympathy from the reader for the poor author who is clearly getting ganged up upon. Comments in the referenced HN thread did not in fact attack the credentials of the author in any way. See Appeal to pity [3].<p>&gt; Mom smokes, so it&#x27;s probably okay<p>Lots of words here, but the gist of it is:<p>&gt; Or you can be horrified, as you realize that those complex problems only exist because Go is being used. Those complex problems would not exist in other languages, not even in C, which I can definitely not be accused of shilling for (and would not recommend as a Go replacement).<p>Setting aside the validity of the technical arguments, the tactic used here is to imply that since certain other languages don&#x27;t have the specific mentioned problems, they are strictly superior. In reality, had another language been used, the Tailscale team would simply be dealing with different problems. To riff off the C example, if Tailscale used C, they&#x27;d be dealing with memory safety issues instead.<p>&gt; The good parts<p>A clever attempt at a lie of omission. First we list a tiny subset of the pros of Go, then we claim that this tiny subset is not enough to make up for the numerous cons. See Cherry picking [4] and Straw man [5].<p>&gt; And since, just like C and Java, you do not get to decide what is mutable and what is immutable (the const keyword in C is essentially advisory, kinda), passing a reference to something (to avoid a costly copy, for example) is fraught with risk, like it getting mutated from under you, or it being held somewhere forever, preventing it from being freed (a lesser, but very real, problem).<p>Here we see a thinly veiled reference to the main bias behind the article. Can you guess what language the author is implicitly talking about here?<p>&gt; Go is an island<p>Nothing really interesting here, but it&#x27;s worth noting that, just like the majority of arguments presented so far, this largely applies to most languages out there (but of course not to the language we&#x27;re <i>really</i> talking about here).<p>&gt; All or nothing (so let&#x27;s do nothing)<p>The thrust is another strawman, quite simply nobody argues this: &quot;It&#x27;s not like you can prevent all problems anyway.&quot;.<p>This section is only a lead-up to the next one anyway...<p>&gt; &quot;Rust is perfect and you&#x27;re all idiots&quot;<p>Huh, why do we suddenly have a tirade about Rust in what&#x27;s supposedly an article on Go? If you correctly guessed earlier that this entire article is actually about Rust, congratulations.<p>&gt; Folks who develop an allergic reaction to &quot;big balls of mutable state without sum types&quot; tend to gravitate towards languages that gives them control over mutability, lifetimes, and lets them build abstractions. That those languages happen to often be Go and Rust is immaterial.<p>Wait a second, language*s* with sum types, control over mutability, and lifetimes? So, Rust, Rust, and Rust?<p>&gt; Because function signatures don&#x27;t tell you much of anything (does this mutate data? does it hold onto it? [...]<p>Only Rust is good enough, we get it already.<p>---<p>Overall, we have quite a few strong technical points here that could have made for a compelling article, but they&#x27;re marred by copious use of fallacious arguments and blind fanboyism for a certain language.<p>---<p>[1]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31191700">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31191700</a><p>[2]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31205072">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31205072</a><p>[3]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Appeal_to_pity" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Appeal_to_pity</a><p>[4]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Cherry_picking" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Cherry_picking</a><p>[5]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Straw_man" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Straw_man</a>
评论 #42247919 未加载
edf136 个月前
Erm..<p>&gt; As it happens, I am not a junior developer, far from it. Some way or another, over the past 12 years,<p>I&#x27;d say that&#x27;s isn&#x27;t too far from it to be fair.
ThinkBeat6 个月前
[meta] Does anyone else color schema? I found the blue links hard to read with the dark background.<p>Or maybe the links are left to the default for the browser to decide.<p>Either way I would prefer an easier to read color.
Saphyel6 个月前
Golang it&#x27;s a huge career mistake. You can comeback in 5 years to this message to confirm the obvious.
amai6 个月前
Sorry to spoil the party, but the future is mobile and none of your favorite programming language ( Rust, go, Python, Nim, Lisp, Zig, Smalltalk ...) is ready for this. The future will be Kotlin, Swift and Javascript and I already hate it.
评论 #42265324 未加载
评论 #42249318 未加载
shikck2006 个月前
The author clearly does not weigh in on the &quot;whys&quot; some things work in Go like they do.<p>So, adding an extra struct field results in the base value, and by design this <i>should</i> be used as a base default. The go proverb make base values useful goes hand in hand.<p>Obviously functions are not the same. And calling function with the wrong args is a compile time error. There is also CI check that check for this use case.<p>Overall this seems like a comparison to Rust, and its obvious they are not same same. Apples to Oranges.
评论 #42244460 未加载
voidUpdate6 个月前
I really wanted to like go, and I tried to write a discord bot using it, but the very opinionated brace style (which isn&#x27;t the one I prefer to use), and the fact that I struggled to much to try and split my code across two files kinda turned me off it. In the end I just went back to python
评论 #42243863 未加载
评论 #42270448 未加载
评论 #42245678 未加载
Sudheersandu16 个月前
AI can rewrite any dream code which u write and putting ur brain on that is pure seless way of pointing start with some island as you pointed get to scale and in 6months every code can be rewritten how many ever time u want..tokens will be so affordable to run full context code base shift..don&#x27;t worry about it just focus on distribution for ur product with the code you right..thats a good thing to worry about.