Java Is Better Than Rust

preview_player
Показать описание
Recorded live on twitch, GET IN

### Article
By: Rohan Ganapavarapu

### My Stream

### Best Way To Support Me
Become a backend engineer. Its my favorite site

This is also the best way to support me is to support yourself becoming a better backend engineer.

MY MAIN YT CHANNEL: Has well edited engineering videos

Discord

Рекомендации по теме
Комментарии
Автор

One area that Rust certainly beats Java in is the ratio of hype to lines of production code.

wormisgod
Автор

I don't like how Java is associated with pointless abstractions. That's the choice of the developer, not a requirement. The Java community might have a cultural problem in that regard, but it's not a valid argument against the language itself.

HyperionStudiosDE
Автор

About complexity: I wrote a 3D game engine and physics engine in Rust using just raw Vulkan, as well as countless of complex algorithms (such as full body inverse kinematics). All of these things were very easy to do in Rust. I also wrote a web app (frontend) in Rust and it's the most complex piece of code that I've ever written. The amount of cases you need to handle when dealing with asynchronous behavior from the user, async loading of data, server-side-rendering, etc, it's mind blowing.

Luxalpa
Автор

Hot take:
The best programming language is the one that pays the bills.

TheHighborn
Автор

My simple advice to make Java a great language: 1. use lombok, removes like almost all boilerplate, 2. use Spock with Groovy for unit testing instead of Junit (Junit is an abomination both in writing/reading), 3. don't F-ING create interface for every class for no reason at all, and 4. use "package by feature" instead of "package by layer", for ease of splitting the monolith also readability will skyrocket, as you will be forced to think about domain model which will be reflected in the namings. The curse of Java and other older languages is, that it progresses, yes, but people don't. Some corporate old schoolers refuse to learn and still code as they did with java 1.5 in 2005. These now "seniors"/"leads"/"CTOs" hold higher positions and teach younger generation the same bs outdated pracitces. Plus tons of old outdated examples on the Internet.

stasyssk
Автор

Prime is just about as qualified to talk about the modern java build system as the article author is to speak about the rust one 😂

daycred
Автор

As a Java Spring Boot developer and someone who wrote a game engine in Java, here's my biblically accurate take on Java:

+ very easy to read code
+ simple build and dependacy management tools
+ great out of the box support for: networking, multithreading, string operations
+ heavily used everywhere, plenty of tutorials on practically everything, from computer graphics to game development

- no operator overloading, difficult if you're dealing with lots of math
- dynamic binding and auto boxing. ArrayList<Integer> can fuck off. Why can't I just ArrayList<int>?
- many possibilities for abstractions that obscure what the code is actually doing
- JVM takes a few seconds to boot

Verdict:

Java is the Chad's language of choice. You will not get the incel Budge of Honor like Rust + Vim users, but you will get something done and get paid for it.

StarContract
Автор

Oh man, I watched 10 minutes and noticed I'm actually tired of this. It's so repetitive... why compare Java to Rust? Rust is a systems programming language without GC. That alone means that inevitable some things will be harder to write and definitely plays a role in the necessity of macros sometimes! Also, I wonder how many people that complain about async rust have written async C++. That would be a meaningful comparison.

flyingsquirrel
Автор

Modern Java (version 21 and above) is truly impressive. If your opinions are based on experiences with older Java versions (prior to 21), it’s time to reconsider. Give the latest version a chance—you might be pleasantly surprised!

vinothmanoharan
Автор

Somehow I get the impression that prime did use async Rust wrong...
Yeah, async traits made stuff much easier but he always talks about arc<mutex<T>> and never mentions channels...
Also writing Rust with a data-driven mindset is muuuch easier than most OOP I encountered

PsyKai
Автор

"it's so difficult I've been there" I lived there it was awful, I essentially still live there understanding these ridiculous architectures that have to be supported is incredibly challenging. Working in finance was as close as I got to real-time and for me game-like programming. Where milliseconds matter.

JimmyJames
Автор

It's hard to watch language reviews now because it's all purpose driven. You can smell app dev, you can smell web dev, low level systems, you can smell frontend and backend. No pun intended. I picture 4 dogs on the sidewalk doing this. I'm not looking for one ring to bind them all. That war gets ridiculous.

greycell
Автор

Readibility is largely down to familiarity. I find it far more readable because i know what 'filter', 'map` etc are going to do even if not specifically *how*. Just seeing the coarse-grained operators I can get a pretty good feel of what's going on where the loop could be mutating anything anywhere.

Not only is composition easier, it makes it harder to 'just add a boolean flag' to the loop that invariably goes out of control with complexity.

And it *is* a builder! You're building a pipeline of operators that you eventually call with a 'terminal operator' like `foreach` or `collect`.

adambickford
Автор

Liked for the primeagen callout in the article

philipphanslovsky
Автор

[]interface{} is not Vec<Box<dyn T>>, it is Vec<Box<dyn Any>> (add Send + Sync + 'static if you want…).

stevenhe
Автор

I did my undergrad dissertation on functional programming in Java 21 and it's super cool. Sealed classes, records, type-match expressions, better streams, more control over the gc. It's all surprisingly ergonomic and well-considered.

I like Rust too, though I use it less. I think the comparison is interesting because both are sorta supposed to be a simplified C++, but with completely different aims within that.
IMO, Rust was co-opted for application programming but was intended for systems. There was this strange 3-way conflict between the designers, library maintainers, and end users, where each thought they were using a different language. For systems programming, Rust is elite.

But nowadays I mostly use Clojure and very occasionally one Java glue file.

finndriver
Автор

As far as Hindley-Milner types - for any mature enough to look past blind Microsoft hate - F# is actually a really good language taking learnings from Ocaml, has the HM types, has all the .net ecosystem, can do object oriented as well, etc.

chrismeyers
Автор

As someone who has written both Rust and Java professionally I would argue that Java works great if you stay in the Java ecosystem. As soon as you want to have interoperability with anything that is not a JVM language it gets a nightmare really quickly. Rust on the otherhand does integrating with other languages and ecosystems exceptionally well, create JS / Python / R bindings for your lib ? No problem ! Import that one C/C++ lib you really need ? Eazy! Run the same Code in a WASM environment? Also trivial. All these examples are really painful to do in Java.

stnn
Автор

The only reason to pick Rust over Java for some huge grug business project is for your own job security. If you actually get something up and running you're the only person who's ever going to understand it and never get fired. Choosing Rust Drastically reduces the amount of engineers who can work on it.

ShootingUtah
Автор

Any arguments against Java should include the last version of Java the person making the argument has used. There are certainly some fair critiques, but a lot of people are simply stuck in the early 2000s and haven't bothered to update their language knowledge over time.

PristinePerceptions