Live data from Hacker News

Alan Donovan and Brian Kernighan Answer Questions on Go

features.slashdot.org

21–30 of 110 posts

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#21
post #6

> In general, Go strongly encourages being explicit about errors. That's completely incorrect: it's trivial (and common) to just ignore errors in Go: ok, _ := Foo() Checked exceptions don't let you get away with this kind of sloppy programming.

Even beyond that is:

    var foo *bar
    foo.Baz()
Accidentally dereferencing a null pointer in Go is dangerously easy

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#23

The recently open sourced VSCode also has Go support now. Good first impression. The docs and type inference stuff are more convenient compared to the oracle plugin + GoSublime for sublime it seems.

From trying it out, what does this new support have that LiteIDE does not?

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#24
post #9

The recently open sourced VSCode also has Go support now. Good first impression. The docs and type inference stuff are more convenient compared to the oracle plugin + GoSublime for sublime it seems.

I thought it was just syntax highlighting. Any link documenting VSCode's Go suppport?

Found it: https://github.com/Microsoft/vscode-go

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#25
post #6

> In general, Go strongly encourages being explicit about errors. That's completely incorrect: it's trivial (and common) to just ignore errors in Go: ok, _ := Foo() Checked exceptions don't let you get away with this kind of sloppy programming.

Even beyond that is: var foo *bar foo.Baz() Accidentally dereferencing a null pointer in Go is dangerously easy

Actually that doesn't dereference a nil.

https://play.golang.org/p/cjmflMBhF7

Why not learn the language before criticizing it?

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#27

I never knew that the decision to not have versioning built into go was because of the diamond dependency problem. This makes a lot of sense now that I think about it. I wonder what alternatives to manually versioning things the go team is considering. Also, at the beginning the Go team wasn't all that enthusiastic about an IDE, but its great to see that Go will get an IntelliJ grade IDE soon, so that works for me :)

Everyone seems to overlook this, but Go has had LiteIDE for a very long time and it keeps getting better.

I thought the same. I use it every day and its great. I dont understand why it doesn't get more traction.

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#28
post #14
post #6

> In general, Go strongly encourages being explicit about errors. That's completely incorrect: it's trivial (and common) to just ignore errors in Go: ok, _ := Foo() Checked exceptions don't let you get away with this kind of sloppy programming.

> Checked exceptions don't let you get away with this kind of sloppy programming. They sure do. Just write your Java code without a try/catch block anywhere, or just have your catch do absolutely nothing. You can do it, trust me. Exceptions don't stop programmers from doing anything.

Just write your Java code without a try/catch block anywhere

The point of checked exceptions is that you can’t do that. It is a compile-time error to not either catch the exception or explicitly indicate that you will propagate it.

Unfortunately, at least in Java, that style proved too onerous for a lot of programmers and motivated the catch-all, do-nothing wrapper idiom that is completely unhelpful as far as safety goes.

Exceptions don't stop programmers from doing anything.

At least in principle, you can statically detect any failures to handle possible exceptions if you have a suitable type system. Of course, if you just hack around those warnings, as we’ve seen Java programmers do with checked exceptions and catch-alls, then you’re no better off than if you ignored a relevant return code in the first place (aside, perhaps, from making it much more obvious to a static analyser or during a code review that you are doing so).

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#29
post #6

> In general, Go strongly encourages being explicit about errors. That's completely incorrect: it's trivial (and common) to just ignore errors in Go: ok, _ := Foo() Checked exceptions don't let you get away with this kind of sloppy programming.

Although a lot of people are pointing out (correctly) that it's trivially easy to ignore a checked exception, it does at least do two things:

1. Signal to the calling programmer that some error condition can occur. For example having to catch SomethingNotFound tells them that it's possible that Something might not be found.

2. You just put in your coding standards that you must do something sensible inside of a catch block, and get a code checker to break the build.

I don't think anybody is trying to say that checked exceptions have "solved" the problem of people ignoring error conditions. It does at least give you an easily visible thing to point at and say "that's wrong" though.

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#30
Go is as far removed from "extreme abstraction" as any other language I know. I don't know how it can even for a second be considered to have that desireable attribute.

I, for one, don't like abstraction and power just because I'm a PL geek. I admit those are also reasons, but the truth is I use them to make my codebase smaller, simpler, and easier to reason about.

For some, achieving that goal means writing for loops. For me, it's never having to write explicit loops.

Post reply on HN