L. Guidi: "The strongest part of Rails is solidity"

Family man, software engineer, Open Source indie developer, speaker,  author of Hanami, a full stack web framework for Ruby
13 September 2017   1220

Luca Guidi
Luca Guidi

Software engineer, Open Source indie developer, speaker. Author of Hanami, a full stack web framework for Ruby.

On the eve of RailsClub 2017, on which Luca will be one of the speaks, we questioned him about his job and his views on Ruby development. 

What’s your programming background? It looks like you should have some programing experience before Ruby. How did you come to Ruby universe?

I started doing programming when I was teenager at high school. Then I’ve started my professional career about 15 years ago. I was a webdev, writing in Java which was horrible for me. I did that just for a couple of years and it was painful. Then I switched to Ruby because of rails. It was revolution at that time. It made web development less painful. since then, the Rails pre-1.0 era, my main language is Ruby. I also learnt Go and few drops of Elixir which is interesting for me whereas Go is what I use in production at work.

Do you think Ruby is a better OO language than the others?

If we look at OO way of the things, in Ruby it sounds more natural for developers and it is better object oriented language. In my opinion, Java is like an unenhanced version of C. In Ruby, for me, at the beginning, the mind-blowing fact was that everything is an object. Even numbers. It takes some time to understand at the beginning, but then it makes sense and then it unleashes a lot of tricks regarding polymorphism — like passing around the objects that “quack like” an Integer, for instance. It provides a lot of flexibility for method signatures you are designing and also the implementation you can be focused on. On the other hand I think that ruby missed an opportunity of having the interfaces. Because you can’t define which behavior you want to accept for the method. It could be really useful for you as a library maintainer. That is a missing part. I hope someday it will be fixed. Also, I don’t think the libraries implementing “the missing parts” will determine the real future of Ruby. These new features will work once they are a part of the language core. And of course it must be done right.

What in your opinion are the strongest or the weakest parts of Ruby? Is there life in Ruby besides the Rails?

The strongest part historically is the solidity of Rails. The fact that Rails had become huge platform. It is important not just in Ruby ecosystem but also for web development as a whole.
You may notice that when Rails came in, you may notice the huge level of adoption for the language. It gave Ruby the credibility. But the worst part is that Rails took over Ruby entirely. That created a monoculture in my opinion. There are programmers, that only know Rails, but not Ruby as a language. There are gems that assume that you use only Rails platform. It is something that can damage the language. You should expect problems when you try to work outside Rails with, say,  Hanami or systems automation. So Rails in my opinion is major good and bad for a Ruby community.
Now more about goods and bads. I think it is the greatest time for a Ruby ecosystem. Look at good parts. If you have a 5-8 y.o. rails app, good news for you — apart from some upgrading rails problems, you’ve got covered because original recipes of the framework stay unchanged for more than a decade. But at same time I think that ecosystem and language that does not evolve and knows only one way of doing things will eventually fade. But there are good things about it that happening now. Think of Hanami which riches 1.0 this year, more and more apps running in production. Think of ROM which riches, I think, 4.0. Think of Dry-rb, the set of tiny libraries for things like data manipulation et cetera. That is basically the good news. If Rails is good for you as a developer — Rails has the solidity that you need. If Rails doesn’t suit you — you have alternatives.

You wrote Hanami. Why do we need yet another web framework?

There are a lot of web frameworks in Ruby ecosystem, but in general, they are just the clones of Sinatra. Hanami is different in a sense it doesn’t repeat Sinatra. It adopts ideas that are good in Rails along with others we have to adjust. My point is, even if you stay with Rails forever, take a good look on Hanami or other ruby frameworks and learn from them.

What would you point out as the most useful gems/ideas in ruby?

I still have to mention “rom” and “dry-rb” because it is interesting blend between FP and OOP. Especially for “dry” libraries. They are really interesting and I think everyone has to look at them. Not just for hype but because it helps a lot to understand about immutability and deterministic objects. It’s important to make the things in a way so for the given input you have the expected output.   

