Re:Warming up to Go
by fooster on Saturday September 12, 2015 @12:43PM
(#10208526)
And runtime exceptions? What about them?
[ Parent
| on HN ]
Re:Warming up to Go
by jacques_chester on Saturday September 12, 2015 @12:46PM
(#10208538)
They leave you in about the same position as a programmer in a dynamic language.
The advantage of runtime exceptions over Go is that I will get a fatal crash and a stacktrace. I don't have computation proceeding in an undefined, difficult-to-debug way because I forgot to do `err != nil` somewhere (particularly for functions that only return err).
Or someone will catch it and discard the result which is often often what occurs. For example, with java throw an exception in an executor task (an assertion failure for example). What do you think occurs?
Re:Warming up to Go
by jacques_chester on Sunday September 13, 2015 @07:34AM
(#10211030)
Which happens in Go too. I've seen a lot of code that happily sails past functions which only return err, meaning the compiler never pipes up.
Don't get me wrong, though. I become grumpy when I see empty catch clauses. Or a logger figleaf.