Earlier quoted context omitted.
> Java has brought forth the biggest madness of tacking on OOP to everything It was C++, if we are being historically accurate. It’s actually a positive in Java’s case that it managed to make these systems even run.
I love how everyone likes to blame Java for OOP, when most of the stuff that eventually ended up in enterprise OOP patterns, predate Java for 10 years. Including those stupid "coding Java in C++" remarks, when Java OOP model is based on a mix of C++ frameworks, and Objective-C features.
Don't write Rust like it's Java (2023)
31–40 of 45 posts
Re: Don't write Rust like it's Java (2023)
#32Discussing curriculum and textbooks for a Java class today, someone recommended a book that was most recently updated for Java 7. When I pointed that out, the response was:
“The level we teach at, the new Java features won’t make much of a difference.”
Java is a culture just as much as a language, and the culture is stuck somewhere in the past in a lot of places, especially in education.
Re: Don't write Rust like it's Java (2023)
#33Re: Don't write Rust like it's Java (2023)
#34Of course this is on point, you shouldn't write Rust like it's Java, however looking at Java, you shouldn't write anything like it's Java. Java has brought forth the biggest madness of tacking on OOP to everything that is still making 3 billion software projects unreadable.
> Java has brought forth the biggest madness of tacking on OOP to everything It was C++, if we are being historically accurate. It’s actually a positive in Java’s case that it managed to make these systems even run.
Re: Don't write Rust like it's Java (2023)
#35I feel like this axiom is true in general. Don't write [insert lang here] like it's Java. I've seen this in Ruby code bases, TS code bases, even Erlang code bases (using gen servers like an OO primative.)
Of course what's being picked upon is a specific kind of Java code. It's better to be specific than technically incorrect, as all written Java is Java regardless of how you write it. The article goes a good job (comments here less so), except for this bit:
> While not entirely accurate, there’s some truth to the trope that Java developers need everything to be an interface (I am one such developer).
That's not just Java, that's Dogma.
What does work for me is writing in most languages (Java included) as if they're functional ones without lots of variable reassignment or data mutation.
Re: Don't write Rust like it's Java (2023)
#36Of course this is on point, you shouldn't write Rust like it's Java, however looking at Java, you shouldn't write anything like it's Java. Java has brought forth the biggest madness of tacking on OOP to everything that is still making 3 billion software projects unreadable.
Even in Java, the interfaces everywhere style was never great. Somehow Java got picked up by Architecture Astronauts that love writing enterprise pattern layer cake. Nothing in the language makes this style necessary, it's perfectly possible to write short and sweet code, and yet the Java culture got infected with this overcomplicate everything culture.
That's my opinion, anyway.
Re: Don't write Rust like it's Java (2023)
#37I look at Rust more as an FP lang than an OO lang. By FP I mean: you have data and logic; never a combination of both (classes/objects). Java makes this king of separation between data and logic really hard. Kotlin came to the rescue for us. It allows us to move our Java/OO codebase in a slightly more FP direction: uncouple data and logic, immutability is preferred, no (or very little: yes looking a you shitty "platf…
Kotlin is easily the best modern language for DX. After writing server-side Kotlin for the past three years, I'm not sure I ever want to write anything else.
Re: Don't write Rust like it's Java (2023)
#38Everybody worth their salt should know that those languages have completely different working models in mind. Java puts everything into the heap and creates easy expressability by having pointers everywhere. In contrast, Rust often avoids pointers, prefers the stack and is very stingy with memory access. These languages are completely orthogonal to each other and it has consequences in their usage. Not that a good ch…
Primitive types are placed on the stack, as are those classes proven to not escape current scope, thus not everything. When Valhala is finally merged, then value class and value record will also not be on the heap by default. Finally, even without Valhala, Unsafe and Panama allow for off heap allocation, thus again, not everything.
What makes Java so good is that it is a language written for creating high quality libraries and frameworks. Sure, it will be nice to define your own zero-cost classes but the largest benefit will stem from improved an standard library as well as an enabler for high-performance programming and GPU access.
Re: Don't write Rust like it's Java (2023)
#39Everybody worth their salt should know that those languages have completely different working models in mind. Java puts everything into the heap and creates easy expressability by having pointers everywhere. In contrast, Rust often avoids pointers, prefers the stack and is very stingy with memory access. These languages are completely orthogonal to each other and it has consequences in their usage. Not that a good ch…
you'd be surprised how few developers today even know what general subject you're talking about
Re: Don't write Rust like it's Java (2023)
#40Generally good advice is: Don't program Rust like nearly any other programming languages you know. If you try to program Rust like C you are going to fight and lose. If you try to program Rudt like and Object Oriented Language you will eventually go mad. If you like a Zen master let all previous knowledge and pre-conceived notions of what beautiful code has to be out of the window and do it the Rust way, suddenly thi…