【发布时间】:2010-12-16 16:59:12
【问题描述】:
Google 的 Go 语言作为设计选择没有异常,Linux 的名气 Linus 称异常为垃圾。为什么?
【问题讨论】:
-
ZeroMQ 的创建者写道,他认为用 C++ 编写它是一个错误(主要是因为错误处理)250bpm.com/blog:4
-
Go 可能没有异常,但它有“恐慌”,您可以从中“恢复”(延迟语句仍在执行时),并提供非本地控制流......
-
这是一篇不错的文章 lighterra.com/papers/exceptionsharmful(异常处理被认为是有害的)
-
Afaics,exceptions can be simulated in Go with significant boilerplate,尽管这一点对于从语法糖转译比手动编写样板文件可能更有意义。
标签: exception exception-handling error-handling error-reporting