📜 ⬆️ ⬇️

Not quite cool Ruby

image

I remember how two years ago I ran into Ruby. The language seemed beautiful, everything in it is clear and simple, there is nothing superfluous, there is nothing obvious. As time went on, the skills grew, times changed and now Ruby does not seem so attractive to me as before: it works slowly, and large projects are hard to maintain. Why? Because large projects and Ruby are generally incompatible. You see the speed of execution in other languages ​​and you want to cry - due to the fact that once the choice was made in the direction of this programming language.

Below you will find the 5 most depressing things in Ruby. All of them are painted quite superficially.

1) Rails


It used to seem that you could write everything on Rails. Quickly and confidently. Do not doubt the support of the community and generally flourish. However, it turned out that Rails is another RAD technology, in which, God forbid, you will retreat to the right or left. And if you want to use NoSQL or even XML? How? But in any way, you can safely cut out half of the libraries and not even bathe, but do not forget that Rails will not work faster from this, no, no, you will also have to wait for a very long time until the project loads all dependencies you do not need. You won't get any flexibility with Rails.
')

2) OOP


Someone can safely say that Ruby is OOP language, but then he will be mistaken. After all, in what programming language Private is not Private, but “Well, as if Private, but so can be and not Private.” About Protected and there is nothing to say, until the release of Ruby 2.0 Private and Protected were no different at all. Why all this is implemented in the language? Would sit like a JS and not steamed, although even there is at least some sort of separation (though not obvious). Have you heard about Abstract classes in Ruby? Not? Of course not, because they do not live in this house. I, of course, not against Modules in Ruby. But you tried to track all the places where you added this module? And if the project is big? You will never find exactly where exactly one module was inserted. You can, of course, write tests for this, but who in your right mind will write tests for inclusions (includes)?

3) Execution speed


This is generally a sore subject. The speed in comparison with other languages ​​is simply amazing (JS, GO): usually filling the array with numbers and summing all the elements in Ruby will be executed in 0.15, in Node.js - 0.056, in Go - 0.005. And as it seems to me, this is a serious bid for speed drawdowns. However, I did not use the old version 1.9.3, no, I took the new 2.2.0, where everything should be rosy and beautiful.

4) Multithreading


Well, in your language there is no speed, there is no small resource consumption. And what is there? Maybe multithreading done? But no, there is no multithreading here, no, well, it is there, but in my opinion it is not right when it works faster and faster in one than a few. Of course, there is an option to use Rubinius and its cool native threads, but you understand that it will not support half of the libraries. And this actually leads to point 5.

5) Cross-platform


It would seem that Ruby is all so cool with a huge community, but even here there is a catch. So far, nothing has been done under Windows. All web projects are sharpened for Unix and this is a little insane. Not that I was a big fan of Microsoft products, but I still want to have a choice. I want the team to use exactly what is convenient for it (we have a Windows fan and Frontend developer in the team, and we have to run the project in a virtual machine), rather than what the programming language dictates (when it comes to web development). After all, node.js can work under Windows, Java can work under Windows, and the vaunted Ruby is not.

So I listed the main problems of the Ruby and Ruby community. I began to attribute Ruby to the number of useless languages ​​- as useless as Python or Rust. What they exist for is not very clear, but they exist and will continue to exist as long as people remain who are confident that these are the best languages ​​of the modern world.

Source: https://habr.com/ru/post/257513/


All Articles