Re:Java memes which refuse to die
by esrauch on Monday August 27, 2012 @01:02PM
(#4439716)
It seems bizarre that there are a lot of equivalent classes that are thread safe or not with names that are simply synonymous. Is it just me?
[ Parent
| on HN ]
Re:Java memes which refuse to die
by spacemanaki on Monday August 27, 2012 @01:12PM
(#4439766)
It seems bizarre, but it's just because they were part of different versions. StringBuffer was in Java 1.0, and StringBuilder was added in Java 1.5. If they were both part of the original Java libraries they would hopefully have been given better names. I suppose they could have called StringBuilder "UnSynchronizedStringBuffer" or "NotThreadSafeStringBuffer", but those are problematic on their own.
You have the same problems with Vector and ArrayList I guess, although since ArrayList was added as part of the collections libraries it makes a bit more sense.