Interview with Yehuda Katz and Tom Dale on Ember.js and frontend architecture at RailsConf 2014

Interviewees: Yehuda Katz, Tom Dale
Topic: Ember.js and frontend architecture
Conference: RailsConf 2014
★ Transcript Available Jump to transcript
Description: Interview with Yehuda Katz and Tom Dale at RailsConf 2014 on Ember.js and frontend architecture. This recording captures practical lessons and perspective for software teams and technical communities.
Published: May 13, 2022

Transcript

Hi, it’s Mike with UGtastic. I’m here at RailsConf 2014, and I’m standing here with Yehuda Katz and Tom Dale, who are the creators of the Ember project and also a contributor to Rails. And Yehuda gave a keynote yesterday morning, and they also gave a talk about how to build a smart profiler for Rails. So thank you very much for taking the time to speak with me . I appreciate it. So Yehuda, I know it’s the end of the day and we’re all pretty tired, but can you sum it up, a little memory of the keynote talk you gave yesterday and what the topic was? Sure. So I basically sort of talked about two areas. The first area was just sort of talking about the idea of cognitive or ego-deprivation. Which is this idea that we have a limited store of cognitive capacity, it’s sort of like you have a battery. Like the end of the day at a conference. Yeah, like the end of the day at a conference. We’ve made so many decisions today. And so a lot of people think of cognitive capacity as something that you drain uniformly through the day or it drains when you work on hard problems. But actually it turns out that a lot of the things that drain your cognitive capacity are really mundane things like making choices or getting into a little bit of an argument can be really depleting. You could spend like five minutes getting into an argument, and you’ve probably felt this. Right. After five minutes. You’ve drained for the rest of the day. Well, it’s like when you go to the grocery store. If you think about it, you’re there for like an hour, you ‘re constantly making decisions. And you get to the checkout line and there’s a candy bar. Is there a reason there’s a candy bar there? Because what brand of spaghetti sauce should I buy causes your willpower to deplete? So willpower, all these things are sort of the same thing. And the idea was just showing a conventional reconfig urationist idea that Rails, I think, spent a lot of time and energy advocating for. It’s basically part of the same thing. It’s really about making choices and getting everyone on the same page about defaults. Because defaults are really a psychological hack that we can use to allow us to both, when we’re in a really good mood, allow us to do more before we deplete, use up too much of our capacity, but also keep us on the straight and narrow when we’re in a bad mood. So you may think when you’re being a programmer, what do I name this controller, that you think that it has zero cost. But in fact, it’s actually sapping your willpower and your ability to actually think through the more important problems. Yeah. I know. I’ve done it myself. But it’s hard to even get started because I’m thinking about, do I want to do Postgres or MySQL? And really silly decisions like that by the time you’ve made a few of them. And I think the important part is not to say, well, we’re going to take away your decision making because people don ‘t like losing autonomy for very good reasons. What you’re saying is we’re just going to give you some sane defaults. Defaults are the hack that you use to prevent yourself from being cognitively depleted so you have the energy to work on the real problems that matter for your business or for your product. And even thinking about defaults, did you ever see the movie Moscow and the Hudson with Robin Williams? There’s a wonderful scene, it’s from the ’80s, but whenever I think about cognitive overload, I think about that scene where he goes and he wants to just buy coffee. And he’s from the Soviet Union. He just wants to buy coffee. And he looks at the coffee and he says, Folgers, taster’s choice. And then finally he’s looking and then finally he’s running back and forth and he’s like, coffee, coffee, coffee. And he passes out. Because, you know, those choices go wrong. People like, what’s the quote? People like choices a lot more than they like having to choose. Yeah. So that was sort of the first half of it. The second half was talking about all the excuses that people give themselves to justify not building up these abstractions. So I think one of the most common ones is like, oh, I’m so special. I have all these special needs, special requirements. And if I don’t, you know, if you make me use a tool that’s for everybody, how am I going to get my job done? You know, all the being so special. And then people, even when people get past that and they say, you know, I am doing really the same thing as everyone else, they use this excuse of the law of leaky abstractions . Like, oh, these abstractions, these abstractions are always leaked so there’s no point in even bothering with them. And you, ironically, you see people making these arguments about leaky abstractions sitting on the top of the most epic abstraction stack, right? So you have node people who are really allergic to abstract ions. But they’re sitting on top of not just, you know, not just a hardware abstraction. But C, Unix, POSIX, libUV, you know, one of the most amazing dynamic language jits that have ever been created. And then on the top of that, they say, oh, promises. That’s such a heavy abstraction. I don’t know how I’m going to deal with that. Well, this is really funny, too, because you think about, like, it wasn’t that long ago that people were literally, like, if you want, like, hardware was bespoke. Like, every new chip was completely custom silicon. Right. And then at some point, processors, CPUs, like general processors. Got sufficiently good as an abstraction that everyone’s like, you know what? It’s silly for me to be laying out my own chips. Let’s just use this off-the-shelf Intel chipset, right? And you never think about it. No one ever is thinking, okay, I want a new computer. Should I get x86 or should I build my own? It’s like, okay, I’m just going to use x86 or ARM. Those are the two things everyone’s agreed upon. Nobody thinks about that. So it’s a little bit arrogant, I think. But this happens every layer of the abstraction stack. Everyone always thinks, like, well, I rely on all these abstractions. But I’m at the peak of it. The thing that I am doing is so unique. Like, really, there’s no shared solution or shared abstraction that could possibly encapsulate this problem that I’m having. Until you get to it, right? I am going to cut this piece of wood. I need to go and craft something in which I can separate these pieces of wood from each other. Right, yeah, yeah, exactly. No, you just go grab the saw. Yeah, exactly. Exactly, exactly. And it’s fine. And I think the reason is that people go in when you’re – there’s kind of, as you said, there’s this layer of experimentation at the top. So there’s the abstraction stack. And then at the top, there’s always a layer of experimentation. And especially, like, younger developers, less experienced developers, they come in and they say, well, you know, I tried the abstraction. It wasn’t perfect yet. It leaked a lot. It wasn’t quite perfect. And so their reaction is not, well, I should wait for this to mature. Their reaction is, well, of course, this abstraction, on principle, must be bad because I failed at it. Right. And then the next time they see an abstraction, they basically just hate it. They hate all abstractions. And, yeah. And I think what’s kind of cool is that when you get past this, when you say, no. x86 is a thing. Unix is a thing. C is a thing. You can actually start building much, much higher than you thought you could build before. You actually start being able to – you get into a place where you have shared understanding of what it is that you ‘re building. And you can, as Steve Jobs said in the quote that I excer pted in my talk, you can start from the 20th floor instead of starting from the first floor. And there’s way too many people that are always thinking, oh, I’ll just – you know, I’ll start from the first floor every time. It’s a lot simpler. Right. But, really, you want to be building things. Having that shared understanding. Having that shared understanding allows everyone to kind of , like, solve the problem once and then start building on top. And a lot of times, as you could have said in the presentation, that means having shared implementation, like Rails, Ember. These are shared implementations that everyone can build on top of. But even if you don’t share the implementation, even just sharing common vocabulary, having a common interface. So a good example that you could have used was the idea of promises in JavaScript. Everyone was having to deal with asynchronous values. Everyone was implementing promises as a way of solving that . But everyone was implementing it just a little bit differently. And you really couldn’t build – you couldn’t use these pieces together. You couldn’t build on that abstraction. So Dominic DeNicola really was the one that drove, okay, well, hey, look, we’re all doing similar things. I’m going to write a spec. And it’s going to be a set of tests. It’s going to be a test suite. And if you write a promises implementation, everyone just conform to this. And that, I think, had really unexpected properties. Emergent properties where, okay, now everyone’s centered on the spec. Now it’s in the DOM spec. Now it’s in the W3C specs. And now actually support for it is being built into the language. And that had to happen in a layered abstraction. Yeah, because it gets to be something almost like an if scene. It’s a construct that you’re going to be able to take for granted, that you’re going to be able to go from one platform. You’re already in this language. It would be like if there was no if and everyone wrote a if function using gotos. Well, you could imagine that someone says, I don’t really think control flow really belongs in – So this is the thing people say about problems. I don’t understand why control flow is in the language. It’s like, hey, guys, guess what? Control flow is in the language. It’s the only if statement. It’ll be okay. I think we can add another asynchronous control flow primitive to the language, and I don’t think anything’s going to explode. Yeah, yeah. And as far as working in these abstractions, it can become complicated. And there’s a product that you guys have launched. And as I said when I was interviewing Leah, I’m not being sponsored by this, but you guys are doing great. You have a long history of just putting stuff in the community. So I wanted to promote your company. So can you tell us a little bit about Chill Day and the products that you’re creating? Sure, yeah. Because it relates also to your talk. I think it’s actually related to the open source work as well because the last company that we all worked at together, so the founders, me, Yehuda, Leah, and Carl, we all worked at a VC-backed company before. And the experience was great. It was very emphasized open source. But at the end of the day – You know, the money, it wasn’t necessarily self-sustaining. If you didn’t achieve liftoff right away, it’s basically like the team got scattered to the winds. And so when we started Tilda, we really wanted to do something that was bootstrapped. We wanted to be bootstrapped and proud. But it turns out it’s hard to be bootstrapped and proud if you’re bootstrapped and bankrupt. Yeah. So we needed some way to make money. And the obvious way to do that is to become Ember Inc., right? There’s like Fondo BB Inc. There’s Meteor Inc. And there’s – NTM Inc. NTM Inc. There’s like a long somewhat history of VC-backed companies doing open source work. Yeah. Where that’s like the company drive. And that’s a totally plausible model. But for us, we feel like the best innovation happens when you have this coalition of companies all working together. And there’s no one dominant company. We like Postgres. We like Rails where there’s a core team. And there are members from many different companies all working on that problem. They steward it. They do a lot of work on it. And you have to reach consensus. And actually, you can’t bully ideas. And you have to argue for your ideas on the strengths of their merits. And I think that’s very important. So, what do we do now? Well, we wanted to build something cool. We didn’t want to build something really lame. We believe in tackling hard problems. And we also believe in playing to your strengths. So, we spent a long time thinking about, okay, well, what are our strengths? So, one, I think we know how to build developer tools. We’ve been doing it for a long time. Carl’s a badass at building distributed systems. Yeah. And I think we have a pretty – And we know the Rails stack. And we know the Rails stack. Yeah, obviously. We know the Rails stack. So, that’s it. You guys picked it up at some point. Yeah. Yeah. So, we’ve been doing it for a long time. Yeah. Yeah. So, we built Skylight. And the reason we built Skylight was that all the way back in 2009, hard to believe, five years ago, DHH wrote a blog post called “The Problem with Averages.” And he said, “If you’re thinking about the performance of your web app, thinking in terms of averages, the words he used were useless and wrong.” He said, “What you really need is a histogram. You need to see the distribution, because if you’re a statistician, you use a lot of numbers. And if you’re not a statistician, you use a lot of numbers .” And so, we built Skylight. And I think we have a pretty – And we know the Rails stack. And we know the Rails stack. And we know the Rails stack. Yeah, obviously. We know the Rails stack. So, that’s it. And he said, “If you’re thinking about the performance of your web app, thinking in terms of averages, the words he used were useless and wrong.” He said, “What you really need is a histogram. You need to see the distribution, because if you’re a statistician, you use averages to think about normal bell curves.” Right. But that’s not what response times are. Yeah. So, he said this in 2009. It’s 2014. And there still has not been any tool on the market that developers could take off the shelf and get that tool. Right? Right. If you’re a product developer, you can’t do that. Right. If you’re a product developer, you can’t do that. Right. Right. If you’re a product developer, you can’t do that. Right. If you’re a Google, or you’re a Facebook, or a Twitter, you have teams building this for you, but that’s not Joe or small shop. Right. So, that’s what Skylight does. Skylight basically gives you the tools that the big companies have to think about for web performance in a way that’s super accessible, super fast, and member app is really, really fast, really responsive, and I think pretty easy to use. Is it possible with Skylight? Skylight to be able to look at the metrics and be able to try to figure out what kind of characteristics, like a specific type of user, like an admin logging in and doing a bunch of crazy… So, that’s what the histogram is for. Yeah. Basically, if you have an average, you’re taking cache hits , cache misses, RSS feeds, XHRs, admin users, that causes three more database queries to happen. Yeah. You’re taking all of that and you’re compressing it into a single number. So, having the histogram there, we keep the whole distribution. So, we can show you the histogram for any time slice. Up to 30 days for any endpoint, and so you can see, like, “ Oh, it looks like there’s a cluster.” You can zoom in and you can say, “Oh, it looks like if the request is taking 700 milliseconds instead of 200, it’s because I’m doing all these extra queries for myself.” So, one thing that you left out is that it’s not just the histogram. Once you’ve decided what part of the distribution you want to look at, you actually get a really high-fidelity trace, which tells you, you know, first you had this wrap thing, then you went into this controller, then you made these three database queries, then you started rendering a template, and you made these three database queries. Yeah. And we just announced at RailsConf that we’re adding CPU profiling, very, very low impact, maybe, like, 10 microseconds per request of impact to do CPU profiling, and then that means we’ll be able to say, “Here are the actual Ruby, here’s the Ruby code that actually is spent, that actually was spent.” So, we can basically not just show you, “Here’s the distribution of your request,” but we can show you exactly what is happening inside those requests, and not just what’s happening inside of, you know, the average request, but what’s happening in slow requests or fast requests, you can compare, you know, maybe a fast request is fast because your request is fast. You’re not running all the scores. You can drill in and look at it. And that maybe sounds like an incremental improvement, but it actually completely, completely changes the way that you diagnose. It changes how you diagnose performance, right? Because the way that you can do it today, without Skylight, is you say, “Oh, it looks like there was a spike in production. Our response has gotten really bad.” And you know they’re bad, because if the average is bad, then you know it’s really bad. So, you’re like, “Okay, let’s go diagnose this.” So, what do you do? You check out the app on your local machine, you run it, you maybe put some seed data, you run it. You try to, like, put some load on it. You plug it into the production database. You can’t reproduce it. Well, I guess we’ll just pray that this doesn’t happen again. But what you can do with Skylight is you have a graph, right? You zoom back to see, “Ah, here’s a spike. Here’s where the 95% average spike is.” Select it in the chart, and now you have a full fidelity stack trace of exactly what was happening in your app in production, on your production boxes. And it doesn’t matter. You don’t have to think about it ahead of time. You can go back 30 days. Yeah. And, I mean, could I even find out, like, maybe, you know, like, what was happening in your app in production, on your production boxes. And it doesn’t matter. You don’t have to think about it ahead of time. You can go back 30 days. Yeah. And, I mean, could I even find out, like, maybe if another process was impacting what I’m doing? Like, if I’m running something. So, I’m looking at my app, and it’s, I get these really slow requests at a certain time in the day. I can’t see anything weird in my app, but this is what I’m seeing. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff. And, like, I’m running a lot of stuff.