Jacks_Depression

Jacks_Ruby Folklore

Posted: 2009.09.22 20:51

Like Communism, Ruby works in theory. In reality Ruby is the new php. It has a place in this world but quite often ventures into places it does not belong. Or in interwebs terms: That noob just used Ruby to write a CMS, rofl.

Before I get a little deeper into my take on Ruby, I feel I need to give you a little background as to my experiences with it. In the only job I ever used Ruby in, the only job I will ever use Ruby in, things did not go well. I was going through a rough spot in my life and even though I consider programming challenges to be a remove from every day life, that could of still affected my opinion. Not only that, but I found many people at that company to be very stuck up (after all, they where MAC users). And things did not end well with them. So, that said, let the Ruby bashing begin!

Ruby's syntax and style most resembles a group I have heard called "Very high level languages". Other languages in this group include, Python and Lua. In this group Ruby is by far the slowest. Mind you, this is not the fastest class of programming languages to begin with. So, Ruby is pretty much the slowest of the slow. Some times thats not a problem. Like when you just need to run a quick convince script to do some mundane task. The time taken to write the program is not worth the faster execution of the program. Like all the languages in this class, this is really the only reason why you would use them. This is the only area where Ruby truly excels in my opinion. Nothing is faster to pick up and run with. And thats where the real troubles start.

In programming in general, there are usually several approaches to solving a problem. Each has its own pros and cons. Usually, its a choice between two approaches, sometimes three. In Ruby on the other hand, you can do a single task about seven to ten different ways. Thats really not exaggerated, it is true. I had a hard time trying to figure out why so many existed. So in the end, its merely a choice of preference. No one ways is faster or provides more benefit. So, if you ever had to maintain someone else's Ruby code you'll probably have to figure out what half the code does because you have never used that way before. So, it is my personal belief that Ruby code should not be maintained. It should be written once and used as is, or use it is throw away code. (That means, used for a short period of time, then deleted because its obsolete. Usually throw away code only runs for a week or a month). Ruby works well in that set of circumstances, but is not all that common.

It dawned on me one day, trying to figure something out. Ruby is folklore. Its passed down from one generation to the next. Each person adding their own part it it. There is no concrete way of doing anything in Ruby. Not even in the documentation. I tried learning it that way and failed. I failed hard. Let me try to explain as best as I can why I believe this point without getting to technical. In other languages, there are variable types. Each type of variable can do certain things. For instance, you can divide a number by another number. You can not divide a number by the word "Ball". Because, that would not return something predictable. What do you expect 3 over "Ball" to do? So, there are a set of rules as to what can do what. In our example, numbers can only be divided by other numbers. Ruby tosses all rules out the window. Such that, if you tired to divide the number 3 by a word, it will actually return something. No one would probably know the significance of what is returned. But the point is that it tired anyway. Now, we take it one step further. If you told ruby to divide the number 3 by the number seven and added the word "Ball" after it, it would probably still give you back something. This makes absolutely no since if you ask me, but still works.


Note: this is just to try to get you to understand why Ruby is not documented. If you actually try this example it probably will not work.


Not only would this type of functionality be hard to document but other people would come up with their own unique ways of doing things. Once again, it looks like Ruby was designed to be easy. This is the only reason I can think of that such asinine operations would be allowed. By now, you should start to get the picture of how hard it is to work with ruby. More specifically, how hard it is to figure out how to do something or what something it actually doing.

So please use Ruby only when it is appropriate. Same thing I beg of php users


One last note of Ruby on Rails: I must say, there are a lot of clever concepts. But if only there where part of another language...

Another final note: I used Ruby over a year ago. Around July of 2008. Version 1.8 I think. Last I heard, they where trying to address a lot of the speed issues but I am willing to bet it remain the slowest in its class.