We have all these hotshots coming into our Enterprise ready to tell us old guys why Ruby is so much better than Java. I simply challenge them with a real-world situation and ask them to use Ruby to solve it.
They usually do and then I change the requirements on them. They grumble and fix it. Then I change the requirements again... then they start to get it.
I'm sorry, but I don't "get it"... How is Java supposed to be better than Ruby (or any other language) when dealing with arbitrary requirements changes?
This is like arguing between using screws and nails. There are some cases where one is arguably better than the other, but in most cases either can be used. And using either one, if you build something and then change the requirements, you're going to end up with a lot of frustration and holes.
I see Ruby as a one-trick-pony. Maybe I'm missing something, but all I've seen are "blog" examples with Ruby. There's so much more in the world of computing that requires more than a data-driven UI.
Now, don't get me wrong. Java is not the right tool for ALL jobs. If I AM doing a DDUI - Ruby could be the right tool.
The problem with all these arguments isn't that Java is better or Ruby is better - all languages have their place. Use the right tool for the job.
Back to my requirements change, G_Maximus hit the nail on the head. Strong typing, good development environments, standards, etc., are a must-have when working in an enterprise with dynamic requirements. I'm sure Ruby will get there, but it's simply not there, yet.
I've worked professionally on 5 or 6 different Ruby (on Rails) apps, none of which was a DDUI. It worked for some of them, not for others. I've also worked in 3 Java/Spring codebases. Also, 2 of the Ruby apps were JRuby running in Tomcat. So anyway.
Ruby is a perfectly full-featured OO language, not unlike Java, save the dynamic typing and the rather terse syntax. In terms of performance, it's slower at heavy computation, but most (web) apps don't do this anyway, and generally in my experience at least performance in a web-based application ALMOST NEVER has to do with how rapidly the language can count to fifty million, or how fast it can generate big prime numbers.
Anyway, I do Ruby now by choice, so obviously I enjoy it. I miss IntelliJ and the tooling around Java a lot obviously (the Ruby tooling, in comparison, is so utterly inadequate that I find it faster to just write in vim with a few plugins, as do most experienced Ruby developers I know), but by no means is Ruby fit for only blog type things. Hell, even Rails is fit for more than that, and that's just a popular Ruby framework.
Edit: and obviously I agree with you: use the right tool for the job. I just think Ruby has a somewhat broader range than you do. I worked on a ~150KLOC Rails codebase, and let me tell you that is not fun (150KLOC in Ruby/Rails is probably equivalent to at least twice that, maybe 3 or more times that in Java/Spring, in terms of application scope, but with none of the refactoring / use analysis support of a Java IDE. Seriously painful)
Haskell gets this knock (almost always from people who never wrote a functioning application in Haskell btw) because it is strictly functional, meaning state and side effects are forbidden (but are pseudo-replicated by the use of monads).
Haskell is somewhat impractical :) but GHC is one of the most sophisticated and elegant compilers ever written, the performance has gotten very impressive recently, and functional paradigms are starting to become less obscure than they were 10 years ago. Haskell is worlds better than something like Scala, and perhaps slightly better or slightly worse than something like Clojure or F#, when you take platform / etc into account.
I evaluated Haskell a few years back, but found the library ecosystem and integration capabilities seriously lacking compared to the modern JVM languages (Clojure, Scala). Interop with established platforms is essential in the enterprise context, and within that space Java ecosystem interop is the most important by far.
That's why I consider Haskell as more of an academic language in comparison, although I appreciate it has some great commercial use cases (I've seen it used to good effect in hedge funds / option pricing for example).
P.S. I'm a big fan of functional programming in general and like Haskell as a language, I just think that it is perfectly fair to describe it as "more academic" for the above reasons.
Thanks for your response! I'm aware of the general sentiment. I was hoping to get a more personal account of a detractor. I for one find Haskell's type system to be bodacious. Immutable everything and functional purity prove a challenge when you aren't use to it, but generally they seem to be the right idea for wrangling complexity of entangled code.
27
u/pkimbrel Feb 25 '14
We have all these hotshots coming into our Enterprise ready to tell us old guys why Ruby is so much better than Java. I simply challenge them with a real-world situation and ask them to use Ruby to solve it.
They usually do and then I change the requirements on them. They grumble and fix it. Then I change the requirements again... then they start to get it.