Recently a friend sent me a link to this article on InfoQ Why would a .NET Programmer Learn Ruby on Rails? We rant a lot on our list and mine was particularly long. He suggested I publish it so here it is.
I think the points in this article show a lack of understanding about the architecture and features of .NET.
Here are the points from the article:
Do not compile. So what. How does this help anything? He claims as long as you have good unit tests, dependency injection help etc. it doesn’t matter but no real project is every that nice and clean. Rarely is anything that good unless I write it LOL.
Dynamically enhance the behavior of a class without a Decorator. This is something you can do with any non-compiled language. The problem is you will need to do this someday when you don’t have access to the source. Actually can you have some Ruby code without giving away the source? That might be a problem for the future of the language.
Slim down your code base by stripping off type declarations and interface declarations.
Have you ever tried to use a class that you didn’t write that doesn’t have a well defined interface with types? This ability has existed for a long time in VBScript and ASP with objects/perl objects/smalltalk (first two are not truly object oriented languages but not necessary for this example). The point is that this has led to more problems and issues than it ever solved. It was great for prototyping but broke down so fast you always ended up re-writing.
Ajax it.
This is one of the better features of Ruby. He of course fails to mention that ATLAS lets you drag and drop ajax functionality (even on existing projects). And with the integrated environment of Visual Studio it offers 10 times the debugging and development performance of the Ruby IDEs I’ve tried (ya I know that is a silly hype statement just like the Rails statements :-). ATLAS it is officially beta but so is Google mail.
With Rails you don’t need an O/R Mapper.
Yes you do. It is called ActiveRecord. Just because you bundle it in doesn’t mean you don’t need it. And you don’t have to implement one on your own if you don’t use Ruby. Has this guy ever heard of Hibernate/NHibernate/iBatis? All of these (included the great Rails) have the same problems. They all work very fast and great as long as you “apply a few naming conventions”. Well that knocks out 95% of the projects since the database and data usually already exist. You don’t tell the DBA to rework the database of 2 billion measurements because you want to use Rails. You can map Active Record to your schema but just like Hibernate this takes all the “speed of development” out of the equation. As for his example of Rails automatically adding a field to the database…well once again in what universe? What does a developer then do with his changes to get them into production where he doesn’t have access? This is where Ruby/Rails lands squarely in the PHP world of every application is a new application and a small application.
Using Ruby to build/deploy/release.
I know Rake is pretty good and I can’t (due to not using Rake enough) really compare these at the feature level. One thing is that article says is Rake uses Ruby…well duh NANT uses .NET and ANT uses Java. As far as how many times I’ve done things like “for each file with .sql extension” well honestly just once many many years ago and I’ve been reusing it for years which makes it at least x years more productive than Rake :-) I also don’t guess he has tried Maven and Jelly where you can completely script things in seconds (they are Java but there are .NET equivalents). I wrote a web service client generator in 4 lines of Jelly code for my Maven build. Took no time at all.
No pain no gain.
Here at least some hints of real work. I had to go through the emotions of accepting the fact that it will take longer to find a new Ruby solutions than to use an existing technology that I am comfortable in.
So he then enjoys the work…I’m sure the business dev. people will agree with taking longer as long as the programmers are happy!
So do I think Ruby sucks. No. It is a neat language. But there are many neat languages. I’ve used VBScript with WSH to prototype COM components for years. And until they bottleneck I never had to rewrite them (just like the Basecamp folks who rewrote some of their Ruby in C when it bottlenecked). The VBScript isn’t typed either and it is very fast. Ruby is like an evolution of those types of environments. (btw. Microsoft is releasing a fully object oriented command shell language that will replace VBScript…it has been beta for over a year).
But the Ruby hype is out of control. I think Ruby will continue to eat away at the PHP crowd. PHP isn’t object oriented and it’s database access code sucks (custom calls for each database brand require putting a layer in). Ruby solves these issues. But Ruby isn’t going to be an Enterprise language. I might be wrong and that is why I always learn every language I can but right now I see it as the next PHP. I don’t have any clients wanting it except people that have PHP sites that are frankly simple non-complicated sites.
And my final issue with Ruby is use of symbols. This makes it look terse but that is not a benefit. What is @ in Ruby? What about @@? Instead of just using a simple “private”, “public” or “static” keywords they choose symbols. I thought we had enough of this with Perl. This is also why Smalltalk/Squeak have not been widely adopted. Sure once you learn the symbols you know what they mean but it doesn’t produce truly readable code. Ruby does use private/public keywords on methods but allows symbols too often.
My Ruby rant is done.