随笔分类 -  error handling

error code based error handling exception based error handling
摘要:原文地址 https://blog.golang.org/errors-are-values Go程序员之间(特别是这些刚接触Go语言的新人)一个常见的讨论点是如何处理错误。谈话经常变成为对如下代码序列出现次数的感叹。 If err!=nil{ return err } 我们最近扫描了我们可以找到的 阅读全文
posted @ 2017-05-01 22:14 majianguo 阅读(529) 评论(0) 推荐(0)
摘要:Cleaner,more elegant,and wrong 整洁,更优雅,但是错的 并不是因为你看不到错误的产生路径就意味着它不存在。 下面是C#编程书中的一个片段,摘自关于异常处理的章节。 try { AccessDatabase accessDb = new AccessDatabase(); 阅读全文
posted @ 2017-04-26 18:55 majianguo 阅读(378) 评论(0) 推荐(0)
摘要:Cleaner, more elegant, and wrong Just because you can't see the error path doesn't mean it doesn't exist. Here's a snippet from a book on C# programmi 阅读全文
posted @ 2017-04-26 18:55 majianguo 阅读(208) 评论(0) 推荐(0)
摘要:Cleaner, more elegant, and harder to recognize 更整洁,更优雅,但更难识别 看来,有些人把我几个月前一篇文章的标题“Cleaner,more elegant,and wrong”解释成了对异常通用处理的引用。(参见参考文献【35】,注意到电文甚至为我改变 阅读全文
posted @ 2017-04-26 18:53 majianguo 阅读(409) 评论(0) 推荐(0)
摘要:It appears that some people interpreted the title of one of my rants from many months ago, "Cleaner, more elegant, and wrong", to be a reference to ex 阅读全文
posted @ 2017-04-26 18:51 majianguo 阅读(252) 评论(0) 推荐(0)