📜 ⬆️ ⬇️

Interview with Eric Michaels-Auber, RubyHero-2014

Eric is the Ruby Hero of 2014, a popular mentor among various Ruby communities (Ruby Summer of Code, Google Summer of Code and Rails Girls Summer of Code) and just an interesting person. Initially, the interview was supposed to look in the style of “briefly continue the phrase,” but Erik approached the matter creatively, so I publish it completely.


I started working fully on Ruby in 2006 , when my team decided to transfer our web application from PHP to Rails. Rails at that time was at version 1.0. It seems we used Ruby version 1.8.4 and a Mongrel web server. This was before Rack, Bundler, RubyGems.org or GitHub. Looking back, it’s hard to imagine working in Ruby without these tools that I now use every day.


Ruby helped me realize that people are more valuable than computers . Most programming languages ​​are optimized for fast code execution. Ruby is optimized so that you can quickly read and write code. This changed my understanding of the code, now I am writing for people, not for computers.


Ruby is a very cool language, but I like the Ruby community a lot more . Being a part of it, I communicate with great people around the world. I like to meet new Ruby programmers at Meetings and conferences. I learned a lot from those who openly share their knowledge in their blogs, podcasts, videos, etc. I love Rails Girls, RailsBridge, and other IT communities that make programming more diverse and informative. I like the creative spirit of the Ruby community, which inspires to create such projects as Artoo, Kids Ruby, Shoes, Gosu, Sonic Pi, etc.
')

I think Ruby will be better if its syntax is more consistent. For example, in Ruby there are 2 different ways to make a hash and 7 different ways to make a function (def, proc, Proc.new, lambda, ->, {}, do ... end) compared to JavaScript, which has the same hash / object syntax and one way to define functions, regardless of whether the function is named or anonymous. Ruby also has too many pseudonyms compared to the Python philosophy, which says that there should be only one obvious way to do something. Design is the art of decision making. If there are several names for one method (for example, map / collect, reduce / inject, find / detect, find_all / select, etc.), the creators of Ruby avoided a hard decision by passing this choice to the user. Ruby also has many similar names for methods that are somewhat different (for example ==, ===, eql ?, equal?). I have been using Ruby every day for almost 10 years, and I still can't remember the difference between eql? and equal ?, without seeing the hint. I would like these methods to have more descriptive names.

Another example is the subtle differences between alias and alias_method, or private and protected. I think Symbol can be replaced with a frozen String and removed from the user part of the language. There are several other language "features" that I would like to exclude from Ruby if I could, for example global variables that come from Perl. In my opinion, this is not related to the rest of the language. There are also a lot of poorly maintained and outdated code in the standard Ruby library. I would like the standard libraries to be updated to use new language features, such as keyword arguments. If such functions are not used for basic / standard libraries, they should be excluded, since they create unnecessary complexity. It would be great if Ruby had the opportunity to find some kinds of errors at the initial stage (at startup).

And a dynamic compiler capable of generating binary files would not hurt. And better execution performance. I began to use Ruby Crystal instead, to which my report will be devoted, since it contains most of the functions that I like in Ruby and those that I do not like are missing.


The first thing that comes to mind is how Rails performs the uniqueness check. For those who do not know, it simply makes a SELECT to see if a field exists before doing an INSERT. The first problem is that these two operations are not done in a transaction, so that conditions arise for the appearance of race signals that allow you to insert non-unique records. However, transactions, in principle, are not a very good solution, since they cause too many table locks. The best solution is simply to create a unique index on this field in the database, which guarantees correctness and optimal performance. Rails’s approach to validating uniqueness is a weak defense that gives the user a false sense of security.


This is news about the creation of RubyBench.org by Alan Guo Xiang Tan (Alan Guo Xiang Tan). This is an incredibly valuable (and long awaited) contribution to the Ruby community. This project will guarantee Ruby's productivity growth, and with each release it will become faster and faster. If RubyBench existed before, it could prevent performance loss in Ruby 1.9.


Crystal ! To find out more, come to my report :) (At the end of May, Eric will speak at the Ruby conference in Kiev with the theme of the Crystal report).


At the moment, I'm working on rewriting the Twitter CLI under Crystal and also teaching students on Rails Girls Summer of Code


A special place in my development environment is occupied by the Fish shell , which I recommend to anyone who spends a lot of time on the command line. Try to use it for a week, and you can no longer do without it!


Ruby-Talk, Ruby Weekly, and This week in Rails mailing lists. Blogs Aaron Patterson, Aman Gupta, Sam Saffron, James Edward Gray II, Thomas Reynolds, Sandi Metz, Tom Stuart, Avdi Grimm, Jessica Kerr and Pat Shaughnessy. I also read a lot of non-Ruby blogs.


“Ruby Under a Microscope”, by Pat Shaughnessy , as this is a breathtaking look at how Ruby works from the inside. I would also recommend Practical Object-Oriented Design in Ruby, Sandi Metz to every Ruby programmer who has not read it yet. For a better understanding of IT as a field of study, I recommend Understanding Computation, Tom Stuart. And for very beginners, I recommend Learn to Program by Chris Pine. Finally, the book's Why's (Poignant) Guide to Ruby holds a special place in my heart.


Add this line to your crontab : * / 30 9-17 * * 1-5 say "Stand up and walk around".

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


All Articles