Live data from Hacker News

Why I Don't Like Golang (2016)

teamten.com

141–150 of 237 posts

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

#142
post #99

Earlier quoted context omitted.

This isn’t true. Go has a basic standard package list. https://pkg.go.dev/std

Another big area that is lacking is Go makes it so hard if you want to use something other than a primitive as a hash key (Rust is guilty of this as well, mind you). This is something that should come out of the box in any modern language in my opinion.

Maybe I misunderstood you, but you can use structs as keys of a map.

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

#143

Earlier quoted context omitted.

Rust has if/else (ternary) and match (N-ary) expressions, so it doesn't need a separate ternary operator. All of the other “C replacements” listed (which are a weird list for that description, especially Elixir, but whatever) have at least if/else-expressions, which, again, are ternaries.

Yeah if I can have decent pattern matching I can live without some other syntax sugars.

Have you met my friend.. erlang ?

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

#145
post #139
post #91

Earlier quoted context omitted.

If “pre-historic” means “doesn't take several minutes to start and require 8GB of RAM”, I guess that's a good thing.

I wonder how Turbo Pascal IDE managed to fit into 640 KB....

Because it wasn't based on bloatware liks Electron. And I guess the developers actually cared about performance because at that time they couldn't just assume that everyone has a powerful machine.

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

#146
post #138

Earlier quoted context omitted.

"IDE as tool for everything" is what's prehistoric, at this point.

Sure, some people enjoy being stuck with workflows born out of phosphor terminals.

Do you have any other workflow that allows so much programmability and composability while being lightweight and cross-platform?

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

#147
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…

> 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.

Alan Donovan's guru tool could do this, but it kind of broke with modules and it was never updated and deprecated in favour of gopls. I don't know if gopls added this yet (I never really found a use for it).

I don't think it's very hard to write a tool for this though; parsing Go code is fairly easy and the stdlib provides a decent API for it. I think you could have a functional tool in a day if you wanted to, although without any caching it might be a little bit slow on larger code bases.

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

#148

I'm still baffled by their decision around date formatting. https://www.godateformat.com/

I find 15:04:05 on Monday Jan 2nd 2006 a lot easier to remember than all those strftime %-verbs. I certainly don't see how "%B %e, %Y" is any better than "January _2, 2006". %B for what? Bonth name? And %e for "d for day plus one so %e".

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

#149
post #98

Earlier quoted context omitted.

True. In Kotlin you can go val foo = if (bar) "this" else "that" and you don't need two separate assignments.

For comparison, in Go it would be: foo := func() string { if bar { return "this" } return "that" }()

Bit of an odd use of an anonymous function IMO. Normally I'd write that as:

  foo := "that"
  if bar {
      foo = "that"
  }
Unless the assignment of "foo" is expensive, then you'd assign it in an else.

If you really want to, you can do it in a single line too:

  foo := map[bool]string{true: "this", false: "that"}[bar]

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

#150
post #138

Earlier quoted context omitted.

"IDE as tool for everything" is what's prehistoric, at this point.

Sure, some people enjoy being stuck with workflows born out of phosphor terminals.

So why don't you program in VR then? Why not generate CI jobs from an ML model?
Post reply on HN