Live data from Hacker News

Why I Don't Like Golang (2016)

teamten.com

51–60 of 237 posts

Re: Why I Don't Like Golang (2016)

#51

> There’s no ternary (?:) operator. Every C-like language has had this, and I miss it every day that I program in Go. The language is removing functional idioms right when everyone is agreeing that these are useful. And everyone agreed so hard that it was removed from almost every modern C replacement (Rust, Nim, Zig, Elixir, Kotlin).

[deleted]

Re: Why I Don't Like Golang (2016)

#52
post #38
post #25

Earlier quoted context omitted.

What's even worse is getting companies to pay for this stuff. Getting a company to buy software to help you do your job is like pulling teeth.

In most cases you cannot use personal licence on a company hardware. JetBrains also have separation between individual licences and organization licences.

I'm not talking about the distinction between free non-commercial and commercial licenses. I'm just talking in general that it's tough to get companies to purchase any software.

Re: Why I Don't Like Golang (2016)

#53
another person who can’t get over his java stockholm syndrome in three (!) years

one particular thing that tells that is the attitude to interfaces:

while in java (and most languages) interfaces are used to tell which contracts a class implements, in go it’s reversed. you must declare interfaces to _require_ certain contracts, for arguments in your functions

for example:

type interface Operator { Operate(int, int) int }

func IntOparation(a, b int, op Operator) int { return op.Operate(a, b) }

this is a major difference highlighting the ownership boundaries: * when I write a package and rely on a 3rd party contract, instead of referencing it and adhering to it, I will copy-paste parts that I need to my package and be independent

Re: Why I Don't Like Golang (2016)

#54
post #5

They've fixed the import / modules situation to a point where it's usable and much improved, and generics have been added. However, the issue this brings up about structs / types not explicitly declaring which interfaces they implement is a real and unaddressed problem, especially in large codebases. The only tool that I'm aware of that finds implementations is GoLand, at steep JetBrains prices. Figuring out what typ…

Every major editor I can think of has a way to find out what implements an interface using guru (https://github.com/golang/tools/tree/master/cmd/guru). In VSCode, it's right-click -> Find All Implementations. vim-go has :GoImplements. Using go-mode, emacs provides go-guru-implements.

Re: Why I Don't Like Golang (2016)

#55
Agreed with the article, though obviously it’s a bit dated (especially around generics and package management).

My take is that Go is basically the new Java, with fewer abstractions and faster compilation. Although, the pre-Java 8 Java, before Java started to get a bit functional.

Like Java it’s a practical, imperative, statically typed, garbage collected language with very good performance. Also like (pre-Java 8) Java, it’s very verbose, doesn’t allow for much “elegance”, and many find it not very fun to write. But it is a pretty decent language for getting shit done.

Overall, I don’t really enjoying writing Go, but it’s not the worst either. I’d code in it if necessary, but wouldn’t chose it for a personal project. I just have more fun and am more productive writing code in concise, mixed OOP/FP languages like TypeScript or Scala, even if they don’t compile as fast.

Re: Why I Don't Like Golang (2016)

#56
post #19

> if I name my source file i_love_linux.go, it won’t get compiled on my Mac What the fuck?

Searching around a few blogs mention _linux.go files are only compiled on Linux. But I see nothing in the official documentation, will at least in my quick searches. It will catch someone out who uses BSD as an acronym for something in their domain model (Bulk Sales Discount?) then xyz_bsd.go doesn't compile.

https://pkg.go.dev/cmd/go#hdr-Build_constraints

  If a file's name, after stripping the extension and a possible _test suffix, matches any of the following patterns:

  *_GOOS
  *_GOARCH
  \*_GOOS_GOARCH
  (example: source_windows_amd64.go) where GOOS and GOARCH represent any known operating system and architecture values respectively, then the file is considered to have an implicit build constraint requiring those terms (in addition to any explicit constraints in the file).

Re: Why I Don't Like Golang (2016)

#58
post #7

Earlier quoted context omitted.

When developers who usually make 6 figures of money complain about $90/yr IDE price I just cannot help laugh. Actually it's even better... the price elevators down from $90 -> year2 90 - 20% -> year3 90 - 40%. Over three years that's like $150-$200 total and it will save you so many headaches. But that's a steep price? Are you kidding? Why do developers hate tools that cost money when they save them time and allow th…

Putting fundamental features of the language behind a price barrier at all will keep students and people who want to experiment with the language out of the ecosystem. This isn't a papercut, it's an intentional omission that has backfired and can only be fixed by tooling. If the only way to access an often necessary feature is proprietary, why not make the whole language proprietary at that point?

The language has a tool that does this, and every editor I can think of uses it (https://github.com/golang/tools/tree/master/cmd/guru), specifically implements.go if you're interested.

Re: Why I Don't Like Golang (2016)

#59
post #55

Agreed with the article, though obviously it’s a bit dated (especially around generics and package management). My take is that Go is basically the new Java, with fewer abstractions and faster compilation. Although, the pre-Java 8 Java, before Java started to get a bit functional. Like Java it’s a practical, imperative, statically typed, garbage collected language with very good performance. Also like (pre-Java 8) Ja…

The Scala ecosystem is super cool, once you're able to groc all of the neat stuff happening, sort the good tools from the bad, etc. Love http4s, scala-js, scalajs-react, doobie, cats, etc.

Re: Why I Don't Like Golang (2016)

#60
> Go doesn’t have exceptions. It uses multiple return values to return errors. It’s far too easy to forget to check errors...

Yes, because it is easy and predictable to track exceptions in nested try catches and hidden control flow.

Post reply on HN