6 ms·
> It lets a lot of innovation happen in other languages, then takes the successful parts for itself The only time I've ever had to use Java was for a computer
by mashpoe 5y ago
> It lets a lot of innovation happen in other languages, then takes the successful parts for itself
The only time I've ever had to use Java was for a computer science class, and I thought it was a solid language (pun intended), but I hated its half-assed attempt at operator overloading.
I think it's a major feature that's long overdue to be fully implemented in Java, because it's already used for some of Java's built-in classes and it's proven useful in many other programming languages.
Most of Java seems very well-thought-out to me, but for some reason they decided to add only some operator overloading, instead of planning ahead more.
I remember hearing somewhere that they were planning on adding operator overloading, but last I checked it didn't look like it was going anywhere.
- DerArzt 5y agoIf you are serious about using the JVM, I would suggest Kotlin or Scala as a better alternative to Java as they have all the libraries and greatness of the JVM but they have less of the historical baggage that Java brings with it. Both can be written in a Java like fashion to start, and have 100% interop with Java (you can mix the languages in projects) so the learning curve is pretty alright.
- PaulHoule 5y agoThat is the frying pan to the fire. JDK 17 has most of the good features of Scala and Kotlin. Scala seems to be designed so that you can write a short book with very fluent and natural looking demos. Make a small deviation from that and there is nothing fluent or natural about it. Kotlin is OK but isn't sufficiently better than Java to be worth using when any Kotlin dev is going to have to know Java and Java-Kotlin mapping pretty well to use libraries. (It's a similar problem to Typescript.) Both Scala and Kotlin are sufficiently similiar to Java to provide no real benefit. I'd point to Clojure as a language that is radically different from Java AND that takes advantage of the strengths of the JVM to be worth the cognitive load of having to know both a new and old language to be productive.
- thomascgalvin 5y ago> Kotlin is OK but isn't sufficiently better than Java to be worth using when any Kotlin dev is going to have to know Java and Java-Kotlin mapping pretty well to use libraries. One of the big benefits of Kotlin is that if you know Java, you pretty much already know Kotlin, too. A good Java dev can get spun up on the basics in a day or two. > Both Scala and Kotlin are sufficiently similiar to Java to provide no real benefit. Kotlin provides a ton of ergonomic features that I absolutely adore. Named parameters and default parameter values alone save me tens or hundreds of lines of code. I think of Kotlin as what would happen if a Java developer looked at Javascript and asked "okay, but what if this didn't suck?"
- PaulHoule 5y agoYou can’t beat Javascript for ergonomic passing conventions and packing and unpacking of lists and dicts.
- pionar 5y ago> I think of Kotlin as what would happen if a Java developer looked at Javascript and asked "okay, but what if this didn't suck?" I think you mean "what if we took C# and put it on the JVM"? /s Honestly, C# has had most of the features Kotlin "adds on" to Java for years, even decades.
- pjmlp 5y agoKotlin's future is tied to Android, on the JVM I don't even care it exists.
- DerArzt 5y agoHow so? While yes Android is one of the most common uses at the moment for Kotlin (thanks to Google making it a first class supported language for the platform) it is still dependent on the JVM, thus can do anything that Java Can.
- smaudet 5y agoAlso Java doesn't run on android? Not 17 anyway... I guess you could try to argue mobile is bad or something, but you get Kotlin not JDK on mobile. Yes, Clojure is probably better, but on the flip side as a developer knowing Java 8 and Kotlin is better than knowing Clojure and JDK 17. Perhaps you can point to some salaries here but Java developers are not in short supply, if you wanted to play that game there are better languages for more lucrative payout (assuming you can even get them, these tend to be boutique shops not generally hiring publicly)
- vips7L 5y agoScala has just as much historical baggage imo. It's community is split between functional zealots and "better java". You also have the Scala 2/3 split that is currently going on and just the general complexity of the language makes it not so appealing. IMO if you're serious about using the JVM you should be using Java 17 and following the latest version. Kotlin is usable, but it doesn't bring that much more to that table other than longer compile times.
- smaudet 5y agoBut isn't the great thing about using the JVM supposed to be not using Java? Or at least the perf advantages it brings. Java has nice stuff today maybe but one could argue that it is primarily defending market share that caused Oracle to move forward with its language updates. I'm inclined to say the opposite, the more the JVM stays healthy and the stronger the third party ecosystem the more likely it doesn't become a 'dead' language like COBOL or FORTAN (not dead but in terms of marketshare).
- eeperson 5y agoWhy do you feel that Scala has just as much historical baggage? Isn't the whole point of the Scala 2/3 split to remove historical baggage.
- daltont 5y agoI was really into Scala ten years ago, but felt that a "Scala--" might be more accessible to most devs and hurt Scala adoption. Lo and behold, we got Kotlin.
- DerArzt 5y agoThe community split is what makes Scala better in my opinion. The fact that you can have the split between functional first and better java people is a nice thing to see over Java where if you want to do functional programming, you are a second class citizen.
- darksaints 5y agoThey may have a little less of the historical baggage, but that's still a lot of baggage. Same goes for F#. It's a shame that three of the best programming languages in existence are built on top of Java and C#, instead of doing their own thing. Admittedly their VMs are mostly fantastic, but trying to reuse libraries and language constructs has just created more problems.
- pulse7 5y agoSome say "historical baggage", others say "backwards compatibility"... two sides of the same coin...
- PaulHoule 5y agoJava chose not to implement (general) operator overloading because it's really hard to do right. We're left with just a fluent syntax for appending text to strings. Java was one of the first language specifications to be written by adults (maybe Common Lisp was the first, but it drives Common Lisp fans crazy to compare Common Lisp to Java, Python, etc.) Python's operator overloading works remarkably well given that it has a very simple model (always look to the left hand side to decide how to interpret the operator.) C++ on the other hand ought to make anybody skeptical of the idea, but C++ would make anybody thoughtful and sensitive question the idea of computers entirely.
- hiptobecubic 5y agoIf there's no implementation on the left, python then looks on the right.
- nradov 5y agoThe lack of operator overloading makes it impossible to implement new numeric types in a consistent way. For example imaginary numbers or numbers with units.
- PaulHoule 5y agoYou can make the case that both intX (x=16, 32, 64) and floating point are bad for general purpose computing. Like Common LISP and Python, Java has bigints and rationals in the stdlib, but Java makes you use non-operator syntax to get at them. Contrast that to Clojure which puts them on your fingertips. Java has always been in a strange place of not deciding if it wants to be a systems or application language. (The standard architecture is that demanding systems, say video games, are written in both a systems language and a scripting language. A Python coder feels smart when the incorporate, say, number is written in C or FORTRAN but Java’s xenophobia makes that feel like a personal failure. Java is ‘good enough’ for applications programming that you might find something like Spring or Guava gives you all the dynamism you need with less hassle than adding an embedded scripting language like Groovy or Clojure.)
- Someone 5y ago