3 ms·
Wow, I wouldn't have expected that. Do you have a reference for the 30%? I'd like to see what is going on to cause that big of a difference.
by azhenley 8y ago
Wow, I wouldn't have expected that. Do you have a reference for the 30%? I'd like to see what is going on to cause that big of a difference.
- SEJeff 8y agoEvery other 5 lines being the equiv of: if err != nil { ... error handling ... } Python just uses exceptions, and they bubble up. No need for this excessively verbose error checking.
- SEJeff 8y agoI'm not sure why it is downvoted. This is true. I write both Golang and Python as part of my day job. I love both languages, but this is definitely the truth. Go is more verbose. It also gives you the wonder of the compiler telling you about doing stupid things. That doesn't make it a worse language.
- samfisher83 8y agoDoes go not have exception handling?
- lacksconfidence 8y agogo has something in the same general area of error handling called panic/recover. It's not exceptions in the normal sense, and devs expect nothing should panic across api boundaries.
- SEJeff 8y agoGo does not have exception handling at all. It is a proposal they're seriously considering for go2: https://go.googlesource.com/proposal/+/master/design/go2draft.md https://go.googlesource.com/proposal/+/master/design/go2draf... See the bits about error handling and error values.
- samfisher83 8y agoWhat was the reason the go designers didn't have exception handling?
- SEJeff 8y agoRead Rob Pike's post on why: https://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.html https://commandcenter.blogspot.com/2012/06/less-is-exponenti... The go2 proposal shows that in this respect, he was woefully wrong.