Live data from Hacker News

I Love Go; I Hate Go

dtrace.org

11–20 of 329 posts

Re: I Love Go; I Hate Go

#11
post #10

The most frustrating thing for me, by far, is that Go won't let you import unused packages. When you are commenting stuff out to debug a program, or adding debug statements and removing them later, it constantly requires you to go back to the top of the file and comment out the unused libraries, only to uncomment them later when you've solved your problem. The fact that there is not a compiler flag to disable this be…

i was shocked by that at first too. Then I came to love it. It's sooooo go. Don't import stuff you aren't using. Don't declare a var and just leave it there un-used. When I go back to ruby and commit that crime, I see why golang did what it did. There's something magical about a golang program that will compile without error. It's worthy of checking in to git. And months later, there will be no unsed imports FOR SURE.

Re: I Love Go; I Hate Go

#13
post #10

The most frustrating thing for me, by far, is that Go won't let you import unused packages. When you are commenting stuff out to debug a program, or adding debug statements and removing them later, it constantly requires you to go back to the top of the file and comment out the unused libraries, only to uncomment them later when you've solved your problem. The fact that there is not a compiler flag to disable this be…

Can't you just also comment out the package import declaration?

Re: I Love Go; I Hate Go

#14
post #10

The most frustrating thing for me, by far, is that Go won't let you import unused packages. When you are commenting stuff out to debug a program, or adding debug statements and removing them later, it constantly requires you to go back to the top of the file and comment out the unused libraries, only to uncomment them later when you've solved your problem. The fact that there is not a compiler flag to disable this be…

You may want to configure your editor to use goimports: https://godoc.org/golang.org/x/tools/cmd/goimports

Re: I Love Go; I Hate Go

#15
post #10

The most frustrating thing for me, by far, is that Go won't let you import unused packages. When you are commenting stuff out to debug a program, or adding debug statements and removing them later, it constantly requires you to go back to the top of the file and comment out the unused libraries, only to uncomment them later when you've solved your problem. The fact that there is not a compiler flag to disable this be…

I think it depends on what you're using it for. On my day-to-day I'm working with absolutely massive pieces of software that have dependency trees that would literally make me cry if I stopped and thought about it too hard.

In that world, this sort of thing enforced strongly makes me much happier.

For random one-off hacking, yea, it'd be a pain.

Differing use cases lend cause to different tooling.

Re: I Love Go; I Hate Go

#16
post #10

The most frustrating thing for me, by far, is that Go won't let you import unused packages. When you are commenting stuff out to debug a program, or adding debug statements and removing them later, it constantly requires you to go back to the top of the file and comment out the unused libraries, only to uncomment them later when you've solved your problem. The fact that there is not a compiler flag to disable this be…

I use an editor plugin that adds and removes imports automatically. It works very well.

https://github.com/DisposaBoy/GoSublime

Re: I Love Go; I Hate Go

#17
GOEXPERIMENT=framepointer will be the default in 1.7, due out in a few days (see https://golang.org/issue/15840), so using tools like perf (and presumably dtrace) will be somewhat improved out of the box.

Edit: and the author mentions that at the end of the post. That's what I get for commenting before I've read the whole thing.

Re: I Love Go; I Hate Go

#18
post #10

The most frustrating thing for me, by far, is that Go won't let you import unused packages. When you are commenting stuff out to debug a program, or adding debug statements and removing them later, it constantly requires you to go back to the top of the file and comment out the unused libraries, only to uncomment them later when you've solved your problem. The fact that there is not a compiler flag to disable this be…

I use an editor plugin that adds and removes imports automatically. It works very well. https://github.com/DisposaBoy/GoSublime

It uses goimports for that.

Re: I Love Go; I Hate Go

#20
Weak opinions are what turn languages into unreadable mishmashes of overlapping mechanism.

Go's opinions were, for me, especially helpful while learning the language.

Post reply on HN