5 sins of ruby
By Justin Silverton
Introduction
Ruby has become more and more popular over the past couple of years. This month, I decided to start coding a few smaller apps to see if there was something I was missing. The following are a few issues with ruby that I feel need to be changed, before it really becomes a mainstream language.
1) Horrible syntax
It looks like a mix between Visual Basic and Pascal. I can’t imagine coming back to a large project with hundreds of files and functions and trying to keep everything organized. It would be even worse coming back to a project that someone else created.
2) missing/lacking documentation
Most popular languages are documented very well. For instance, you can go to the main php website and find out how to do pretty much anything (in english or almost any other language). Ruby’s documentation is available, but needs a lot of work to help out developers that are learning the language.
3) slow
Ruby is noticeably slower than other interpreted languages. I am not the only one that has seen performance issues. More on this can be found here. Jruby, a pure-Java implementation of the Ruby programming language, might help increase execution speed.
4) lack of libraries
Just searching google for ruby libraries or extensions doesn’t return many results. This also might be because it is a relatively new language compared to much older languages such as Java or PHP.
5) poor unicode support
Although there are Third party libraries that enhance ruby unicode support, it should be built into the language itself.
11 Comments so far
Leave a reply






You don’t know what you’re talking about.
1) How does file disorganization have ANYTHING to do with syntax?
2) This is the only true thing you’ve said in the post.
3) Jruby wasn’t made for performance issues. Plus, it’s not that slow.
4) There are plenty of libraries for Ruby, they just are harder to find. Oh, and Java, Ruby, and PHP are all the same exact age. Way to go.
5) So you have to use a library to get the perfect unicode support you want? get over it.
“You don’t know what you’re talking about.”
ahh, another ruby fanboy.
“1) How does file disorganization have ANYTHING to do with syntax?”
The syntax is so horrible, it makes your projects look disorganized when you come back to them.
“4) There are plenty of libraries for Ruby, they just are harder to find. Oh, and Java, Ruby, and PHP are all the same exact age. Way to go.”
If that’s the case than ruby is a lot worse off than I thought. I was actually exusing the slowness and bad documentation due to ruby being a newer language. Now it just sounds like a bad language overall.
“5) So you have to use a library to get the perfect unicode support you want? get over it. ”
I will. I’ll use something other than ruby.
AC: How do you know what JRuby was made for?
1) I believe the OP was referring to the syntax of the language, not the file layout. Whilst endlessly frustrating, a ruby on rails application’s file layout is quite a good thing.
2) Correct again. This is a maturity thing, whilst Ruby itself may have been around for a long time - there’s relatively less documentation because it hasn’t been used as widely. This will change over time.
4) My only foray into Ruby on Rails had this exact problem, there were only a handful of modules all of which broke compatibility between versions, if they even worked in the first place.
Please note that whilst Ruby the *language* has been around for a long time, the Rails framework has not - and is quite infantile.
Likewise, and you’ll excuse me for ranting in this forum, Ruby on Rails demonstrates a CONCEPT, the Model/View/Controller paradigm - for which implementations exist for most other web-capable languages, for example Catalyst for Perl and CakePHP (and others) for PHP!
Ruby on Rails is a fantastic platform, if only to spread the notoriety for the MVC paradigm, however 90% of the people using it are the guys who are just jumping on the bandwagon and giving it a bad name by making fanatical posts like these!
Gotta say I didn’t like the syntax either. I’ve only played with it for a while tho… so I never really got used to it
1) I didn’t like the look of the syntax at first because it looked like Visual Basic. But now that I see how fast it is to write I love hit.
Well I don’t agree !
First, let’s don’t mix up Ruby (the language) with Ruby on Rails (the framework) Ruby is a language that exist since the mid 90’s, while ruby on rails is a complete framework based on Ruby, created in 2001.
how can you compare ruby code to visual basic ?? Ruby is a pure object oriented language, where every attributes have obvious names.. it’s short and self explanatory, not a fuzzy mess that you code with mouse clicks in visual studio.. (okay, I really dont like visual basic)
the structure of the files is just amazing, it’s just so easy to follow the rules and have everything perfectly organised… and yes, it’s as easy to take a 1 year old code, as take the code from another developer, that’s the whole point of following the standards.
if wanna compare to PHP, let’s compare to symphony or cake, those are really nice MVC frameworks, but they only try to copy what RoR does, the structure is not easier to follow, and it’s not as strict as RoR, witch can bring many errors.
The documentation is not as complete as PHP ok, but once again, compare it to the framework, cake and symphony are far from having the same support as RoR.
the the speed…. it can be slow in development environment, but once you go into production, you get a real powerful caching support, that I was never able to achieve with PHP.
Libraries ? well yes and no.. if you find good plugins repositories such as technoweenies, you just get anything you want… compared to PHP where you can find 5′000 libraries for anything you wanna do, sometimes 4 years old or more, and never optimized to the PHP improvements…. Rails plugins are usually versionable with subversion and follow all the RoR improvements.
Unicode support ? as justin said, one plugin solves it all….
have a look at http://www.railsenvy.com/
“First, let’s don’t mix up Ruby (the language) with Ruby on Rails (the framework) Ruby is a language that exist since the mid 90’s, while ruby on rails is a complete framework based on Ruby, created in 2001.
how can you compare ruby code to visual basic ?? Ruby is a pure object oriented language, where every attributes have obvious names.. it’s short and self explanatory, not a fuzzy mess that you code with mouse clicks in visual studio.. (okay, I really dont like visual basic)”
I am comparing the syntax of the language. They are both messy, which can cause problems when you want to create large projects.
“The documentation is not as complete as PHP ok, but once again, compare it to the framework, cake and symphony are far from having the same support as RoR.”
Why compare with a framework? RoR is fully based on ruby..the language.
“the the speed…. it can be slow in development environment, but once you go into production, you get a real powerful caching support, that I was never able to achieve with PHP.”
ioncube or zend works great for caching using PHP. There are also a few open source alternatives that work well.
The ruby syntax is perhaps unfamiliar, but once you get used to it you’ll find the syntax simple and refreshing, and a lot more readable than most other languages.
With any language, it takes time to get accustomed to it. I really don’t think you have nearly enough experience with ruby (or programming in pascal and basic, maybe even the three of them) to actually pull of a statement like ruby being like basic and pascal. I’m not a fanboy or anything, just someone who takes whatever’s convenient for me and makes what’s required with it.
- Anyways, an example of how pascal and basic are like like ruby (which btw aren’t OO) would be nice.
- Documentation is a well documented ^_^ problem with ruby, so kudos for being able to extract that original point.
- Organization and disorganization of code is primarily a management issue. I agree, all classes being open and all do create some problems, but i’m sure if you had any experience with large projects you’d know that code organization is not a trivial issue in any other language. You just have to do it, and tbh people were writing massive amounts of code in assembler and other “mainstream” sequential 2nd generation languages before you came along and credited syntax for code organization.
- Does C has native unicode support inside the “Language”? or is it not mainstream enough?
I think you should study some of the stuff before you put something out there which may wrongly advise people starting out. I think there’s a responsibility issue here.
“With any language, it takes time to get accustomed to it. I really don’t think you have nearly enough experience with ruby (or programming in pascal and basic, maybe even the three of them) to actually pull of a statement like ruby being like basic and pascal.”
I have many years of experience in C,c++,assembly,pascal,basic, and now php. I am more than qualified.
I’m not a fanboy or anything, just someone who takes whatever’s convenient for me and makes what’s required with it.
- Anyways, an example of how pascal and basic are like like ruby (which btw aren’t OO) would be nice.
“- Documentation is a well documented ^_^ problem with ruby, so kudos for being able to extract that original point.”
Just because it is well documented does not make it any less of a problem.
“- Organization and disorganization of code is primarily a management issue. I agree, all classes being open and all do create some problems, but i’m sure if you had any experience with large projects you’d know that code organization is not a trivial issue in any other language. You just have to do it, and tbh people were writing massive amounts of code in assembler and other “mainstream” sequential 2nd generation languages before you came along and credited syntax for code organization.”
Code organization is much easier in a language such as PHP than ruby. I didn’t say it was impossible to have organized ruby code. Just more difficult.
“I think you should study some of the stuff before you put something out there which may wrongly advise people starting out. I think there’s a responsibility issue here.”
To tell you the truth, people starting out should not be using ruby. By learning a language like perl or PHP..you can quickly move to other languages that have a similar syntax (c,c++, even javascript).
and a responsibility? you act as if people’s lives are at stake. Until some of these things are fixed, I won’t be using ruby anytime soon.