from Hacker News

Go is not an easy language (2021)

by psxuaw on 1/13/24, 9:54 PM with 34 comments

  • by dtdynasty on 1/14/24, 7:19 AM

    I was writing a more involved change in golang for the first time and was surprised to find golang didn't support higher order functions like map and filter. It's not a big deal to have to implement them in a custom for loop but for a language that sells on simplicity, I was surprised to find these missing. I guess I have a different idea of simple than the golang team.
  • by cryptos on 1/15/24, 8:01 AM

    Go is so minimalistic that it forces developers to reinvent the same things again and again. Just think about how common certain collection operations are and how easy they are in some languages (e.g. Java, Kotlin, C#, Rust), but in Go you'd write list and for loops like in the last century. This wastes developer time, makes the code harder to understand and adds chances for bugs.

    So, this cite applies to Go: “Everything should be made as simple as possible, but no simpler.”

  • by __mattya on 1/14/24, 2:23 PM

    Go is simple like C is simple. Add a garbage collector and concurrency and it’s easier to do some things but the simplicity of the language means you have to intimately understand more of the runtime to not shoot yourself in the foot.
  • by bborud on 1/14/24, 11:51 AM

    People tend to underestimate how much effort it takes to a) learn how to be a good programmer, and b) learn a given programming language. Sometimes they confuse the two.
  • by DoesntMatter22 on 1/14/24, 5:57 AM

    This has been my argument since I started using it. It's definitely simple but the easiest stuff can be such a pain.
  • by anacrolix on 1/14/24, 8:00 AM

    I feel like the argument is van to front here. Go is easy, the problem is it's not simple.
  • by HenriTEL on 1/14/24, 5:46 PM

    pop() would have been a much better example, as ruby providing delete_at is a mistake IMO, since it runs in O(n), chances are that you're using the wrong data structure. Go providing append but not pop is inexplicable
  • by t0mk on 1/14/24, 1:35 PM

    Just a side note, Golang has generics now: https://go.dev/doc/tutorial/generics

    Google says that only since Feb 2022, and the article was written in 2021, but I think it was a planned feature and if the author did some research, he'd realize that generics are coming.

  • by richrichie on 1/15/24, 3:40 PM

    I was quite unhappy when they added generics to golang. That seemed like a slippery slope to C++ or Rust like monster.

    I much prefer the pre generics Go. Crisp and compact.

    Go is like Prostaff 90 upgrade to the great PS 85. It is not the plasticky Babolat APD 100 that beginners love.