Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


These comments by Guy Steele

http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/m...

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".


Aha, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: