5 ms·
Go is a pleasure to use. The stdlib is one of the most complete, while keeping the keyword count low. LLMs understand it very well, project size stays low, line
by lagniappe 9mo ago
Go is a pleasure to use. The stdlib is one of the most complete, while keeping the keyword count low. LLMs understand it very well, project size stays low, line count stays low (if err nil included), doesn't need a bunch of scaffolded boilerplate in the project directory, and it compiles very quickly for a ton of OS and architectures. Very seldom do I ever need to go outside of the stdlib.
Is it perfect for everything? no. Is it the fastest compiled language out there? no. But, it'll do most things very well, and for me that's good enough. I choose go because when I need to make something, it steps aside and lets me build, and for that I have great respect and appreciation for it.
I will be defering all detractors and negative comments ;)
- themicahshell 9mo agoYou defer at the beginning, not at the end in Go. /jk
- lagniappe 9mo agoHey you caught that! I was hoping someone would notice the joke :)
- nh23423fefe 9mo ago> The stdlib is one of the most complete what does this mean? Go lib seems tiny compared to JDK. anytime i review some Go code from adjacent team i'm turned off by weird stuff like append and slices everywhere, as well as a bunch of strange string packages When I think of a massive stdlib I think of a language like groovy
- embedding-shape 9mo agoThen ask a JS web developer what "big standard library" would mean, and Go probably would fit somehow with that definition :) It seems to be very relative depending on where you come from.
- MobiusHorizons 9mo agoThe api surface is relatively small, but the capabilities you get from it (http serving, json parsing, crypto, in addition to table stakes like io, args, flags etc) are very high. Having a small api surface is why you need to use primatives so often, but the upside benefit to that is there is less domain specific knowledge, since you end up using familiar types and libraries in more of your code.
- CamouflagedKiwi 9mo agoWhen I use Go, I find I can get more real work done with only the standard library than with any other language I've used (including Java, although that was quite a while ago now). It may not have the most stuff, it is more focused - but I'm okay with esoteric stuff not being in there since the tradeoff seems to be that there are high-quality implementations of e.g. an HTTP client and server, crypto functions, a unit testing library, JSON en/decoding etc, which I can definitely use in production. Conversely in Java the answer seems to be to use BouncyCastle / Tomcat / Jackson / etc, so while there may be a big stdlib, it ends up being less useful.
- lemoncucumber 9mo agoPython's standard library seems comparable IME
- jonfw 9mo agoIn my experience, people building APIs w/ python are almost always using frameworks, while people building APIs w/ golang are almost always using stdlib
- lagniappe 9mo agoI would not agree with that assertion. Just off the top of my head, being familiar with both: - context - net/http as a full server framework, not just a request library - net/http/pprof - runtime/pprof - runtime/trace - embed - testing as the canonical, required test framework - net/rpc - net/http/cgi - net/http/fcgi - net/http/httptest - os/signal with integrated channel-based delivery - sync/atomic with language-aligned memory model semantics - runtime as a documented and supported API surface
- CamouflagedKiwi 9mo agoI've found it way more hit and miss in terms of quality. From some examples I gave: - JSON: Yup, stdlib is good here - HTTP client: There is urllib.request, although people maybe reach for requests more. - HTTP server: No, it's just some super basic thing (it's not even 'nice' to write for local dev). Would never let anything here near production. - Unit testing: Yes, I think unittest is pretty good (I actually like it a lot, and think pytest is overrated). - Crypto functions: No, not equivalent. There is hashlib but basically anything else you're pointed at pycrypto or cryptography with all the associated ecosystem nonsense (oh I need a Rust compiler now? Great...). The difference is Python _has_ all of these things in the standard library, but the quality is super mixed, and not all of them are suitable for real use.
- publicdebates 9mo agoI admit that it's nice to have a very simple, straightforward, and minimal build process. No dealing with VMs, no setting up environments, just install Go and then compile your program. Reminds me of C back in the late 90s.
- ternaryoperator 9mo ago> The stdlib is one of the most complete Coming from Java, I find the standard lib very small. A case in point is the collections library: arrays/slices, map, list, ring, and heap -- that's about as minimal as you can get.
- random_mutex 9mo agoIf you delve, pun intended, into the stdlib you'll find out it's a pleasure to run away from it.