There are many bad or/and lazy Java and C# programers, which write slow and buggy code. I think every programer should know some assembly and C.
Originally Posted by BO$$
I think the best way to do it would be this:
Originally Posted by susikala
if both string arguments are pooled (ie. immutable) --> compare by reference
if either of the string arguments are not pooled --> compare by character equality
Does any language do it like this, and if not, why? Comparing by reference obviously has a speed benefit, but it's useless when the strings (or one of them) aren't pooled. Conversely, comparing by characters is needless overhead when the strings are pooled. This would to me seem to be the obvious solution.
Don't put immutable with pooled.
You might make someone think pooled means the same as immutable.
(immutable strings can also exist not pooled)
Your point of useless when strings are not pooled is the best point about the string equality checks debate I ever read.
(Same counts for equality of objects though.)
Last edited by plonoma; 01-17-2013 at 10:44 AM.
Reason: added point about objects
John Carmack's applauds D language
John Carmack as already said that D is a good language for new code as here:
Originally Posted by John Carmack's
But for old code like has John Carmack they are no way to move that is a little too big.
Yes, immutable is not necessarily pooled, I just meant that a pooled string usually is immutable.
Originally Posted by plonoma
As i already said D is better choice when starting a new code otherwise depend which size is your project.
John Carmack's project are to big to move in another language
Originally Posted by John Carmack