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 love Go

241 pointsby dimonomidover 7 years ago

23 comments

w8rbtover 7 years ago
Nice read. I like Go a lot too.<p>As to the minimalism in Go, I wish it came with a few more default data containers.<p>Sorting a map by using a slice gets old after awhile. Why can&#x27;t I pick a sorted tree based map (like std::map or std:set in C++) or an un-ordered hash based map like std::unordered_set, etc.? Why do the containers have to be so minimal too?<p>This just leads to people rolling their own and many times, that leads to poor performance and other issues which ultimately reflect poorly on the lanaguage. I&#x27;ve seen more string implementations in C than I can count. Most of them were bad. I hope Go doesn&#x27;t end-up being like that.
评论 #15857091 未加载
评论 #15859142 未加载
评论 #15857009 未加载
评论 #15857226 未加载
pfarnsworthover 7 years ago
After working with it for a year, these are the things I don&#x27;t like about Go:<p>1) No constructors. When I create a struct, without a constructor, I can&#x27;t be 100% if certain fields are populated or not. With a constructor, I could force this. With a large number of people working on a code base, you can&#x27;t assume anything, unfortunately, but without a constructor to force exact data in a struct, it makes it more tedious to be sure.<p>2) Error handling is ugly and tedious. Not being able to get the type of an error makes it a lot more inconvenient. At least in our codebase, errors are almost string parsing, it&#x27;s ridiculous.<p>3) Nil map vs empty map is a very strange thing to keep in the code. Why even allow this distinction?<p>4) Named return parameters are really stupid. This is another thing that doesn&#x27;t fit the philosophy of what I understand Go to be. It forces a bunch of verbose opinionated rules on us, but then allows named return parameters which causes confusion.<p>5) It&#x27;s very hard to tell the difference between package names vs structs. Luckily Gogland allows you to change the color for package names so this helps me out tremendously, but there should be a better way to differentiate without relying on your IDE.<p>Overall it&#x27;s okay but nowhere near perfect and has some really weird deficiencies. The company I work for uses Go with dependency injection which I hate and I think is very ugly but a paycheck is a paycheck.
评论 #15857660 未加载
评论 #15857636 未加载
评论 #15857448 未加载
评论 #15857687 未加载
评论 #15857680 未加载
flavio81over 7 years ago
So far I fail to understand the excitement with Go.<p>Error handling in go feels like going back to 1960s programming.<p>Garbage collection is already implemented with high performance in Java and other platforms, what&#x27;s new? You can use GC with different strategies in C++ as well, if you like, the libs are there. There are many libs to get dynamically managed memory in C. But the author wants to program for embedded devices and my choice there would be to avoid dynamically managed memory for the most part.<p>Coroutines and tons of different concurrency and multiprogramming and parallelism paradigms and strategies are already available for most mainstream languages.<p>Syntax in Go looks like a poorly done copy of Algol-68 (1968, and -surprisingly- a more powerful language.) Why?<p>At least if they would have went with s-expression syntax, they would have enabled metaprogramming and this would have solved some of the problems with missing features.<p>As for use in embeddable devices, the author discards D and other languages for lack of portability to other platforms; but AFAIK embedded devices programming goes to very low level details and thus I can&#x27;t think how a code that is tied to the specific hardware would be portable, no matter what the language is.<p>I thought Google had smarter language designers. At least Mozilla did a decent effort with Rust. Perhaps Google do have smarter engineers and they actually use Julia, Lisp, and Smalltalk for Google&#x27;s internal projects...
评论 #15861442 未加载
评论 #15862028 未加载
评论 #15863656 未加载
评论 #15861387 未加载
评论 #15862461 未加载
评论 #15861296 未加载
diebirover 7 years ago
&quot;Go is a better* C&quot; It seems like Go is propelled into popularity by people discovering the joy of C&#x2F;POSIX programming for the first time.<p>Some of us remember, however, why we left C behind (it does not work beyond a certain degree of complexity). Why would I want to do Web programming in C? We spent years creating better tools for this.
评论 #15857489 未加载
评论 #15858567 未加载
评论 #15858411 未加载
0xCMPover 7 years ago
I love Go, but there needs to be some work around dealing with the problems the community is solving via code generation.<p>I feel like a lot of the things I find tedious about Go should be much easier to generate somehow so I can get on with what I was trying to do. sqlboiler is an interesting version of something that Go by-it-self can&#x27;t provide without code generation if you require not using reflection.<p>Otherwise, I like the language a lot. I mainly love it&#x27;s simplicity to deploy, good cli, and low memory foot print. I also like that it&#x27;s very easy to read, that the community is focused on &quot;reading code&quot;, and that there are many good libraries out there now in addition to the standard library.<p>Started looking at Scala recently, and I&#x27;ll probably play around with it, but it just seems Go is so much nicer to use for the kinds of projects I&#x27;m trying to develop.
评论 #15857730 未加载
评论 #15860782 未加载
rcarmoover 7 years ago
I agree that dependency management and GOPATH are two annoyances that need to go away. GOPATH in particular is a constant pain when you work across multiple machines like I do, and feels like a mandated anachronism&#x2F;catechism (your workspace must be like we want it to, and we don’t care about your own methods).<p>On the other hand, lack of proper vendoring, version pinning and getting random versions of libraries off GitHub makes a lot of people anxious about long-term reproducibility.<p>Like a peer of mine once said, “maven is forever. They don’t call things ‘artifacts’ for nothing, I can even do archeology in my dependencies”.
评论 #15859388 未加载
Will_Parkerover 7 years ago
&gt; On the cost of some repetition here and there, it makes programs look very explicit, which helps readers to understand the code better, instead of wondering: can the exception be thrown here or not?<p>I don&#x27;t get this. In practice, most functions end up having an error result by convention, so the answer to &quot;can the exception be thrown here&quot; is always &quot;maybe&quot;, which is the same as the answer would be to any function call in a language with exceptions...
评论 #15856901 未加载
评论 #15856948 未加载
评论 #15856927 未加载
s4vi0rover 7 years ago
It&#x27;s so strange seeing people who write these sorts of articles constantly praise Go&#x27;s error handling. In what world is doing the whole if err != nil thing every 30-50 lines not ridiculous?<p>I get that goroutines are great, but that really seems to be all Go has going for it. The GC sucks, error handling feels like something from a bad language designed in the 70s, missing generics, math library is awful, Rob Pike being super opinionated, etc.
评论 #15857090 未加载
评论 #15857606 未加载
评论 #15857412 未加载
评论 #15857579 未加载
评论 #15860728 未加载
评论 #15857178 未加载
评论 #15857541 未加载
jabbanobodderover 7 years ago
I often fell the same way about flag, recently I started using [go-args](<a href="https:&#x2F;&#x2F;godoc.org&#x2F;github.com&#x2F;alexflint&#x2F;go-arg#example-package--MultipleMixed" rel="nofollow">https:&#x2F;&#x2F;godoc.org&#x2F;github.com&#x2F;alexflint&#x2F;go-arg#example-packag...</a>) and so far I&#x27;ve found that it works a bit smoother.
评论 #15857240 未加载
评论 #15857208 未加载
greenhouse_gasover 7 years ago
Personally, I don&#x27;t like Go. I wish my projects needed Rust&#x27;s speed, or its safety, or its engineering powers.<p>But I don&#x27;t. For simple parsing or number crunching, Go is just right.[1]<p>I find the fast prototyping, the wonderful IDE environment (VSCode, vim), and the community to be _so good_ that I don&#x27;t need anything else.<p>There was a time I thought of learning Python[2] or Rust, but found both lacking.<p>[1]. Sure, I wish I was smart enough to get a job working on Quantum, working as a kernel dev, or in fintech where every nanosecond counts. But I&#x27;m not. The Rust community is great, there&#x27;s a lot of help out there, and it seems like an amazing and cool language.<p>[2]. I tried it out a bit. My main issue is that it doesn&#x27;t (didn&#x27;t) have nearly as good of an IDE community (PyCharm is practically the only good IDE for Python, and in the bit of time I spent with it, I found it much less powerful than their Java IDE) revolving around it.
评论 #15859002 未加载
评论 #15857794 未加载
froderickover 7 years ago
This is one of the more measured cases for golang I have read.<p>When it comes to my default set of tools, I gravitate towards dynamic, expressive languages that provide greater leverage rather than ones with fast startup times, c-like speed, native binaries, etc.<p>That said, when you need those things, I agree with this guy--golang has been a far better experience for me than any other language of its ilk. I&#x27;m not claiming it has magic powers like rust or a sentient type system like haskell, but I spent hours learning go fundamentals, and days figuring out how to get real work done with it. I can&#x27;t say that for many other languages with go&#x27;s compile and runtime capabilities.
partycoderover 7 years ago
Go is OK, but it was a bit mean of the authors to hijack an existing name for a programming language.<p>This was the pre-existing language: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Go!_(programming_language)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Go!_(programming_language)</a><p>Google reacted to the criticism saying there are many products named Go. Well... that&#x27;s a 2-way street. If there are many products called Go then why picking that name in particular?
评论 #15860302 未加载
1_2__4over 7 years ago
For me the biggest PITA lately with Go is dealing with json. Exhaustively listing every potential field in order to type it is maddening.
评论 #15857596 未加载
评论 #15857881 未加载
评论 #15860534 未加载
评论 #15864572 未加载
stevefan1999over 7 years ago
As a C-C#-C++-Java-ES2015+ guy, I found it hard to read and write in Go. :( Same problem goes for Python. (Not Ruby and CoffeeScript tho, I don&#x27;t know why)<p>I don&#x27;t think I&#x27;m alone. I need some hugs.
评论 #15859906 未加载
valuearbover 7 years ago
As I read this it made me wonder why I was still using Javascript to write my server code. Thing I always hated about it was the lack of types, and practitioners bleating to &quot;write unit tests&quot; instead. So much less efficient and effective. Even Typescript doesn&#x27;t seem like much of a fix.<p>Go sounds like Swift, strongly type compiled languages. Go has better concurrency features and likely compiles faster (I mean anything has to compile faster than Swift).<p>Swift still seems to have better, faster garbage collection, better language features such as generics, and optionals make error handling and writing safe code much easier.<p>But Swift doesn&#x27;t have the community and infrastructure around server development that Go does. I think I&#x27;m giving Go a go next project.
评论 #15858017 未加载
评论 #15858333 未加载
评论 #15858837 未加载
Kototamaover 7 years ago
&gt; Go is a better C<p>Setting the scale for language comparison to C (or Python) is setting the bar pretty low. There are so much better languages out there.
评论 #15859681 未加载
spyspyover 7 years ago
&gt; no way to know whether the flag was given by the user or the default value was assumed implicitly<p>I&#x27;m struggling to find a need for this. Flags define behavior, who cares if the behavior is explicit or implied from inaction?
评论 #15856582 未加载
评论 #15858378 未加载
zaarnover 7 years ago
Personally, I&#x27;ve written a lot of stuff in Go, it might not be a perfect language but it&#x27;s certainly the most fun one. I can sit down, write 1k LOC and have implemented something that I can look at in 10 years and still know what I&#x27;m doing.<p>It has it&#x27;s downsides but I love it despite those, errors could be better but it&#x27;s mostly fine and I&#x27;d love some generics so I could optimize my storage structures (though by using a backing array and referencing indices helps a lot)
zxy_xyzover 7 years ago
It&#x27;s a no-go for me. I like the lang but I make games and don&#x27;t like GC. Jai seems to be in the se direction as Go in other aspects though
dimpadumpaover 7 years ago
Go is sooo nice. Best thing ever, that google done.. Otherwise Google is not my best books at all..
mk89over 7 years ago
&gt; go is a better C<p>I am not experienced enough with go, but I would say the same. Not better maybe, but the modern C.
rishav_sharanover 7 years ago
I like go, but i can&#x27;t stand its package management
majewskyover 7 years ago
TIL that Bram Moolenaar has more than one project.