Interview with Andrzej Krzywda
We at JetBrains are happy and lucky not only to develop our products but also to meet people who shares our passion about writing a better code. And today we have a surprise for you!
We’ve interviewed Andrzej Krzywda (@andrzejkrzywda), a person of many talents who is helping so many Rails developers clean up their code. Andrzej is the founder and CEO of a Rails consultancy; he also teaches Ruby and Rails at the University of Wrocław and maintains a professional blog. He wrote a book on Rails refactoring and he is also one of the organizers of wroc_love.rb conference. But don’t listen to me—let the man speak for himself!
1. Hi Andrzej, thank you for taking the time to speak with us. You are a highly recognized figure in the Rails world, but for those who don’t already know you, can you tell us a bit about yourself?
Hi, thank you for inviting me to this interview!
I started my first programming job in 2000. I tried most of the existing technologies at that time (PHP, ASP), but eventually settled with Java. In October 2004, when Rails appeared, I immediately fell in love. I still remember the first evening when I implemented a full TODO web-app. At that time it was hard to believe that you could start and finish a web app within one evening. I was working at a large, ‘enterprise’ company. It was almost impossible but I convinced the management to use Rails in early 2005. It was enough to gather all the managers in one room and implement half of the (estimated for 6 months) app in one ‘meeting,’ coding live.
That was the start of a great Ruby journey which is still ongoing.
As every programmer, I care about good code. That was always my passion. Quite early, I realized that it doesn’t really scale if I just write nice code. I can’t write all the code in the world, right? All the activities that you mentioned in the introduction are ways of improving the code, without writing it alone. I’m still coding as much as I can, but it’s no longer 12 hours every day, as it used to be.
Teaching, blogging, tweeting, organizing a conference, helping with a local Ruby User Group, running a Rails company (Arkency)—this is how I can influence the way code is improved.
The great thing is that I’m not doing it alone. The Arkency dream-team is my everyday surrounding (in a virtual sense, as we’re all working remotely). We’re challenging each other to be better.
2. You came to Ruby and Rails from the world of Java. Today you’re spending so much time working with Rails. What do you like about the framework? What are some of its weaker sides, in your opinion?
Rails is a great framework for rapidly developing web applications. It excels at prototypes and early versions of products. Rails itself is a bunch of libraries glued together. There are certain practices and conventions which together make building apps very fast.
Those practices are sometimes called The Rails Way.
The Rails Way is great for the beginning of certain projects, the phase where even the speed of typing matters. You save a lot of time by not needing any configuration code.
The later phases of big applications is where The Rails Way fails. That’s the weaker part of Rails: it’s not easy to keep the application modular. This often results in monolithic applications.
3. Some would say that Ruby on Rails is on the decline. Do you agree? What do you think about its future? Are there any other languages and frameworks that can successfully compete with Rails in web development?
Among the back-end technologies, I don’t think Rails is losing its popularity. Ruby is still a great language and Rubyists are not so keen to jump to a less elegant syntax.
It’s good to be aware of Trailblazer. It’s a framework on top of Rails that helps make Rails apps more modular. It may be a good choice for existing legacy Rails apps.
Lotus may become the alternative to typical Rails apps. It’s a new framework and it’s well thought out from the beginning. It has the advantage of not bringing the legacy of 10+ years of historical choices, as Rails does.
4. You care about code quality and advocate Rails refactoring techniques. You wrote an inspiring book, Fearless Refactoring: Rails controllers. Could you please tell us a little bit more about it?
The book consists of 3 parts:
- refactoring recipes
- bigger examples
- building blocks, i.e. service objects, repositories, adapters, and form objects
The book is meant to help Rails devs work on existing Rails apps and make them better every day, step by step, safely. It’s a combination of DDD, Clean Architecture and Hexagonal Architecture techniques.
In a way, it’s a book about service objects. Service objects are like the gateway drug, so I’m focusing the most on refactorings which show how to quickly turn a Rails action into a service object.
Altogether it’s 200 pages, full of code examples. Many people have already tried those techniques. The techniques helped them decouple the concerns.
5. It is an honor for us that RubyMine is referenced throughout the book. How long have you been using RubyMine? What do you like about it?
I had used JetBrains products in my previous life with Java. After switching to Ruby, I mostly used vim and/or TextMate, and sporadically RubyMine. I think it was about 4 years ago when I paired with my friend on a Rails app. He was using RubyMine. Only then I realized how great the tool is. It was like having my Java IDE support back, but in Ruby!
Nowadays, I can’t imagine working on bigger Rails apps without RubyMine. It’s fantastic in navigating quickly in the codebases. Given than you read/track code more often than you write it, this is a crucial feature.
Now, I’m not saying that it’s impossible with vim. It’s just here, with RubyMine, it’s all by default.
I recommend RubyMine for every Ruby developer who works on non-trivial applications.
6. Are you missing any features in RubyMine?
Most of the limitations come from the dynamic language limitations and they’re not RubyMine’s fault. That’s also why I wrote the book—I show the recipes. The recipes help you in those places where RubyMine is not enough.
We’ve been recently experimenting with the ‘parser’ Ruby gem. It’s great at rewriting code by changing the Abstract Syntax Tree and then deserializing the code. It would be great to see more RubyMine support here. This could allow for even better massive refactorings with RubyMine.
7. You coach, blog, and do lots of talks, among other things. What inspires you on a daily basis? Any books, blogs? Hobbies?
I study the classical books of software engineering in my spare time.
In the last 2-3 years I attended more Java and .NET conferences than Ruby ones (apart from wroc_love.rb). Those conferences inspire me with new ideas. The thing is, those communities are far more mature than the Ruby community. They have some established ways of building enterprise-ready apps. In the Ruby community, partially due to the beginnings of the Rails framework, enterprise is a ‘bad’ word. It’s also part of the Ruby community DNA to hate everything Java-related. All of this together makes it really hard to suggest new architectures for bigger Rails apps.
My other hobby is chess. I’m a chess master candidate. This game is very inspiring. Its depth allows for developing skills over many years. I started playing 30 years ago and it’s still fun to me.
I see many connections between a chess game and a software project. The opening is like the first releases of the application—everything can change very quickly. Then, there’s the middle game where the structure is established but the complexity is high. A deep understanding of patterns is required here. At the end is the endgame, where hard skills are mostly important. There’s less changes, but you need to be very precise.
8. The wroc_love.rb conference is just around the corner, taking place March 13-15 in Wrocław, Poland. Could you please share with us some details about the conference mission and its key speakers this year?
The mission of wroc_love.rb is to help professional Ruby programmers to become even better. In the Ruby community there are lots of events which are great for the less experienced people. We aim to be the event where you go to share very advanced ideas with like-minded people. It’s also the place where you can hear about very advanced ‘sci-fi’ techniques like DCI, CQRS and isomorphic frameworks.
We’ll start with the ‘Post-Rails world’ theme, as we managed to get the authors of Trailblazer, Volt and Lotus. It’s probably the first time they will all sit together and discuss the Post-Rails world—the world within the next 5 years.
Jim Gay will talk about DCI-related techniques. DCI is probably the most inspiring architecture known today.
Alberto Brandolini will speak about why events are important, even at the requirements gathering phase. This is a full cycle, which together with DDD, CQRS and Event Sourcing makes a full framework for developing applications, from talking to the client to the final code.
We’ll also have Ivan Nemytchenko, who will talk about his experience with refactoring Rails applications.
There’s much more at the conference, like ClojureScript, React.JS and many other interesting topics.
9. Thank you again for your time, Andrzej. Are there any more upcoming events or topics that you would like to ‘plug’?
Remember the first time you used Rails? Was it exciting to see how quickly it all just works? Missing the feeling? Go and try the Volt framework, it’s like building the Rails app AND the front-end together without any duplication, all in Ruby. Amazing 🙂
By the way, a member of the RubyMine team, Valentin Fondaratov, is going to attend the wroc_love.rb conference. Valentin is a software developer and an author of the Puppet plugin. He will be around and ready to talk. Find him wearing a RubyMine t-shirt and don’t hesitate to chat if you are there.
Develop with pleasure!
JetBrains RubyMine Team