Javier Ramirez on What Is REST? & Rails API Design | RailsConf 2014

• UGtastic Archive

Javier Ramirez on What Is REST? & Rails API Design | RailsConf 2014

Loading this player connects your browser to Youtube.

Full Transcript Available
LIVE CC UGtastic Archive

Press play or click any turn in the transcript to start real-time synchronized playback...

📼 FROM THE UGTASTIC ARCHIVE (Recorded on-site at RailsConf 2014) Archival conversation with Javier Ramirez on his talk 'What is REST?' and RESTful architecture in Rails, recorded at RailsConf Chicago 2014. Recorded during the 2009-2015 software craftsmanship and developer community movements, this archival interview captures early ideas, debates, and community organizing in real time. --- 🏛️ ORAL HISTORY RECORD: • Series: UGtastic Technical Conversation Archive (2009-2015) • Recorded: RailsConf 2014 (2014-04-22) • Guest: Javier Ramirez • Interviewer: Mike Hall (UGtastic / https://www.just3ws.com) • Legacy UGtastic Archive ID: ugrH5XZ9SNw 📖 FULL ARCHIVE & ORAL HISTORY: https://www.just3ws.com/interviews/ 🏷️ TOPICS: Javier Ramirez, REST, API Design, RailsConf 2014, Ruby, Rails, UGtastic, Mike Hall Restored and preserved by Mike Hall (https://www.just3ws.com)
The Guest

Unattributed voices

UGtastic archive transcript with speaker attribution pending

The Presentation


Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Hi, it's Mike with UGtastic. I'm here at RailsConf 2014 and I'm standing here with Javier Ramirez who gave a talk on what is Rust and why is it part of the Rails way. Thank you very much for taking the time to speak with me. Thank you for having me here.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Yeah, so your talk, it was part of the beginner's track, which is something we hadn't really talked about, that there's different tracks here at RailsConf, beginner, intermediate and advanced, I think. And yours was in the beginner's level. What were you trying to teach or impart to a person going into your talk? Yeah, well when I submitted for the call for papers, I read about this beginner's track, which mainly was like the things that you would have liked to be told when you were starting with Rails.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
So actually, when Rust made it into Rails, I was already developing first applications. And, you know, I had to be like trying to understand why I had to use this new thing that was like, from my point of view at the time, making things like more complicated, was like, you know, I'm not really doing web applications and it's like really easy. Yeah. So, now I have to learn like this new thing and start thinking of routes and resources, and I don't know, members, collections, it didn't make sense at the moment.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
And, you know, and eventually, after I was using it, the kind of time, like, I don't know, like a few months later, that it was like, whoa, wait, this is amazing. It clicks. Yeah, it's because I'm using Rust, things are much easier now. So, what I found later, like talking to some people when I was teaching them the framework, they had the same reaction.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
I was thinking about, you know, the Rust and resources, and they were saying, "What's that? Why do I have to learn that?" So, I wanted to make a talk in which I could not only explain the concept of Rust, but especially why is it a good thing and why it made it to Rust, why it's better if you are trying to use Rust, better than just using no abstractions at all. Right. So, I mean, what was it that you recall that kind of, what was the thing that clicked when you were trying to explain it to people, you know, and you're trying to take something that took you several months to finally get to a point where this makes sense?
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
What was that lesson, and how do you boil that down to an hour-long description? Yeah, what happened to me is, first, well, it took me several months because I was quite stubborn, because I was already used to working in a different way. So, I was like trying to change the way you work. At the beginning, you are usually like skeptics.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
You don't really want to, you know, get out of the things you know. But what happened to me is like after using Rust in several different projects, then I came to realize that I could just move between different projects and things were like quite standardized. So, it's like, oh, by using Rust, now the controllers in all my projects look quite similar, and I can get in the middle of one project which is ongoing, and I can find my way quite easily. And before Rust, if you wanted to immerse in an open source project, or if you got to a new company and you started working on something that was already built, it was like more difficult to find your way around.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
So, it was like, by using Rust, like all Rust's projects looked like the same. So, it was like, you know, one of the big things of Rust is like conventional configuration. So, you could have like, you know, this huge convention across all the projects, and that was amazing. Yeah.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
So, that was one of the first things I like about Rust. And that relates to Yehuda's keynote of shared or reduced the cognitive load. And that's one less thing you have to think about. You're not worrying about how something is implemented.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
It just is. You just know that, oh, you know, in a previous conversation, I talked about OAuth, and I was like, once you've drawn that box, you can just kind of forget about the box and, you know, or treat it unto itself. And like what you were describing is, once you have that common structure for your code, and everybody knows that structure, you can do more. Yeah, actually, it's actually not constraining.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
It's actually… I actually mentioned Yehuda in my talk, especially because of that. Because, you know, when I was saying, yeah, this is better for you, because, you know, you have like some conventions. And when you have conventions, and when you have like a way of doing something, and conventions is something that have been like reached after a lot of decision-making, blah, blah, blah. So, the moment you already get those conventions, just keep using them.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
And also, the other thing is, I'm kind of a hacker. So, I really like to know how things work. So, apart from the things that Rails gives you, there are like a few other things that really click with me after working with REST. And, unfortunately, they are not supporting in REST.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Okay. They are general for those, but there's no support. And that was another… That was an example. Yeah, that's another thing I was speaking in my talk, hypermedia.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Because hypermedia is the other thing that really clicks with me when talking about REST. Actually, REST is like an abstract thing, because it was the dissertation for a PhD for Roy Fielding. So, you know, as any dissertation, it was like quite obscure. It was like difficult to understand anything at all.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
But part of the concepts in REST are the hypermedia, which means like, imagine you are going to a web page. You go to the home page, and you want to navigate to another page. So, you basically click on a link, and you are there. So, on the web, you move around by clicking on links.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
But when you are doing REST applications, specifically REST APIs, most of the times, you don't have links between different actions. You are asking for the information about a user, and you get the information from the user. But you don't get how to call a method of the API for now getting the teams of the user or the posts of the user. So, that's the concept of hypermedia.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Hypermedia. Okay. And hypermedia in REST is really amazing, because it means that you can have an API which looks exactly the same across projects, and also that you only need to go to the home page of the API or the application, and then you can just ask for the representation for the data. And together with the representation, you're going to have the links to move around the API.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
So, it's the same thing when you are using Ruby, and you just go to the IRB in the console, and you start playing around. You usually don't need to read documentation about new objects, because you can just inspect things, see the methods, just play around. So, the moment an API is having hypermedia, then you have these hints about which things are available for you. So, you don't really need that much documentation.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
You still need to read documentation a bit. But, you know, you can play much easier. And that was the second thing about Rails, that it really clicked with me. And I feel it's something that is like, in the Rails community, it's not really well stressed.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
There are some people, like Steve Klaknik, which is always talking about hypermedia, why it's important, blah, blah. But there are not many other people advocating hypermedia in Rails. There are some amazing gems for incorporating hypermedia. So, yeah, that was like the last five minutes of the talk.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
I was just talking about this concept. Can you repeat again the name of that gem, or a few gems that people might want to look at, to understand how they're extending Rails to support hypermedia? Yeah, the two that are probably more popular now. One is Grape.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Okay, Grape. And the other is Roar. Roar. Oh, Roar.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Yeah, Roar. Yeah, Roar. R-O-A-R. Yeah, exactly.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
That one. Those ones, at the moment, will be actually the most interesting. Okay. Well, so, yeah.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
So, people need to obviously look at your talk when it gets released, and also look at Grape and Roar as good examples of how to work. Well, and of course Rails, because the other thing that I like, and since we're in a conference, I'd really like to stress this, because it was even if we don't have hypermedia support in Rails, if it wasn't because of Rails, I don't think Rails would be as big. Because the Rails paper, the dissertation, was written in the year 2000, but until 2006, mostly no one knew about Rails, about Rails, sorry. And it's because Rails was, like, quite obscure, like, no academic.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Yeah. A few APIs, like Flickr, were using Rails concepts, but no one knew them. Yeah. So, it was in this same conference, in Rails Conf 2006, when David Hanemir Hanson said, "You know what?
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
I'm going to add resources to Rails because I learned about this new thing, REST, and it's quite amazing." And after the Rails community started using REST, in the next year, a lot of other frameworks were starting to, you know, to see, "Hey, this thing looks really cool." So, it was, like, 2007 was, like, the year where every other framework, every other language were using REST. Yeah. It was because of the REST community, and that's amazing. And Rails even, I guess, I was at Microsoft, through the ASP.NET developer at the time.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
And I remember myself and my colleagues, we were looking, almost looking at REST as Rails being the base implementation. Like, you want to look at how they did it. And we were playing a little bit of cargo culting at the time, but still, yeah, exactly what you're saying. I mean, Rails laid the groundwork that helped adoption, and people started looking at it more thoroughly.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
And now they can criticize it. Yeah. So that's what I'm saying. But if he hadn't done that, they wouldn't even be having this conversation.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
But that has always been the case with Rails. In this case, like, the REST implementation is not, like, the purest ever, but it's the one that has started everything. Yeah. So it's the same thing.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Yeah. So it's the same thing. If you look to the oldest version of Rails, you go to active record. By the time, it looked, like, really ugly.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Yeah. Like, internally. But it was amazing what you could do with that. And, you know, and eventually it got better.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Yeah. So that's the thing. I mean, the Rails community has been always, like, in that way quite adventurous. Like, we are going to release something.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Yeah. Even if it's not, like, perfect. But, you know, we have just a playground for growing and getting better. And I like that about, you know, about Rails.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
It's like the people that move around and how they are not scared of just challenging the system, doing new things. Even knowing that, you know, they're not, like, perfect. It's like, who cares? They work.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
So, yeah. It's kind of cool. And that way it relates a bit to the opening keynote of David this year. It's like, okay, maybe if a software engineer is going to read the REST implementation of Rails, it's going to say, oh, you know, you don't have hypermedia.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Because that's something you get a lot. Right. People saying, oh, your API is not really dreadful because it doesn't have so-and-so-and-so. So what?
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
I realize I had to walk off camera a little bit. But, no. Yeah, exactly. But I do want to say thank you very much for taking the time to speak with me.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
And thanks for teaching our hypermedia. Yeah. No, thank you. And thank you very much for helping more people know about technology.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Thank you. Thanks. User groups with lots to say, interviews, and more. No way.
Unattributed voices UGtastic archive transcript with speaker attribution pending ▶ Speaking
Sharing great ideas in the tech community. Fascinating conversations, a plethora of information. Find out for yourself today at yuketastic.com.