Xavier Noria on Rails 6, consulting and more

Already this Saturday, we will meet with all the rubists at the main conference devoted to this technology - RubyRussia 2019 . September 28 is very close, and in this interview questions for Xavier Noria were prepared by Evrone developer Pavel Argentov , and students and teachers with whom he works on the course “Internet Programming Languages” at MSTU helped him.



image

A rare photo from the last visit of Chavier to Russia - at RailsClub Moscow 2012



What do you consider the most interesting and important of what has recently happened in the world of RoR?



I think Rails 6 was an impressive release. New core components, support for multiple databases, parallel testing; A new bootloader that “sends history” to the famous auto-rake.



You make a living with Rails consulting. What did this give you as a programmer?



Mostly, it gave me experience and awareness that ordinary work cannot provide. Consulting enriches. Every company and every team, they are different. You come across various areas of business, cultures, workflows, architecture, features and preferences. Adaptation to mobile environments, the tasks that have to be fought, retain skills sharply honed to solve problems.



Continuing with the previous question, based on your experience, what should Rails developers keep in mind?



Developers first need to know Ruby and Rails as deep as possible. This means reading books and documentation, not scattered blog posts. The master must own his instrument. For example, you need to understand SQL well so that Active Record is a catalyst for the process, not a black box. Use Active Record - to easily and safely generate SQL that would otherwise be handwritten - and easily process the resulting datasets. A decent understanding of HTTP is important because it is the language the application speaks to the outside world (including remembering WebSockets). There are many other things to keep in mind, but I would particularly note performance. You need to know how to drive benchmarks, you need to know about GVL in MRI and all that. Look for resources on this topic, study them, develop informed intuition.



Is Ruby really the language that makes the programmer's mind better? How to get the most out of this?



I am personally skeptical of such generalizations. Ruby excites me, and Scala excites Scala programmers. I have been doing Perl for some years and love him very much, but many do not like him. Different brains find pleasure in different formalisms, even your own preferences may change over time. As a programmer, you are better off using as many languages ​​as possible and as many paradigms as possible. The language that broke my mind was Prolog. The paradigm that influenced me the most was “literary programming” in the Knuth style. Going through these completely different programming methods makes you better. I find Ruby particularly flexible and high-level.

High level helps to argue "closer to the task." It attracts me to super high level languages ​​(VHLL). I am a mathematician by education, and I can work with any formalism that they will plant; programming languages ​​here are children’s toys. Turing completeness, for example, does not coincide with practical equivalence. To solve real problems, it’s hard to come up with something better than VHLL. You feel really powerful and productive, because there is less artificial complexity, and you can better concentrate on the real solution to the problem. Solving real problems was what made me pursue a career in programming. Generally speaking, “where C is needed - take C”.



We are making the conference more “Ruby” than “on Rails”. What Ruby applications exist besides Rails, or even besides webdev?



If memory serves me right, the first Ruby program I used was the FreeBSD Port / Package Manager. That was in the early 2000s before Rails. Popular Ruby software not directly related to web development is Vagrant, Metasploit, Jekyll, Chef, Puppet, or Homebrew. In addition, systems in Rails companies rarely consist solely of a web interface. Typically, there is a whole ecosystem of software. A company whose main language is Ruby usually also has pure Ruby back-end software (perhaps in conjunction with other technologies).



For example, in the company I am currently consulting with Stuart Delivery, I have just implemented a service that accepts messages from Kafka to Redis for processing by Sidekiq workers. We also worked on a non-trivial data migration project and on a super-interesting business emulator. Everything is written in pure Ruby. The frontend of the server side of the company is Rails, but behind the scenes and on the whole platform there are much more different programs and languages. This is a common occurrence in my practice.



Spoiler time - what will your report be about at RubyRussia 2019?



I'll talk about Zeitwerk, the new Ruby gem that implements autoload, reboot, and active boot for Ruby projects. Rails 6 delegates these features to Zeitwerk by default.



What's your best impression of the Ruby world? Perhaps code, technology, knowledge or attitude?



This is a subjective impression, but I think the Ruby world was surprisingly innovative. We talked about this with Terence Lee some time ago. For starters, I think it's hard to disagree with the statement that Rails represents a real revolution in web development. Companies like Heroku, New Relic, Shopify or GitHub were just revolutionary. However, in my experience, people who gravitate mainly towards certain communities are partly blind to what is happening in the communities in the neighborhood. I’m sure that innovation can be found in any community, be it Scala, Haskell or even Brainfuck. Thus, if I could globally observe each community, I would find that the Ruby community is not particularly innovative because they are all innovative in one way or another.



In your opinion, does Rails need something like a standard CMS component library? Like scaffolds for building standard CMS parts?



In my opinion, this is a bit off topic for Rails. Let me also use this question to comment that scaffolds are just an affordable way to make a quick demonstration at a conference or generate an application to check something, reproduce an error, see how a certain function works. I have never seen scaffolds “in battle”; they are not suitable for practical use.



Modern solutions are generally heterogeneous: we can use Julia for ML, Java for heavy business workloads. Does Ruby Provide Tools for Language Interaction Enough? Are there any tools to make this easy?



JRuby communicates with Java natively. You can write C-extensions for MRI, you can wrap C-libraries in a portable way using FFI, and Helix allows you to write extensions in Rust. Generally speaking, it is easier to communicate with processes in standard ways using the file system, sockets, HTTP, databases, gRPC, message brokers.



As many have noticed, Ruby is no longer "new and shiny." Now it is more “good old language”. Students, on the other hand, are young. How to motivate their interest in learning Ruby?



In the 2000s, for seven years in my free time I taught Perl to students at the University of Barcelona. Before my course, they dealt mainly with C and Java, and I talked about scripting languages, and Perl used as an example. It was very funny. We need a fascinating program that will teach programming, and will emphasize what is available with these languages, and will allow you to delve into a specific choice. In the case of Ruby, this is from a simple OOP implementation to fantastic metaprogramming capabilities. You can show, for example, how the Active Record model works without a single line of code in the class body.



There are dozens of programming languages ​​to choose from. Why choose Ruby, why not Python or JavaScript, how about Clojure, Rust, C ++, Go? All options are controversial or vice versa - these are all great options. Choose one, make the course memorable, get students to study programming, best practices, the concept of idiom, let them learn how to check documentation, and explore important related issues that go beyond formalism. This is what will make them grow, prepare them for the profession fundamentally. In my opinion, this is the role of the university.



There are many different tools for the same thing: Rails core with Active Record, Dry-rb and others. Should I grab onto the alternatives? Do they not make Rails “paths” instead of “paths”?



It largely depends on individual preferences. You should definitely study and understand the combinations of tools, layers, patterns that suit you. It’s important to remember that the “Rails path” does not mean “drop the entire application into the default folders”. This is a common misconception. Do you want decorators? Service objects, POROs? Fine! This does not go against the so-called “The Rails Way”. Rails provides a set of default abstractions and organization of code, which, in our opinion, is good enough for many applications, at least as a starting point. And then, if you like to write controller actions as single-line files that unload all the work into service objects, you can do so. Some may not like this. Different people - different brains.



See you at RubyRussia!



Recall that the conference is already this Saturday, registration is still open.



There will be not only reports, but also stands of the best companies:



Organizer - Evrone

General Partner - Toptal

Gold Partner - Gett

Silver Partners - Valarm , JetBrains , Bookmate, and Cashwagon

Bronze Partner - InSales



All Articles