> Comparing with == is perfectly valid if you are using String.intern() or a
Factory.
>
> >And thinking again, this can be extended to other values: Date's,
Number's,
> >...?
>
> This is also valid if you are using a Factory.
>
> Neil

1. I didn't say it was always invalid, but I prefer not to leave things to
chance.

2. Using "stringA == stringB" when it's safe, is an invitation to continue
using it by mistake when it's unsafe.

3. It can be that most of the time "stringA == stringB" works, but when an
extraneous string comes from some extraneous source, the program starts to
fail in unreproducible ways - good luck finding where it's failing.

4. It's much better to lose a little in performance and have the guarantee
that string comparison ALWAYS works.

I repeat, I would very much like to have the guarantee that I have no
"stringA == stringB" in my code. And code inspection seems to be the best
place to have this.

Carlos

--
Carlos Costa e Silva <[EMAIL PROTECTED]>


_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-features

Reply via email to