tag:blogger.com,1999:blog-18772002.post2152873604125105946..comments2023-12-06T19:00:46.094+00:00Comments on OSGi Blog: Taking ExceptionJürgen Alberthttp://www.blogger.com/profile/02725834158183495837noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-18772002.post-16875727316034304132015-08-29T05:30:14.686+00:002015-08-29T05:30:14.686+00:00I've been doing a bunch of work in Go lately. ...I've been doing a bunch of work in Go lately. It does away with Exceptions altogether. And it allows for multiple returns, and by convention, the error result is always the last return. Makes for a fair bit of if err != nil {} code. However, all error handling is explicit, not hidden. For me, so far, it has been yielding more robust, more fully tested code.<br /><br />I mention this only Eric Johnsonhttps://www.blogger.com/profile/04021626572807724018noreply@blogger.comtag:blogger.com,1999:blog-18772002.post-10508511431093543912015-08-18T16:57:20.421+00:002015-08-18T16:57:20.421+00:00Hi Peter,
as always, I like your candid way of de...Hi Peter,<br /><br />as always, I like your candid way of describing the world and how you see it :-)<br />I may risk to be the only one to disagree with you slightly, but the world is big and not all great minds think necessary alike.<br /><br />In my experience, the contract definition needs to include the handling of errors. Now that I am mostly working with NodeJS and HTTP/REST/JSON, I Tim Diekmannhttps://www.blogger.com/profile/14767809531097448373noreply@blogger.comtag:blogger.com,1999:blog-18772002.post-10062770724691620652015-08-17T10:12:32.461+00:002015-08-17T10:12:32.461+00:00Sadly this can't be considered good advice (al...Sadly this can't be considered good advice (although most people agree that checked exceptions were a failed experiment). Using "throw Exception" from all methods is basically a solution from 15 years ago and is something that simply doesn't work in practice. There are far too many other pieces of code such as frameworks that the users of the API is using that are not declared &Stephen Colebournehttps://www.blogger.com/profile/01454237967846880639noreply@blogger.comtag:blogger.com,1999:blog-18772002.post-62299838941468038252015-08-16T17:31:22.690+00:002015-08-16T17:31:22.690+00:00The content of the chapter "Use Unchecked Exc...The content of the chapter "Use Unchecked Exceptions" of the book "Clean Code" is very similar to this post.<br /><br />Instead of defining my methods with "throw Exception", I always wrap checked exceptions with an unchecked exception. I guess the motivation behind UncheckedIOException class in Java 8 is similar.Anonymousnoreply@blogger.com