[HN Gopher] Why you should use Go
___________________________________________________________________
Why you should use Go
Author : thunderbong
Score : 40 points
Date : 2024-10-23 17:11 UTC (5 hours ago)
(HTM) web link (mortenvistisen.com)
(TXT) w3m dump (mortenvistisen.com)
| zxilly wrote:
| The parts of Go that make the most sense to me are the default
| static linking and the easy cross-compilation. rust does part of
| this, but C-dependent crates are easy to introduce (e.g. openssl-
| sys) and directly cause cross-compilation to be a disaster.
| dlachausse wrote:
| What do people use for authentication in Go web applications? To
| me that's the big missing piece. Just about everything else is in
| the standard library.
| perryizgr8 wrote:
| I wrote my own. I know you're not supposed to do it, but I
| copied the django implementation as best I could so its
| probably OK. It's not much work actually.
| lormayna wrote:
| Exactly, I am looking for a suitable authentication library in
| go since long time, but I cannot finding anything. Things like
| authboss are not really usable at all.
| rareitem wrote:
| Not a library, but you can use Lucia auth (https://lucia-
| auth.com/) as a guide to make an auth system yourself
| wg0 wrote:
| Check authboss, casbin and casdoor.
| ffo wrote:
| Depends on your needs but Zitadel can do that for you.
|
| We also have a good oidc library that helps you plug into
| systems that support open id connect.
| foolfoolz wrote:
| go has excessive verbosity, poor error handling, rough edges for
| package/dependency management, and forces you to use interface
| for too many things.
|
| it's not a bad language, but i would not choose it for a new
| project or base my company around it
| grouchypumpkin wrote:
| I'm really curious, which language is better than Go in those
| regards?
|
| Because I find Go is better than Javascript/Typescript, Java,
| Python, C++, C# on all of those.
| wbl wrote:
| Most people would regards Standard ML as having some very
| sophisticated ideas in this regard.
| codr7 wrote:
| C# runs circles around Go, imho.
|
| What is it you find better in Go?
| throw4950sh06 wrote:
| Go is limited. There are too many ways people in my company
| can fuck up C# code, it's much harder to spend time moving
| around letters with Golang.
| codr7 wrote:
| Sure, that's a risk.
|
| But force feeding everyone Go is worse.
|
| Code reviews would be a more constructive approach to the
| same goal.
| throw4950sh06 wrote:
| I can't code review every one of 150 devs under me. I
| can't depend on heroes saving the day. Heroes go do their
| own thing eventually.
| foolfoolz wrote:
| if you think you need to code review for 150 people or
| your code base will get out of control then it sounds
| like there's bigger problems going on
| foolfoolz wrote:
| java and c# are great choices
| umanwizard wrote:
| It's surprising you didn't mention the most popular language
| to be invented in the last several years, which while having
| its own flaws, is superior to Go in all the areas OP listed.
| groone wrote:
| All of these points apply to modern dotnet as well
| teqsun wrote:
| "because you want to work for Google" /s
| umanwizard wrote:
| I can't stand go. It is painful and annoying to write compared to
| almost any modern language. Yes it's simple, and makes it easy to
| write concurrent programs using one particular style of
| concurrency, which are about the only good things anyone can say
| about it.
|
| The proponents of go seem to have an almost cult-like devotion to
| simplicity. They think adding any facility for abstraction makes
| a language into a complicated mess like C++, and any type system
| feature that didn't exist in C makes a language into an ivory
| tower academic plaything like Haskell. The way the author talks
| about spending all day writing a perfectly beautiful, inscrutable
| piece of Rust code is an example of that. Yes, there are a few
| things in rust that are a bit harder to understand, but not to
| such an exaggerated extent, and that strawman is really not the
| typical experience when writing Rust. It's very unusual for an
| experienced user of any mainstream language (except C++) to have
| any real difficulty understanding what a given piece of code
| does.
| silisili wrote:
| I guess I'm part of that cult as I value simplicity greatly.
| Heck I was even against generics and iterators, though the
| former has grown on me a bit.
|
| One question I ask in earnest, why do people not just use
| another language rather than try to get features jammed into
| Go? There are so many good ones out there now, it feels like a
| person can choose something to their own liking.
|
| If it's being forced at work, I guess that makes some sense,
| but I'm also a big proponent of 'when in Rome.'
| umanwizard wrote:
| [delayed]
| mbvisti wrote:
| For the record, I love Rust. It's an amazing language and my
| example was not meant to discourage the use of Rust. But, it is
| verbose and generally takes longer time to write and understand
| compared to Go. For most projects, Go simply fits the bill for
| speed of development, ease of use, onboarding new people and
| performance.
| xyzzy123 wrote:
| This horse has been long flogged to death.
|
| My list: Mostly fits in my head, gc, not horribly slow, boring
| concurrency, low effort cross-compilation, good distribution
| story.
|
| It's contentious but I like the "low abstraction ceiling". Go
| punishes people who want to turn everything into a framework or
| abstraction and rewards people who just knuckle down and write
| the code that solves the actual problem instance.
|
| Is it the "best" programming language on any single axis?
| Absolutely not. Are the ergonomics right for getting stuff done?
| Yep, at least for this commenter.
| zactato wrote:
| They really committed an original sin by omitting generics in
| early versions of Go, it was added in more recent versions, but
| too late IMO.
| p2detar wrote:
| Starting a new side gig with Go next month and I'm pretty
| excited. It'll be my first big Go project. I'll be using htmx to
| handle FE stuff and I'm still discussing with the UX designer
| (they use Webflow) if we can somehow take htmx into account at
| design time. MySQL as db (customer's choice), so let's see how
| that stacks up.
| pipeline_peak wrote:
| What exactly does Go have over C# other than being "sexy" and an
| emphasis on minimalism?
|
| I've watched from the sidelines over the years. I hear more
| people talk about it than use it.
| bsaul wrote:
| i'm at my point in my career (20 years xp) where i think every
| project should be built around pure functions and structs, sorted
| in modules. And _only_ once you 're sure there absolutely no
| other choices, add a bit of interfaces, class and inheritance.
| Which, imho should happen extremely rarely.
|
| I've come to realize that the amount of useless abstractions we
| add just because the language lets us, instead of thinking more
| deeply about what exactly is the problem we're facing, is just
| insane.
| mbvisti wrote:
| The author here, thanks for posting this. I can see a lot of
| people not agreeing with Go, that's fine, I still love writing it
| everyday. Taking choices away from you in terms of language
| features enables you to focus on the problem you're solving. That
| makes it a great choice to me.
___________________________________________________________________
(page generated 2024-10-23 23:01 UTC)