5 ms·
Even though I have great fun tinkering with Java, I think it's is a dead-end. Like C++, it exists in sort of a weird limbo between dynamic high level languages
by drblast 15y ago
Even though I have great fun tinkering with Java, I think it's is a dead-end. Like C++, it exists in sort of a weird limbo between dynamic high level languages and C/Assembly.
The advantages of the performance of imperative code that exist with C aren't there, nor is the simple flexibility of Lisp or Python.
I attended a talk by James Gosling and he pretty much summed it up when he said, "Java was an attempt to drag C++ programmers kicking and screaming halfway to Common Lisp."
"Evolving" such a language into a more functional one, and doing it properly, will require much more than an evolution. That would completely change the language.
And you can still take advantage of functional concepts in Java as is. To me it seems like static methods are underused, but if you eliminate most or all of the member variables from your classes, you can code in a very functional style in Java. It's not the prettiest solution, but neither is having little bits of state everywhere at once.
- PaulHoule 15y agoCommon Lisp had safe memory references and garbage collection. It did have CLOS, but I don't think many people used it. CLOS also was a very different take on OO. The core of Java is the OO programming model, and "good" Java programming revolves around what works in that model. Lately I've become a fan of "import static", which imports static functions from another class. "import static java.lang.Math." is good to do if you need to do a lot of math, for instance. "import static com.example.mysystem.MyDSL." sets you up to use an internal DSL. Faking Lambdas with objects is cumbersome but not difficult, and remember there are many tricks like new ArrayMap<String,String>() {{ put("k1","v1"); put ("k2","v2") }} which let you build structures the way you would in Javascript, Python, PHP, C# or whatever.