4 ms·
The reasons for not using exceptions are covered here: http://golang.org/doc/go_lang_faq.html#exceptions http://golang.org/doc/go_lang_faq.html#exceptions
by frognibble 16y ago
The reasons for not using exceptions are covered here: http://golang.org/doc/go_lang_faq.html#exceptions http://golang.org/doc/go_lang_faq.html#exceptions
- thristian 16y ago"We believe that coupling exceptions to a control structure, as in the try-catch-finally idiom, results in convoluted code. It also tends to encourage programmers to label too many ordinary errors, such as failing to open a file, as exceptional." To me, that comes across as "We don't like traditional exception handling because languages that use exceptions for error-handling encourage programmers to use exceptions for error-handling." Well, yes, that's what they're for. Python's exception system is far from perfect - it would be nice if there were a standard way to annotate exceptions, and if exceptions weren't quite so inefficient - but it's much easier to design or learn an API when there's one error-handling system consistently applied, instead of two independent ones.
- WalterBright 16y agoThis looks like a reinvention of the scope guard statement: http://www.digitalmars.com/d/2.0/exception-safe.html http://www.digitalmars.com/d/2.0/exception-safe.html