On Friday 27 November 2009 16:27:49 xor wrote:
> On Thursday 26 November 2009 18:18:21 bbackde at googlemail.com wrote:
> > Thanks for your review.
> >
> > Xor will address this one:
> > > - returning null is *significantly* faster, is this worthwhile? It makes
> > > the code more consistent... I don't see where "Also import introduction
> > > for already known identities." is implemented.
> >
>
> No, I won't. We throw NoSuch* exception everywhere in WoT/FT by design.
> Changing it to null pointer usage would by a major amount of work and IMHO be
> an abuse of null pointers.
> If Java was designed for using null pointers everywhere then there would not
> be declared exception throwing, I guess the whole purpose of declared
> throwing
> is to prevent the null pointer mess. Consider that using null pointers would
> result in people usually forgetting to "if(blah == null)", resulting in
> runtime NPE because the compiler can't prevent you from forgetting the if().
>
No, exceptions are much more widely useful. If it simplifies the code then use
it, but be aware that even in java exception handling is vastly slower than a
branch; I ran into this in the index parsing code recently.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
URL:
<https://emu.freenetproject.org/pipermail/devl/attachments/20091127/5c13ccf4/attachment.pgp>