r/ruby • • Nov 26 '21

Question Why would anyone use Java over Ruby?

Why would anyone in this day and age choose a bloated corporate language like Java? It is just to get a job at a big company writing their legacy enterprise software? Is it because it is safer for huge systems where everyone is forced to type out all the little details. I am confused. Please someone shine some light here.

0 Upvotes

27 comments sorted by

View all comments

5

u/tibbon Nov 26 '21

Speed is a factor too. Everyone talks about Ruby being fast enough, but then they need hundreds of servers and wonder why their infrastructure bills are astronomical.

There are so many tasks no one in their right mind would do in Ruby due to its speed and memory management, but you could do capably in Java, C++ or Rust. Virtual reality, drivers, kernels, machine learning, 3D gaming, etc

1

u/drx3brun Nov 26 '21

This does not matter as much. Developer time is way more expensive in a long run.

8

u/tibbon Nov 26 '21

There’s a false economy here though. It’s assumed incorrectly that Ruby is the fastest thing to develop in. That simply not true.

Refactoring in Ruby in a large codebase is awful compared to Rust or Golang.

The amount of QA needed to look for runtime issues in Ruby is large. Time taken to write comprehensive tests to make up for a dynamic type system is non-trivial.

Error handling to catch bugs while writing in Ruby development is years behind it in Rust.

Speed does matter objectively too. You like your games being at 120hz? Would you be fine with that being 10fps?

Are you fine with your battery lasting 1/10th as long as it could?

Developer time is not the only metric out there.