4 ms·
I find it interesting that the article mentions the "new" operator, since this particular language quirk has been a source of minor fascination to me. Presumabl
by weavejester 17y ago
I find it interesting that the article mentions the "new" operator, since this particular language quirk has been a source of minor fascination to me. Presumably it was added to make Java look more like C++, even though many other parts of the language are quite different. The "new" operator is the only language feature I can think of that has no purpose other than appearance, and that comes at the cost of making the language just that little bit worse.
- leoc 17y agoThese comments by Guy Steele http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg04044.html http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/m... http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg04030.html http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/m... on the LL-1 list seem to shed light on why Java has a hardwired "new".
- weavejester 17y agoAha, interesting. So they were worried about having a specific operator for heap allocation. It doesn't sound like a particularly clever design decision, because even very early on Java had static "newInstance" methods which rather seem to defeat the point. But I can see the reasoning behind it now, even if that reasoning wasn't very well thought through.