3 ms·
I recently started to write an article describing how java.lang.String was one of the classes that the Java creators got mostly right in Java 1.0. This contrast
by stevoski 11y ago
I recently started to write an article describing how java.lang.String was one of the classes that the Java creators got mostly right in Java 1.0. This contrasts to other Java 1.0 classes such as java.util.Date, which, as the usage of Java spread, and some good practices emerged, revealed itself to be poorly implemented.
I wanted to show in my article how one of String's strengths is that String efficiently shares memory with substrings. But then when I looked into Java 8's String source code, I was surprised to find that this was not the case. It seemed I had been working with false assumptions for years.
Now, thanks to Heinz's article (OP), I discover that this was a change in the String class.
Long ago, a man who had been programming for 30 years told me about his theory of the half-life of programming knowledge being roughly 18 months. Today, Java has made me believe his theory a little bit more.
- ygra 11y ago> Today, Java has made me believe his theory a little bit more. I think Java is sort of an exceptional case here in that the language stays relatively stable and evolves very little over time. Also they tend to not change internal details of the standard library without reason, so even lots of things programmers shouldn't rely on, such as behaviour of substring() will stay unchanged for quite long. Now JavaScript on the other hand probably has programmign language and framework knowledge half life of considerably less than 18 months ...
- nkassis 11y agoJS now is moving fast but for the longest time it was stuck in stasis with various incompatible implementations floating around. And almost any knowledge on it was probably invalid in one of those implementations.
- alblue 11y agoThe date API in Java (before 8 anyway) was hideous. Here's what was wrong with it: http://stackoverflow.com/questions/1969442/whats-wrong-with-java-date-time-api http://stackoverflow.com/questions/1969442/whats-wrong-with-...