4 ms·
Bizarre advice. Throw away the mutable aspects of Java to try and code in this "new hotness", a pale echo of an OCaml-esque style of programming. In the process
by KirinDave 17y ago
Bizarre advice. Throw away the mutable aspects of Java to try and code in this "new hotness", a pale echo of an OCaml-esque style of programming. In the process you make code that is neither as declarative as functional code, nor elegant as Java code. Stop trying to code like another language and use another language.
That's enough for me to discard this article as chaff, but considering it even further, has anyone stopped to ask how the Java runtime and compiler handles these changes? Making new classes instead of mutating existing ones doesn't strike me as an efficient use of the system.
Finally, I am so sick of people lamenting being "trapped" in Java. This nonsense of being "trapped" is just a shield for people who don't want to go through the hassle of really using a different language. If I can squeak new languages in at Lockheed Martin on a huge spacerange project who's spec was literally conceived when I was still in diapers, then anyone can do it anywhere if they have the will.
- cturner 17y agoIn some spaces (financial, perhaps military) running the JVM is the only sensible thing to do. It has special status that allows you to skip steps at audit, which allows your customers to install it, it allows you to use libraries and it's really good for cross-platform so long as you don't care about GUIs (and with everyone using web these days, there's no reason to care about GUI).
- tjmc 17y agoTrue, but who's to say you can't use another language in the JVM - eg. JRuby, Jython or Clojure
- fhars 17y agoThe runtime system seems to be fine with this, at least the results for scala code (which compiles to bytecode consisting of many small, mostly immutable classes with shot lived instances) indicate that this style of programming hits a sweet spot for the JIT compiler and the GC (at least for sun's server VM) which has a far easier time inlining things than with code consisting of few big classes with long lived objects.