The problems with Java can't be fixed by adding new things, you can't undo decades of ecosystem development, training, and ideology built on top of the idea that inheritance is really good idea and belongs everywhere. edit: I will say that as a Java developer I am grateful every day for the improvements to the language. Java is a very impressive language and I have a lot of respect for the people working on it.
Please ELI5 what is wrong with inheritance and/or how Java have it wrong. Do we need to go back to a new object oriented undegraduate course? Genuinely asking.
Java 21 makes me like Java again
101–110 of 777 posts
Re: Java 21 makes me like Java again
#102Earlier quoted context omitted.
>” None of the memory problems of C++” I’m sorry, I’m calling BS here. You can still leak memory in Java.
You can leak memory in any language. That’s an impossible bar. The problems op is referring to is obviously about memory safety. Java obviously isn’t thread safe like Rust is, but it’s typically safer than C++ on that front too.
Re: Java 21 makes me like Java again
#103[flagged]
Agree that Kotlin is a bright spot in terms JVM languages. For my taste has adopted some of the best concept of Scala, but without the burgeoning complexity.
Re: Java 21 makes me like Java again
#104Earlier quoted context omitted.
None of the memory problems of C++, the speed of C++ most of the time. Thousands of high quality libraries, a JVM that is a marvel of engineering after 20 years, tooling for development, monitoring and introspection of exceptional quality. Many of the internal tools at the largest Cloud developed in Java. Most enterprise level software. NASA extensive use of Java. A team behind the development who has stunning common…
>” None of the memory problems of C++” I’m sorry, I’m calling BS here. You can still leak memory in Java.
Re: Java 21 makes me like Java again
#105The problems with Java can't be fixed by adding new things, you can't undo decades of ecosystem development, training, and ideology built on top of the idea that inheritance is really good idea and belongs everywhere. edit: I will say that as a Java developer I am grateful every day for the improvements to the language. Java is a very impressive language and I have a lot of respect for the people working on it.
There will always be shitty devs, and since java is one of the biggest languages, it definitely has more than some ultra niche academic language no one uses. I don't think it is the fault of the language though, or if that somehow were a reason to choose a different language. Should a decent BMW driver sell their car, because plenty assholes buy that car also?
Re: Java 21 makes me like Java again
#106[flagged]
So that’s why they’re 10 years behind. But now they come out like 2+ times a year so they’re on track making major progress.
Also the null thing hasn’t been an issue for over 10 years. Just use null annotations and both your static checker and your IDE will catch every NPE.
Re: Java 21 makes me like Java again
#107In other news, we have an upgrade path at work to go from Java 8 to Java 11 pretty soon.
I can’t wait for 21, but I’m not sure when we’ll switch. At least it will be trivial compared to leaving 8.
Re: Java 21 makes me like Java again
#108Earlier quoted context omitted.
I rarely see inheritance used in practice in java code bases. Except where I would use a union type or sealed class in other languages anyways. I don't feel what youre describing is a real issue.
Sorry, what? Is not java toghether with Ruby maybe the most hardcore OOP enthusiasts that uses inheritance for "most stuff". Has the java culture move so far the last decade ?
With that said, even the Java EE/Spring complicated word has been moving towards a less inheritance-based future.
Re: Java 21 makes me like Java again
#109Re: Java 21 makes me like Java again
#110Answer in the piece is not wrong, but put more intuitively and succinctly: the total number of possible value (inhabitants) in a product type is the product of the quantity of inhabitants of the constituent types.
Replace the “product”s with “sum”s and it works too.
Interestingly, the total number of unique functions (judged only in terms of input and output) from a -> b can be found by exponentiation, (inhabitants of b) ^ (inhabitants of a).