What in FP in your opinion is worthy of an object-oriented rubyist attention?

Immutability and composition. Not necessarily in pure functions. You can have a look how things are done in Elixir. My idea is to blend together FP and OOP. I’ll give one example of that, Function Objects. It’s an object that accepts an input and returns output as a function but also have some kind of state or has a way to call it in a way that doesn’t require all that state and dependencies to be passed around. And at the same time by definition a function object does one thing and does it well — that’s for single responsibility. Thus combining composition and immutability, it is always predictable. Those are the concepts still open to discussion and experimentation. This is something that I want to present at RailsClub. It’s about the future — the new way of doing webapps with Hanami.

So, what your talk at RailsClub will be about?

I will speak about the blending of OOP and FP. How has it been an intuition in Hanami 1.0 series. For instance, Actions. Actions are objects which expose just one method that takes input and returns output, the HTTP response serialized with Rack specification. We have validators that act similarly. The idea is to take a look of what we have right now and standardize it as behavior for 2.0. Trying to build a webapp for each use case, for each feature that you have in your webapp — it’s like a pipeline of functions combined together. Where you take an input, you validate, coerce, manipulate, process and then return something to the user. That is something I what to present. I want to standardize the set of objects that we have. It goes beyond MVC. Because in MVC you get a request for a controller, you do bla bla bla, you don’t know what goes inside. Everyone wants to define their own workflow there and then return a response. Inside of that layer, our goal is to have a pipeline of data transformation. If you want to describe what webapp does, it basically takes data input, eventually process it in the database and returns data output. If you think about those data transformations, you have it step by step. If previous step was successful, you continue. Otherwise, you handle the exception or an error the previous step returned. It has to be standardized in my opinion.

What resources would you suggest to both newcomers and experienced rubyists?

I suggest Sandi Metz book “Practical Object-Oriented Design in Ruby”. Because if even she doesn’t speak about functional programming, it is important to understand the object oriented part. It’s not natural to just turn Ruby into a functional language, you have still to take all the good parts of Ruby well described in that book. Another book is “Exceptional Ruby” by Avdi Grimm. It’s a short book, basically questioning why in Ruby ecosystem we use exceptions to signal errors. Exceptions should be for exceptional events like “database is gone”. But not for other stuff like database check violation. For example, in new programming languages like Go and Elixir, you never see exceptions, only errors. That makes virtual machine less heavy if you use errors not exceptions. Also, it keeps your code more natural. It is short but solid book about one concept that changed my mind. I also invite readers to check how things work in functional programming and what we can borrow from there. I don't have any book suggestion for that, I just learn Еlixir via their guide. It is good to get a sense what’s going on outside the ruby community.

How would you encourage developers to join Open Source?

It is matter of giving back. For example, Rails, which is open source project, is free in terms that it costs nothing but it helps people earn money. It’s just a matter of recognize the value that it has for you as a developer, for you as a company and give back. It doesn’t mean that you have to spend whole week working on open source. Just help others from time to time. For example, I started the hanami with 30 minutes a day. I’m a big fan of baby steps. Open source doesn’t have to be second job for you. Be open source oriented rather than just a contributor. For instance, you can add some worlds to outdated documentation. It will take 5 mins, but it is very precious for the community. If you find a bug, open a github issue. Also, speaking of the selfish part, contributing to popular projects is great for your CV. You learn to work asynchronously, it is the future of our job, in my opinion. You learn to be patient, you learn the philosophy, you learn how to fit in different setups and visions. It will help you to adapt to the next job and will help you to know Ruby better. You will learn how to read someone else’s code. Long story short — you will learn a lot of skills that makes you really good candidate for your current company. Or, it with help you to find better job if you are bored with the current. It not only helps you to be a good programmer but also gives you a set of skills around programming that helps a lot.

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   920

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.