<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-993833610256227478.post8209877821949300179..comments</id><updated>2008-05-20T09:56:41.272+01:00</updated><category term='logging'/><category term='rental'/><category term='openid'/><category term='postgres'/><category term='parallel computing'/><category term='continuous integration'/><category term='mamp'/><category term='phones'/><category term='erlang'/><category term='clojure'/><category term='snow leopard'/><category term='jaxb'/><category term='web'/><category term='software development practices'/><category term='books'/><category term='Buenos Aires'/><category term='cyberpunk'/><category term='maven'/><category term='france'/><category term='methodology'/><category term='hosting'/><category term='geocaching'/><category term='openshift'/><category term='analytics'/><category term='linkedin'/><category term='g+'/><category term='oneliner'/><category term='sed'/><category term='swdc'/><category term='big data'/><category term='South America'/><category term='skydivig'/><category term='second life'/><category term='freebase'/><category term='css'/><category term='rack'/><category term='git'/><category term='gem'/><category term='software craftsmanship'/><category term='software engineering'/><category term='rails'/><category term='suits'/><category term='sun'/><category term='oreilly'/><category term='Marathon'/><category term='htc rooting jailbreak'/><category term='San Telmo'/><category term='eclipse'/><category term='slow food'/><category term='giraffe'/><category term='bdd'/><category term='facebook'/><category term='xml'/><category term='Google+'/><category term='good cause'/><category term='jayway'/><category term='online apps'/><category term='scala'/><category term='java'/><category term='mysql'/><category term='tips and tricks'/><category term='seminar'/><category term='Montevideo'/><category term='UML'/><category term='coupland'/><category term='cucumber'/><category term='regular expression'/><category term='bash'/><category term='game'/><category term='oracle'/><category term='traveling'/><category term='Göteborg'/><category term='läkare i världen'/><category term='alcohol'/><category term='Argentina'/><category term='android'/><category term='human computer interaction'/><category term='coderetreat'/><category term='dynamic languages'/><category term='church'/><category term='portugal'/><category term='usabilty'/><category term='mac'/><category term='coding'/><category term='saas'/><category term='rebooting'/><category term='dropbox'/><category term='weblogic'/><category term='software estimates'/><category term='gollum'/><category term='modeling'/><category term='statistics'/><category term='framework'/><category term='parallell'/><category term='open air'/><category term='coffeescript'/><category term='Tigre'/><category term='google'/><category term='svn'/><category term='ruby'/><category term='cooking'/><category term='technology'/><category term='design patterns'/><category term='javascript'/><category term='buildr'/><category term='restaurant'/><category term='ec2'/><category term='legacy'/><category term='perl'/><category term='grandcentral'/><category term='nordic ruby'/><category term='search engine'/><category term='tinymce'/><category term='ipad'/><category term='environment'/><category term='programmers stone'/><category term='business intelligence'/><category term='conference'/><category term='toolbox'/><category term='creativity'/><category term='daemon'/><category term='dyncon'/><category term='gradle'/><category term='find'/><category term='social networking'/><category term='agile'/><category term='desire'/><category term='devoxx'/><category term='jaoo'/><category term='nodejs'/><category term='iconv'/><category term='tdd'/><category term='spotlight'/><category term='hibernate search'/><category term='seaside'/><category term='game of life'/><category term='apache'/><category term='lean'/><category term='hibernate'/><category term='jfokus'/><category term='me'/><category term='kathy sierra'/><category term='cloud computing'/><category term='php'/><category term='vacation'/><category term='bletchley park'/><category term='film festival'/><category term='smalltalk'/><category term='htc'/><category term='ssh'/><category term='mapping'/><category term='agilasverige'/><category term='config'/><category term='express'/><category term='jquery'/><category term='wikipedia'/><category term='snorcle'/><category term='running'/><category term='web2.0'/><category term='food'/><category term='twitter'/><category term='festivals'/><category term='nexus one'/><category term='drupal'/><category term='mysql.user'/><category term='microsoft'/><category term='code retreat'/><category term='spolsky'/><category term='gartner'/><title type='text'>Comments on high level bits: Explicit NullPointerException</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.highlevelbits.com/feeds/8209877821949300179/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/993833610256227478/8209877821949300179/comments/default'/><link rel='alternate' type='text/html' href='http://www.highlevelbits.com/2008/05/explicit-nullpointerexception.html'/><author><name>Fredrik Rubensson</name><uri>http://www.blogger.com/profile/01768658671349714371</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-993833610256227478.post-7877324701849363822</id><published>2008-05-20T09:56:00.000+01:00</published><updated>2008-05-20T09:56:00.000+01:00</updated><title type='text'>Agreed - there always has been this huge discussio...</title><content type='html'>Agreed - there always has been this huge discussion around checked vs unchecked exceptions and a lot of bogus code has been written. I like an article on ONJava a lot &lt;A HREF="http://www.onjava.com/pub/a/onjava/2003/11/19/exceptions.html" REL="nofollow"&gt;Best Practices for Exception Handling&lt;/A&gt;. To quote from this article:"Ask yourself, what action can the client code take when the exception occurs?&lt;BR/&gt;If the client can take some alternate action to recover from the exception, make it a checked exception. If the client cannot do anything useful, then make the exception unchecked. By useful, I mean taking steps to recover from the exception and not just logging the exception." &lt;BR/&gt;I think that's a very healthy approach.&lt;BR/&gt;&lt;BR/&gt;Regarding the code example - there is a reason why one would like to fail early. Imagine only one of the passed in parameters is null, component. Now let your method modify initially the other object. What happens now if the method tries to call a method on null object. You will get a NullPointerException, but you also have already modified another object. This could in some scenarios have side unwanted side effects. I guess that would justify the guarding null check.&lt;BR/&gt;&lt;BR/&gt;Admittedly the code looks silly. I would like to see  built in support for &lt;B&gt;Design By Contract&lt;/B&gt; within Java - a la &lt;A HREF="http://www.contract4j.org" REL="nofollow"&gt;Contract4J&lt;/A&gt;.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/993833610256227478/8209877821949300179/comments/default/7877324701849363822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/993833610256227478/8209877821949300179/comments/default/7877324701849363822'/><link rel='alternate' type='text/html' href='http://www.highlevelbits.com/2008/05/explicit-nullpointerexception.html?showComment=1211273760000#c7877324701849363822' title=''/><author><name>Hardy Ferentschik</name><uri>http://www.blogger.com/profile/09313517265555235117</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='02873044334972025889'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.highlevelbits.com/2008/05/explicit-nullpointerexception.html' ref='tag:blogger.com,1999:blog-993833610256227478.post-8209877821949300179' source='http://www.blogger.com/feeds/993833610256227478/posts/default/8209877821949300179' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1615042264'/></entry></feed>
