Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

For what reasons do people choose Ruby over Java? [closed]

Tags:

java

ruby

I am a beginner to Ruby. I've heard the following complaints about Ruby, and was hoping the Stack Overflow community could address each point raised.

Common complaints about Ruby that I've heard:

  • Ruby is slower than Java
  • Ruby is not statically typed
  • It's not suitable for large projects

Given these admittedly opinion based statements, how is Ruby 'better' than Java? and will Ruby ever be a widely used language both by businesses and individuals?

like image 326
Manoj Avatar asked Mar 30 '09 12:03

Manoj


People also ask

Which is better Ruby or Java?

Java performance, the former technology is leading. Ruby is simpler hence faster than Java. The code written in Ruby changes on the fly, while its competitor needs to generate the byte code before it can run. The Ruby performance supremacy is true for small tasks only, while Java recoups huge computational needs.

Why do people use Ruby?

Developers like using Ruby because it's high level and has a simple syntax. You have less code to write and can focus on finding a solution to your problem. Because of the high level and abstracted nature of Ruby, this adds up to a language that is easy to learn and put into practice.

Why do people love Ruby?

as others already said, Ruby is a very expressive language, it lets you to write code that looks like plain english (even without using/writing a DSL). it also looks easy at first glance, after all you can hide complex logics behind all that syntactic sugar (again, built-in or through DSL).

How is Ruby more object-oriented than Java?

Java is a high-level, open-source, object-oriented, and general-purpose programming language. Ruby is a high level, purely1990sa fewer, object-oriented, and general purpose programming language. Java is considered as both compiled and interpreted programming language. Ruby is an interpreted programming language.


1 Answers

Ruby is slower than Java to run but faster to write, or read. Which is more important to you? I don't know any company in the world who'd pass if given the opportunity to (say) cut their dev time in half at the cost of doubling their hardware.

Ruby is not statically typed, but neither are Python, Perl, Lisp, shell scripts, etc. Is this really a problem for you? I'm sure you could find just as many people in dynamic languages who would complain that Java, C#, C++, etc., are statically typed. We've no lack of examples of systems built on dynamic languages.

I'll agree that Ruby isn't suitable for large projects, but neither is any other language we have today. The state of software engineering is pretty clear to me: nobody can reliably build large systems well. At least Ruby makes your large projects smaller in lines-of-code, which makes them (somewhat) more manageable. It's syntactically richer so you can say (something closer to) what you mean. It's faster to write so you'll find out quicker if you're going down the right path or not.

If these are the best arguments against Ruby, then Ruby is doing better than I'd thought.

like image 114
Ken Avatar answered Oct 17 '22 15:10

Ken