News for hackers. Stuff that matters.
Re:Toward Go 2 by ahacker15 on Thursday July 13, 2017 @03:27PM (#14764383)
I like that Go don't allows unused import and variables.

If you're working with inexperienced programmers (and some experienced but bad programmers), you should be certain that they WILL let that code garbage there if the compiler allow it.

Re:Toward Go 2 by Orangeair on Thursday July 13, 2017 @03:51PM (#14764585)
That's the kind of thing that should be detected by a linter and stop code submission though, not necessarily stop it from even compiling. What if you just want to comment something out quickly? I don't program in Go, but it seems like it would be annoying to have to repeatedly add and remove the main dependencies while I was iterating on something.
Re:Toward Go 2 by infogulch on Thursday July 13, 2017 @04:41PM (#14764994)
This problem is fixed by using the "goimports" tool that will automatically add and remove imports as they're used on save. Pretty much every editor supports it. With goimports and gofmt that formats code, I no longer have to think about formatting and imports at all until I git diff, the whole problem vanishes.
Re:Toward Go 2 by johansch on Thursday July 13, 2017 @06:11PM (#14765753)
It is absurdly annoying. It's the one thing that put me off golang development, despite all of its nice aspects relating to concurrency.

Having custom functionality in editors to work around this apparently dogmatic design decision in the core language.. is also just absurd.

Re:Toward Go 2 by johansch on Thursday July 13, 2017 @03:44PM (#14764507)
Funnily enough: I've never found that to be a big problem with other languages in practice. Actually, on a scale of problems in other people's code I'd probably put this very far down the list.
Re:Toward Go 2 by nuggien on Thursday July 13, 2017 @06:45PM (#14765962)
Have you worked with code where unused variables actually have a side effect?