Just dropping a one-liner to say: I'm still alive, and I still hate Ruby and Rails.
I freaking hate Ruby
Just dropping a one-liner to say: I'm still alive, and I still hate Ruby and Rails.
I saw some idiot's post the other day complaining about how long it takes Sun to release major versions of Java. Are you kidding me??? Ruby is only up to 1.9 - at it was first released in 1995, the same year as Java. Java is up to version 6, about to enter version 7. Even Python, which was first released in 1991, is only at version 3.1.
How the blue blazes can anyone justify this statement? Comparitively speaking, Java is moving at a blistering pace compared to all the other dinkie languages.
Seriously - if you're going to complain about something another language, make sure your preferred one doesn't suffer from it, too.
It's been a while (mainly because I've been blessed with work in Java instead of Ruby), but I've got a new issue today. My boss instructed me to upgrade our Rails application to use the new version of Soap4R. Doing a little Google search led to this site which shows how to install the new version.
From the site:
Note that the 1.5.7 gem install didn't properly supercede the built-in
library in Windows. You had to download and extract the .zip file and
run 'ruby install.rb'. Version 1.5.8 has reportedly fixed this issue.
No - it hasn't. And not even on Windows. I installed the latest gem as described in the site, but no luck. Ruby and Rails still load the original old pile of crap Soap4R.
Upon asking my superior for advise, he suggested using the Rails extension on Kernel "require_library_or_gem" - except that this instruction cannot even locate the Soap4R gem (even though I can confirm it's installed using "gem list").
So here we sit again - Ruby's "magic" has fallen flat on it's face, with not even a murky indication of where to go from here. I always end up doing so much stumbling around in the dark with Ruby, I just cannot fathom how it's gained such a fanbase.
Another real-world example of Ruby and Rails sucking - check out these 2 lines in a Markaby file:
text command.description unless session[:criteria_errors].nil? && !command.promo_applied unless session[:criteria_errors][command.id].nil? # ...
Explain to me how we get this error:
undefined method `[]' for nil:NilClass
On line #6 of app/views/order/_command.mab
3: text command.description
4:
5: unless session[:criteria_errors].nil? && !command.promo_applied
6: unless session[:criteria_errors][command.id].nil?
7: unless session[:criteria_errors][command.id].empty?
8: div do
9: session[:criteria_errors][command.id].each do | error_msg |
I don't see it. We already know the variable "command" is not nil, because we used it on line #3 to display text, and line #5 to check a flag. We also know "session[:criteria_errors]" has a value because we expressed check it for a nil value on line #5. So how does Ruby and Rails decide that it's suddenly a NilClass?
A colleague of mine pointed out that this site may just be considered to be a troll site. Here's the thing - every blog post I've used to give real actual examples of how both Ruby sucks and the Ruby on Rails frameworks suck. I haven't just said "Ruby sucks ass" and left it there. That's a troll site. I genuinely have reasons for hating them.
Another colleague suggested I try Merb instead - fair enough, except that it's still based on Ruby, and I really don't like Ruby the langauge. Simply switching to another framework won't take me away from the quirky, awkward, and oft cryptic syntax.
So this is fun - found another thing about Ruby that I find completely screws up a fairly basic principle of object-oriented design.
The whole point of access level control is to explicitly prevent access to certain methods under certain conditions, thereby allowing you to refactor your classes to put small common processes into methods which shouldn't be exposed. In other words, a "private" method should not be accessible by anything other than members of the same class. In Ruby, this is a complete farce. There's literally no reason to mark a method as private.
Let's take this code:
class Greeting def greet puts "Hello!" end private :greet end
One would suspect you cannot access the greet method. WRONG!! Here's 2 things you can do without even breaking a sweat
x = Greeting.new x.send :greet
Even easier ... it's even transparent once you apply it (you can invoke the method as normal):
x = Greeting.new def x.greet super end
And there you have it. Access levels are a joke!
So I thought I'd post my own response to Obie Fernandez's stupid-ass rant about how Ruby is better than Java on a point-by-point basis:
On top of a moron blog, this prat the VERY NEXT MORNING tries to back-peddle. Sorry, Obie, there's no going back.
Ruby Suck.
Rails Sucks.
Ruby fan-boys suck.
Obie Fernandez sucks.
Period.
So, new gripe today. Running a RoR application - all the logging and such turned on - process runs, updates the database, etc., etc., but returns error 500 at the very end. But only for this one controller + action (so don't tell me it's a "server configuration error").
And here's the thing - no errors are logged anywhere. It's not a misplaced "rescue" which doesn't do anything, because then the HTTP response wouldn't be 500. And yes, I can confirm the controller doesn't forcibly send a 500 code.
So here we are - RoR was so productive I was able to produce this controller in a day - but now I'll spend another 2-3 days trying to fathom what the flying fig is going wrong. This isn't productivity, this is insanity.
Looking at a post on http://nathan.crause.name on using RSpec for XML-RPC within Rails, we see another example of why Ruby can suck a fat one. This isn't the first instance I've ever seen of a process just magically stopping under Ruby. No obvious crash, no exception thrown, no results returned. Just ... stops.
So how exactly is this condusive to productivity? Ruby doesn't make you a more productive programmer, it's makes you a luckier programmer if you just happen to make stuff work.
Another gripe I have is "require". It suffers from the same problems that PHP does, namely when you "require" some additional file, if that file also requires some extra files, then the path becomes very context sensitive. This never happens under Java. A package is a package, end of story - it doesn't matter where the actual JAR file is sitting, so long as the JRE can find it, it's available. None of this mucking around with "File.dirname(__FILE__)" garbage.
I've tried to like Ruby. I've really tried. But no matter how much I might enjoy the little benefits the dynamic nature of the language affords, I simply cannot escape the frustration I feel every single day I use it. Mystic error messages. Automagic embedded deep inside frameworks spontaneously failing with cryptic messages.
I now officially give up on Ruby and Rails for my personal projects. I will be forced to work with so long as I work at my current place of employment, but the "ease of coding" that is given is simply so badly offset by instability, quirkiness and just downright unpredictability that I cannot justify to myself to continue using it.
Flame away - I honestly don't care for your fanboy justifications anymore.
Not everyone gets sucked into the hype of Ruby and Rails - here's some bashers, and some with very valid points.