Re:Comparing Go and Java, Part 2 – Performance
by eta_carinae on Tuesday September 18, 2012 @03:17PM
(#4539963)
Annoying as hell, that's what you get when you don't support exceptions.
[ Parent
| on HN ]
Re:Comparing Go and Java, Part 2 – Performance
by masklinn on Tuesday September 18, 2012 @03:56PM
(#4540167)
> that's what you get when you don't support exceptions.
That's what you get when you refuse to use them anyway.
Go has exceptions, there's just a dogma about never using them.
Re:Comparing Go and Java, Part 2 – Performance
by skelterjohn on Tuesday September 18, 2012 @04:12PM
(#4540259)
You can't really use panics as exceptions. If you do your code will be strange and hard to work with. This strangeness is fine, because they aren't meant to be used like that.
A good rule of thumb is to use panics when it's a programmer error indicating a bug.
Re:Comparing Go and Java, Part 2 – Performance
by luriel on Tuesday September 18, 2012 @04:14PM
(#4540272)
Not dogma, just common sense based on experience.
Panic() is for truly irrecoverable exceptional situations where you do not expect the caller to catch it.
Re:Comparing Go and Java, Part 2 – Performance
by eternalban on Tuesday September 18, 2012 @03:53PM
(#4540150)