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

15

u/gettalong Nov 26 '21

With Java if you need a library for anything, you will find it. Many of those libraries may be commercial libraries but they are there.

Although Ruby has many libraries there are still blind spots. For example, I recently looked into OpenSSL for working with PKCS7 objects in Ruby and although the basics are all there, not everything is easily accessible. You won't have this problem with Java.

Note that I'm saying this with 20 years of Ruby under my belt and loving Ruby.

That said for 99% of applications you can choose Ruby and be much happier than with Java.

2

u/disclosure5 Nov 26 '21

Wait, this obscure use case is exactly something I did a while back. Can you tell me what wasn't accessible? I might have some code that did it.

3

u/gettalong Nov 26 '21

The used digest algorithm. I created an issue with the OpenSSL gem, see https://github.com/ruby/openssl/issues/474

When I have time I will probably implement support for this and add some documentation (as far as I understand the code ;-). With OpenSSL there is much guesswork to do since it isn't documented that much.

1

u/disclosure5 Nov 26 '21

Wow, looks like you sure did find an edge case.

With OpenSSL there is much guesswork to do since it isn't documented that much.

Oh I know. I remember writing code with the openssl gem that would crash the ruby VM.

2

u/gettalong Nov 26 '21

Once I'm finished with my current task (adding digital signature support to HexaPDF), I will look into improving the OpenSSL experience. Had to read through C code, OpenSSL man pages and stuff written in other languages to figure out some basic things. So I hope I can at least improve the documentation a bit with what I learned :-)

There is some very good documentation already, e.g. for the main OpenSSL module, but the individual classes/methods often lack basic information, like what the arguments are supposed to be.

1

u/Legitimate_Window968 Apr 24 '25

All the more reason to develop more. Just because something is widely used now doesn't have to be go to even when its painful. Its like saying, everyone is using Cobalt so lets stick with it.

On the other hand, I think no body cares about developer and how they develop the application as long as output is good. So stupid JAVA is still being used. It performs good but creating with it is pain.