News for hackers. Stuff that matters.
Re:Why I Don't Like Golang (2016) by lkramer on Wednesday June 12, 2019 @05:25PM (#20169478)
most of these seems reasonable, but they are not big enough for me to actively dislike the language.

The capitalisation is maybe the most annoying for me, I think it was designed with an IDE in mind (which would be able to automatic update all references), but I still find it a flawed design to have to touch potentially a lot of files, many places to change something from private to not private.

The problem with err has also bit me a few times. I don't like exceptions very much, but a solution like he suggests where a variable can only be ignore explicitly would solve it.

Go is not perfect, but for me there is nothing else better for microservices that I have come across.

Re:Why I Don't Like Golang (2016) by vorg on Wednesday June 12, 2019 @07:44PM (#20170500)
> The capitalisation is maybe the most annoying for me, I think it was designed with an IDE in mind

If you don't have an IDE, you can start by making all functions and methods private. When you know you need it public, wrap the private function with the public one:

    func myF(ana int) { /*do something */ }
    func MyF(ana int) { myF(ana) }
The same trick is often used for adding extra parameters to a function, except that the function body must be moved:

    func myG(a int) { myG2(a, 7) }
    func myG2(a, b int) { /*do something*/ }
Adding publicness to a function is like adding an extra parameter to it.
Re:Why I Don't Like Golang (2016) by _bxg1 on Wednesday June 12, 2019 @05:29PM (#20169523)
> where a variable can only be ignore explicitly

Like Rust :)

Re:Why I Don't Like Golang (2016) by lkramer on Wednesday June 12, 2019 @05:32PM (#20169551)
I keep meaning to check it out :)
Re:Why I Don't Like Golang (2016) by _bxg1 on Wednesday June 12, 2019 @05:34PM (#20169572)
I'm still pretty new to it and I've never used Go, but Rust seems to address most if not all of these problems, while serving many of the same original design goals of Go. Probably its biggest disadvantage is the learning curve/iteration speed: it doesn't make it easy to just hack things together, especially when you're first learning.
Re:Why I Don't Like Golang (2016) by weberc2 on Wednesday June 12, 2019 @06:13PM (#20169899)
Yeah, iteration speed is a pretty big blocker for adoption in a lot of domains. Go isn’t perfect, but it lets me get things done today. That said, I appreciate that Rust exists for safety/performance critical domains, and as Rust matures (e.g., as it’s async story solidifies and consensus emerges around various HTTP libraries, etc), it will be more competitive for general purpose application development. But I suspect there will always be a significant productivity gap.
Re:Why I Don't Like Golang (2016) by _bxg1 on Wednesday June 12, 2019 @06:17PM (#20169936)
I suspect that once I've better-internalized the borrowing mechanisms I'll be able to move at a reasonable clip in Rust. The build/package management environment is pretty batteries-included and "just works", and the syntax isn't particularly verbose, just strict. Once getting things to compile is no longer a debugging process for me personally, I don't really see any other intrinsic bottlenecks.
Re:Why I Don't Like Golang (2016) by nhooyr on Wednesday June 12, 2019 @07:56PM (#20170575)
Re:Why I Don't Like Golang (2016) by fwip on Wednesday June 12, 2019 @05:40PM (#20169627)
If you don't want to use an IDE to rename, consider the excellent `gorename` tool. It is integrated with plugins for most editors (vim, vscode and atom off the top of my head), or is easy to invoke from the command line.

Golint can enforce the "don't ignore errors" rule. I think it comes that way out of the box?