N. Shylnikov: "Active Record is a serious problem"

Interview with Nikita Shilnikov, Dry-rb and Rom-rb Core developer
20 September 2017   1038

Nikita Shilnikov
Nikita Shylnikov

Nikita Shylnikov is an experienced Ruby developer, member of Dry-rb and Rom-rb Core team. 

On the eve of RailsClub 2017, on which Nikita will be one of the speakers, we questioned him about his way to Rails and future of Ruby. 

How did you start programming in Ruby?

Everything was simple. I hadn't programmed for money before. At first I was a manager, and I was offered to work as a programmer. I've agreed.  On that project, there were Ruby and Oracle (they are there now). Since then, I've been working in the same place for 7 years now, switching between tasks.

Do you have any "professional education" or did you study yourself?

I have a technical background. At the university, I've studied C ++, Prolog, and Assembler. Before I got a job, I've already known Javascript and C ++.

Did you immediately get involved in web development, or was there something else before it?

Where I came to work, there was a webproject on the Rails. The core of the system was in Oracle, and the interface on Rails, plus a little Javascript. Rails work well with Stored procedures, when they do not have business logic isnide :)

Now you are working in the web development?

In fact, yes.

And how did you come to the open source?

At one conference - I do not remember exactly - maybe DevConf, there was a section about Ruby. There, Kirill Mokevnin told about DDD, and I realized that everything we do at work is Domain Driven Design. Kirill said that there are problems in ActiveRecord with mapping the entities of the domain to the relational database, that there are guys who make the ROM, and they already released the DataMapper. This interested me, and since that time (2012) I started to follow the ROM. In 2015, version 1.0 was released. I just came up with a new project - I used Rails, because I already worked with them. I threw out ActiveRecord from there, inserted the ROM and started to struggle with it. In the course of this struggle, I came to the commits in the open source project ROM and dry-rb.

ROM and dry-rb are known for borrowing from FP. How do you think - is it important to add functional programming techniques to Ruby?

I'm not a fan of any particular programming language. I am for choosing the right tool for each task. There are general-purpose languages ​​that can solve different problems, and they have both strong and weak sides. Ruby itself, which appeared more than 20 years ago, was originally object-oriented. However, it was strongly influenced by LISP. Even Matz said that he wanted to make a mixture of Perl and LISP. And LISP is the first functional language. It turns out that if you look deeper, Ruby has functional ancestors. It seems to me that we are so focused on the OOP that we did not develop other sides of Ruby. I believe that you need to look at other programming languages ​​and take something that is applicable to Ruby. Can we combine FP and OOP? We'll try.

And why dry gems are called DRY?

In general, it's just a trademark. The essence of gems is to solve individual problems. For example, dry-types describes types, types can be re-used in different ways in different places. This is one of the meanings of the name.

In which direction will Ruby will evolve in general and the Rails in particular?

The standard question. Mats, for example, is afraid what happened to the Python: Python 2 and Python 3 was too big jump, I would not want such a repetition in Ruby. But the transition from Ruby 1.8 to 1.9 was palpable, but not painful. I do not think that Ruby will have major changes that will break back compatibility. I can not say anything specific about Rails.

What, in your opinion, is not enough in Ruby?

I can say quite definitely what Ruby doesn't have: pattern matching. In addition to applications, I'm writing a library code - there it would be great to use pattern matching. From the application point of view, you can add multithreaded programming primitives, get rid of GIL. There are still not enough non-commensurate structures: the idea of ​​non-profitability allows you to think about the code much easier, and this would be useful for beginners. In dry-struct, for example, we emulated the profitability. Probably, it would be great if such tools were in the language from the box.

In your opinion, the most notable phenomena in the Ruby ecosystem except dry and rom?

Hanami is a very interesting project. This is the right tool with good documentation, which is understandable where and how to use it. It's very cool that we have an alternative to Rails, and it does not consist in creating a home-grown framework.

Why do we need the next Rails?

I've seen a lot of things by working on one big project. Started by dropping SQL from templates. In Rails, there are many unanswered questions about how to develop a large and long project. We have learned to work with this but have not reached standards, so it would be cool to have a framework where everything that is needed is standardized. A serious problem in Rails is ActiveRecord, a controversial pattern with certain flaws. For example, it's difficult to get off from. And, the more you "hide" the business logic from it, the better it works.

What could you recommend sites / courses / books for beginners and experienced Rubists?

I would advise newcomers to work with complex books like this: read for first time to put something in your head, and return to it as a directory as you work. An excellent example is Martin Fowler's "Patterns of Enterprise Application Architecture" The book was written in 2002 and is still relevant, many classes in the Rails took some patterns from it. Personally, I've got another book for experienced programmers - Martin Kleppmann, "Designing Data-Intensive Applications". This is not a very deep, but well-written book, with a bunch of links on topics of interest. The author mainly deals with the study of distributed systems, he was writing this book for 4 years, and it is devoted to working with data in various systems. There is given a clear, good description of many aspects of working with data, and it is not tied to a particular language. If you want to raise your level as a developer, that's it.

What is the biggest problem of the Ruby community?

