It’s been one year exactly since we published this interview with Marco Roth, and this community has grown substantially in that time - so we’re re-sharing it!
Welcome to Once a Maintainer, where we interview an open source maintainer and tell their story. This week we’re talking to Marco Roth, maintainer of several open source projects in the Stimulus ecosystem and member of the StimulusReflex core team.
Marco lives in Basel, Switzerland and is a lively contributor to the Rails community. You can find him on Twitter @marcoroth_ and on Mastodon at @marcoroth@ruby.social.
How did you get into programming?
I was always kind of fascinated by computers since I was young and had constant exposure to them. In high school, I received my first MacBook for schoolwork and I owned an iPhone 3G. I wanted to try to create an iPhone app using Xcode, but I quickly realized it's super hard if you don't have any experience at all.
At that time, a classmate and I came up with the idea of creating a website to display exam dates, homework assignments, and other class-related information for our classmates. My friend knew HTML and some JavaScript, so he taught me the basics. Together, we built a static website for our class. We even had some preconfigured calculators written in JavaScript to help with math homework, so our classmates just had to enter the values and got back the right answer. All of this kind of made me look at programming more as a career than as a hobby.
So in Switzerland, we have this apprenticeship system that allows you to work at a company while attending school for 1-2 days a week. It provides an excellent combination of real-world experience and education, giving you a head-start in your career at an early age. So after high school, at the age of 15, I started a four-year apprenticeship program to become a computer scientist.
During the first year of apprenticeship, I learned Ruby using Shoes/Hackety Hack and built my first Ruby on Rails application. I had the opportunity to work on different teams and also gained experience as a Helpdesk support agent. Later on, I joined a team where I worked on various Rails applications and contributed to building a platform for all the apprentices in our organization. Throughout my schooling, I had several programming-related classes and worked on numerous projects, familiarizing myself with HTML, JavaScript, Visual Basic, Java, PHP, SQL, and Ruby. The author really made me realize how awesome and how expressive Ruby is. And that's what I wanted to do more of.
For the apprenticeship program, do you have any choice in the company where you go, or are you just sort of assigned a company within the general realm of, “I want to be a programmer”?
Basically you’re applying for a job for an apprenticeship placement, and you have to do the regular interview process, but you can choose where you apply, obviously. Once you get a job, and depending on the company, you might be able to choose where you want to go within that company if they have multiple teams, or what you want to specialize in. In my case it was a rather big organization and I had the privilege to work on a small team of juniors in the beginning. I started with four other people in the same year and we had a kind of a team, trying to figure stuff out. Trying to set up our computers and figuring out how computers work and how we set up our workspace, system networking, and getting programming advice - I always chose the programming route.
After completing my apprenticeship, I decided to do a four-year bachelor's degree in computer science while working part-time at different companies and teams of varying sizes. So after I had my bachelor's degree, I was already working like 8 years in teams and had actual work experience.
What led to contributing to Stimulus?
In 2018 and 2019, I was working on a Rails application that required a significant level of interactivity and JavaScript. At the time, I was using jQuery inside .js.erb templates to handle HTTP requests. And yeah, it kind of worked, but it always felt super hacky to me and I was like that's not the way I want to write applications and I don't see that as a way forward. So I was looking for alternatives how you might approach this problem and I found this project called StimulusReflex, which is kind of a framework for creating reactive real-time applications using server-side rendered HTML in Rails. It maintains the application state on the server-side and leverages websockets and Stimulus to efficiently reflect those changes on the client-side, applying only the necessary updates.
When you say it felt right, there's kind of a taste thing there, that to you it just seemed like the right way. How did you get a sense for that?
Before Ruby, I started doing PHP applications and I always had this mindset about having server side being the single source of truth, and that's the way I want to write applications. As opposed to what modern JavaScript is doing on the client side. And at the time I was also doing React with the Rails back end and had the whole setup of React, Redux and everything in between and syncing the state between servers just for submitting forms. And it was kind of overkill in my opinion. It's just so much more I guess empowering and it feels you're not like fighting with the technology to do it this other way.
I feel like the easiest way to get into doing open source stuff is to use the project yourself. And then you quickly feel like something is missing, something is wrong, something doesn't feel right, or maybe you even found a bug. And just being able to open the code, try to figure it out yourself, and then upstream those changes to the projects is kind of how I got into the whole thing. In this case, StimulusReflex was kind of an early stage project and I thought, “I’d love to have some kind of debugging tools available for me to figure out what's going on.” I was able to do that, it was merged, and then I kind of continued contributing along the way while I was building my application and at some point they were like, you’ve done so many things - would you like to join our core team? So I was invited to join the StimulusReflex and CableReady core team, where I contributed to the development, maintenance, and progress of the framework.
Since StimulusReflex builds upon the Stimulus library itself, and I extensively used Stimulus in my applications, I acquired a considerable amount of knowledge in this domain. Around the same time, a friend of mine, Adrien Poly, started another project called Stimulus-Use. I was immediately drawn to it and began upstreaming some of the features I wanted and needed, which were also accepted.
All of these experiences led to the moment when I was asked if I would be interested in helping maintain the Stimulus project itself. I happily accepted the invitation and joined the committers team. I had a genuine love for the Stimulus project, as many of my applications heavily relied on it, and both StimulusReflex and Stimulus-Use were built upon it. Joining the team was an easy decision for me, as I wanted to ensure the continued development of Stimulus for the community.
What’s your favorite Ruby package and why?
I guess if you take the question literally, I would say it has to be Rails, but it's kind of a cheeky answer. It holds a special place in my heart. Rails has had the most significant impact on my career and journey as a developer. It's an incredible framework that provides a powerful and efficient way to build web applications.
In addition to Rails, there are a couple of other Ruby packages that I have used in probably all of my applications: devise and simple_form. They've been around for as long as I've been programming in Rails and it's awesome to see that so many long-running projects are still alive and still actively used to this day.
How can we get more people into open source?
I think there isn't enough awareness and guidance on how to get started. There’s a lack of comprehensive information that shares the entire process and provides insight into what it's really like to contribute to real projects. Initiatives like Hacktoberfest exist, but their effectiveness depends on participants' willingness to do something and not the other way around.
The easiest way to just get into it is to take a look at your gem file or your package.json and figure out what packages you're using and then just pick one and try to figure out how they work under the hood and how they provide whatever they are providing. Just open it and read the source code. You don't need to understand every detail; having a high-level understanding of how a library you use works can be enough. Personally, I find it incredibly rewarding to explore open source code and understand how things are implemented.
Contributing to open source not only enhances your skills as a developer but also broadens your thinking by exposing you to different problem-solving approaches. Open source projects often require you to think about various considerations and how your contributions may impact applications using them. It challenges you to approach problems and solutions in new and different ways.
I’d love to see companies allocate dedicated time for employees to work on open source projects, preferably ones that the company relies on. Almost every software company benefits from open source software, so it makes sense to give back to the community. But management can feel like, yeah, it's free work without having a benefit for us, so why should we do it? We fork a repo, create a branch on our fork, and then just patch some things we want to have and then it just sits there in a fork receiving updates. I feel like that should be motivation enough to try to think about the solution - how could we get those changes upstream, into whatever we are using? It just feels wrong to me, kind of like you’re not cleaning your room.
I'm curious, I think a lot of your work has been at this intersection of frontend and backend. You're doing packages that are written in Ruby, packages written in JavaScript, maybe packages that have a combination of the two. You're kind of straddling the two ecosystems a little bit there.
Yeah, it's an interesting intersection of the two. I feel like not a lot of Ruby people want to do or write JavaScript, and I guess that's kind of a niche I found for myself. I kind of see myself as the guy who writes JavaScript for you so that you don't have to.
I like JavaScript. I kind of disliked it in the beginning, but the more I was working in React and other frameworks in that area, I noticed you can't write an application, a modern application today without having to write JavaScript. If you do, it's probably simple enough that you don't need it or just can rely on those packages that do the JavaScript for you. But I wish more Rails people would embrace JavaScript.
Yeah, so how do you bring that into Stimulus?
I guess Stimulus kind of tries to make you a JavaScript programmer, because you have to write some JavaScript. It's not a lot, but you have to write some. And from what I see, people will complain about writing even a Stimulus controller because they don’t want to write any JavaScript. But I kind of feel like you should learn it. Even if the packages help you write less JavaScript, you should still practice it. It’s still needed.
Who’s someone you think is doing really interesting work?
I believe Máximo Mussini is doing some incredibly work. He has made Vite.js a seamless experience with his project Vite Ruby. I've had the pleasure of using it in several projects, and it brings so much joy to the development process.
Another community member I find fascinating is Samuel Williams, also known as ioquatix. He has been doing remarkable work in the areas of Ruby concurrency and highly scalable web applications. His GitHub profile is filled with underrated open source projects that showcase the possibilities of modern Ruby. I highly recommend taking a look at his projects, especially async and falcon gems, as they exemplify the future potential of Ruby.
I want to encourage people to do more open source and start contributing. So if people feel like they want to start on any of the projects I'm involved in, they should reach out to me and we could pair on something.
Once a Maintainer is written by the team at Infield, a dependency upgrade service.
To suggest a maintainer doing awesome work in the community, find us on Twitter at @infieldai. To subscribe, hit the button below: