Chapaev wrote an interesting article - if you liked the article - you add karma to a person so that he can post articles himself (North)
I ask pregnant women and children in advance not to start reading and commenting on this article - it will be hot inside. I also ask you not to let all the dogs go to North'a, who posted this article, because karma does not allow me to do this. This article is about why I love Ruby & Rails and actively follow their development.
I myself am leading all my development in Java. On Habré, one of the technology criteria is “How many of the top 10 web 2.0 sites run on it?”. Java also participates in another competition: “How many of Fortune Top 1000 companies are heavily using it?”. Yes, this is not Digg & Wikipedia, this is IBM, Oracle, Google, Accenture, Voca, Saber, Wallmart, 9 of the 10 largest banks in the world and many, many others.
')
Actually the question arises - why did I pay attention to Ruby. In general, it was recommended to the programmer to study at least one new language per year, but Ruby fell into my circle of interests because of Rails. It all started with the way I once again devoured with Web-development in Java and went in search of a new Java Web-framework'a. There are so many of them in Java that Neal Ford (the architect at ThoughtWorks) once even wrote a book on this topic, and Matt Raible (the creator of Appfuse) annually holds presentations on this topic. Probably any idea was either embodied in Java first, or ported to it. We have the grandfather of Strus, one of the first MVC Web-frameworks, the template engine Velocity (hello Smarty!) And JSF (hello ASP.NET) and many, many more. So at that time there was just one of the peaks of Rails-hype, which leaked onto TheServerSide and JavaLobby, so I decided - why not try it?
Since that time, I have been looking at all Java Web frameworks with contempt, the Web has to be written in Rails and only on it, in this case Rails is the “best tool for the job”. Just because it is KISS & DRY, which is so hard to get in all Java web frameworks. Yes, at work you have to write Web in Java, so I chose the lesser of all evils - Google Web Toolkit, and now I don’t have to meet with all these JSP + JSTL / JSF / Velocity, a bunch of XML files for the config of everything and everything + somehow Struts / Spring MVC / Tapestry, add more fashionable AJAX: JavaScript + jQuery / Prototype. GWT allows you to write only in Java, and not think about the rest, including JavaScript)
So back to Ruby. So why it matters?
Implementation
Ruby went the right way. From version 1.9 in the hands of developers, it is no longer an interpreter, but a virtual machine. This gives Ruby a big performance advantage over the rest of the dynamic languages ​​being interpreted, in particular PHP. The interpreter will never be faster than a virtual machine. The second joy is the presence of JRuby & IronRuby. Now you can get to Enterprise in two ways: think up a technology that will be looking for damn good as Java / .Net, or will be very closely integrated with them. Ruby chose the second path and so far he has been making great strides. By the way, JRuby-implementation already overtakes almost all MRI tests (Ruby 1.8.6), and recently Rails Performance has been pulled up and the only plug is now Oniguruma port, the Ruby RegExp library, which is actively used in Rails.
DSL & Meta-programming features.
This is one of the next big thing. Domain Specific Languages ​​are domain-specific languages ​​created for solving specific problems. So Ruby allows you to easily create such languages ​​at the expense of its structure. DSL in the very Ruby-world of darkness: ActiveRecord (all sorts of has_many: items), Rake, RSpec, and many, many others. What is DSL and how does it look? DSL can look like this in any business application, where you need to replenish the account to the user and send him a notification.
with Client "1234-567890" do
pay 500
send_mail: new_payment
end
Take an example from Hpricot, an HTML parser. This code loads the page, changes the CSS class of the link and displays the result on the screen.
doc = Hpricot (open ("
redhanded.hobix.com/index.html "))
(doc / "span.entryPermalink"). set ("class", "newLinks")
(doc / "# sidebar"). remove
puts doc
In general, the DSL topic deserves separate consideration, and probably someday I will write a separate article about it.
Community.
The rails community somehow reminds me of Indian culture with its three pillars: tradition, unity and diversity. Probably only such people as Matz, why the lucky stiff, DHH, Martin Fowler can work productively with Rails while observing DRY & KISS traditions and moving forward, presenting more and more new ideas. It was after Rails that REST became popular, it was after Ruby that Smalltalk adepts rejoiced at the resurgence of DSL and meta-programming, it was Ruby & Rails that gave me a breath of air after Java. And unconditionally, Ruby & Rails is the next evolutionary step after Java to the dream of all imperial Lisp programmers)
That's all for now. Thank you all for your attention!