We need to show that we have'nt yet uncovered the full potential of the language, and even if it is already over 20 years old, we can apply new approaches both in old problems and in new, developing areas!

N. Sutterer: "Ruby is dead. Long live Ruby!"

Creator of Trailblazer that introduces several new abstraction layers into Rails, Rails contributor and gem author, speaker at Railsclub
15 January 2018   919

Nick Sutterer at RailsClub 2017
Nick Sutterer at RailsClub 2017

Hello! Please, introduce yourself in few words.

My name is Nick Sutterer, I’m developing software for like 22-25 years and I work like a consultant of my open source project for different companies. Sometimes I give presentations at conferences.

Is it your first time in Russia, Moscow, RailsClub?

It is. Everything for a first time. I’m blown away!

How do you like it?

Great! It’s amazing! Since I arrived, people care about me, people take me out, people show me the city, people give me history lessons. It’s amazing. Great food. We go to places and have a drink. I go to hotel, sleep, and everything starts again. That’s amazing! I’m really enjoying it.

Can you tell us about your report in few keynotes?

My talk was about the lack of innovation in Ruby language and about innovations that is happening in frameworks, that use Ruby. I’m just showing what we have. I try to inspire people and Ruby core team to pick some ideas from other technologies and make Ruby even better.

Your talk is called “Ruby is dead”. If Ruby is dead, what’s alive?

Ruby is dead. Long live Ruby. I’m trying to be provocative with my talk. I’m still coding Ruby everyday, I’m still traveling to all conference because I still believe that Ruby is an amazing programming language. There’s languages, showing up recently. Elixir or Golang for example. They have completely different way. They deal with problems and they are way more innovative. But they are brand new. I, actually, don’t think that Ruby is dead.

What you don’t like in Ruby the most?

I hate that we keep thinking in really old way. We reject innovation. It is especially due to frameworks like Rails. I would love to the more development of Rails, with all it’s huge audience. Ruby is lacking a lot of features that a lot of other languages have, like pattern matching and method overloading. The problem is that sometimes I feel that we are behind the innovations that happen to other languages. Specifically features, that make other languages amazing. We don’t have them, and it’s very sad.

What is your way to improve Ruby?

Every time is meet Matz at conference, I tell him for few hours what should be done to improve Ruby. Without any providing any help. It’s all about innovations. I try to innovate in my own framework, Trailblazer. So we can put the way we write business code to new level. I try to inspire people with my library code they use new concepts in Ruby that never been there before. I think that helping them to write the applications.

How do you see the world of programming in 10 and 50 years? And will Ruby and Rails have place in this future?

I don’t think Rails will have place. I really love Rails community and people in Rails Core. But I don’t think that Rails will be a thing in 10 years. But I think Ruby will still be around. It all depends on what is going to happen with Ruby 3.0. When it will be released and what features will it bring. I think Ruby will still be there. But I can’t tell you what will happen in 50 years. Because in 50 years there won’t be a need to program anymore. We will probably just write diagrams on the air.

In your opinion, what technologies are the most hypest today?

Craft beer and coffee, haha! Everything that hipsters do! Now everything is switching from OOP to FP. We are trying to avoid to have unwanted side effects in order to not let users to screw up internal state. Functional programming makes it impossible to users to do stuff in wrong order, for example. Like problems that we have in Ruby. I see a lot of development in functional languages because they are also way easy to paralyze and they have a lot of advanced features.

What advice can you give to average programmer to stand out the crowd?

Important thing in IT is that you always need to play with new tools. Even if you are not a super programmer, you have to look at the community and check what’s going on. It is really important to keep moving. Otherwise, I see that my current job at the police is really slow. They using very outdated technologies. A lot of people are affected. It is non productive. It’s good because a lot of people are keeping their jobs . But it is important to adopt new technologies. I’m not saying be a coding hipster and change your framework everyday. But a lot of new things in last 10 years make sense. People should use it and not just sit there and enjoy excellent job. They can get fired tomorrow.

What makes you excited about your job?

That’s beautiful question. I think that idea of open source is that you expose code that you think is helpful and people will tell you that it really is. This is what keeps me programming. When I write something and I see that a lot of people use it and they say like “It is so much better that I used before!” It’s great! This is making my day. It’s all about what comes back. I also program my own stuff and sometimes I think: “Yes!” But mostly I like when something what I do is helpful to other people.

Do you have any plans on writing a book?

I have already wrote one book. Two years ago, it took like 16 months. I was writing and inventing at the same time. That was a huge mistake! I was keeping updating my book with changes in my library code. It was massive. I plan to write more books, because it was fun. It has to be with the right timing. I’m not gonna write a book about, for example, a new version of my framework now because it’s still changing. I’m not gonna make this mistake again. It’s so much work! Unbelievable.

Do you have any nightmares, related to you job?

I used to have those kind of dreams few years ago. Sometimes I still have them.You always imagine software as something visual. Brain just does that. My dreams about those thing and passing the objects. And it’s always the wrong object! It’s the only nightmare that I have. I was able to have good work\life balance. So I have very rare the bad sleep. Even if I don’t look like it.