chantastic.fm

23: Ditch Authority with Sunil Pai

Episode 23 · October 2, 2018 · 00:44:08

Hosted by chantastic · With Sunil Pai

Download MP3 · Jump to transcript

Chantastic talks with Sunil Pai about Facebook, Oculus, and what the future holds for the JavaScript community. They discuss Sunil’s early adventures in programming, the power of a great manager, why firebug changed everything, why he scowls at models, the ways we protect ourselves from criticism, being “evil by accident”, and becoming The CSS Guy for the rest of eternity.

Featuring

Links

Transcript

[00:00:06] Sponsor: This episode of React Podcast is brought to you by ReactTraining.com. In-person, hands-on training for development teams from React community leaders and experts. Visit ReactTraining.com to learn more.

[00:00:20] Michael Chan: This is React Podcast. I am Chan-tastic. And I have the privilege of being joined by Sunil Pai, who is prolific. I love this man. I think we met first in React Europe in 2015. It was the first time, right?

[00:00:41] Sunil Pai: That's right. Yeah.

[00:00:42] Michael Chan: And uh we were kind of like a little bit weirdos. Like this was, this was before people had really like kind of seen the light about CSS-in-JS and we were kind of like just nerding out together.

[00:00:53] Sunil Pai: Also, it was a massive heat wave. I remember it was hot and sweaty most of the time.

[00:00:57] Michael Chan: Oh, it was absolutely horrible. Horrible. Um, but yeah, Sunil works at Facebook as an engineer, um, doing Oculus uh

[00:01:06] Sunil Pai: stuff. Yeah, front-end engineer for Oculus apps. Yeah.

[00:01:08] Michael Chan: Yeah.

[00:01:08] Sunil Pai: So actually, I think my org is changed now. It's called Social VR.

[00:01:12] Michael Chan: Really?

[00:01:12] Sunil Pai: Exactly. Yeah.

[00:01:13] Michael Chan: Interesting. I like that.

[00:01:14] Sunil Pai: Because clearly it's a Facebook thing, so now it's all about Social VR.

[00:01:17] Michael Chan: Social VR. That's awesome. So uh tell us a little bit about what you're doing at Facebook and Oculus.

[00:01:24] Sunil Pai: Uh, so I've been with them for about a year now. Um, I joined the Oculus team as just like a React guy. They needed a JavaScript person on a couple of projects they were doing. And it's been fun. It's intense. I I made the mistake of assuming that if I joined like a big company, it would be super cushy and like I just do like- it turns out that's wrong. That Facebook really like moves really fast and you're surrounded by all these incredible people. Yeah. Like 20-year-olds who have done way more than you would have in a lifetime. And to like it's It's a bit of work to just keep up with them. Yeah. That's what it is.

[00:01:55] Michael Chan: I've heard about the the boot camp. Is that pretty intense?

[00:01:58] Sunil Pai: It is. It's crazy. So you you get about 2 months to— uh A, like they do a bunch of orientation and training in the tech and stuff. Uh but uh you also get to pick your team, like which is strange to me. You get 2 months to actually talk to a whole bunch of managers, see what they're working on, see if there's a good fit with the team, whether you actually like your manager.

[00:02:17] Michael Chan: Interesting.

[00:02:18] Sunil Pai: Yeah. Effectively means that everyone's first year is with a team that they like because they've taken the time to like- Wow, that's really cool. Yeah, that's fun. Yeah, yeah. But it does mean that for 2 months you're just like puttering around wondering, uh, what you're gonna end up doing. You feel a little useless, but it's nice still being paid for it.

[00:02:33] Michael Chan: Sure, sure, sure. Yeah, I've heard- I've gotten to talk with a couple of people, and everyone who kind of talks about that Facebook boot camp, it's like their eyes get really big as it kind of like floods over them again. And like, man, that was really rough.

[00:02:46] Sunil Pai: It was weird. It is weird, but it's good. Like, that's just it. Like, yeah, uh other people should do this, I think. Give them the chance to- like, assuming you're one massive multi-thousand-employee company, of course. I mean, you're not gonna do this with a small startup.

[00:02:59] Michael Chan: Is it, um, is it fun to see behind the curtain there for the first time, or is it just overwhelming?

[00:03:04] Sunil Pai: Okay, so this is the thing I tell pretty much everyone. Uh, these are all incredible people you're surrounded with. Like, first of all, it's super multicultural. It's weird. They're from all over the planet. So, uh, on my team right now, I think only Like my skip-level manager is an Englishman and I'm in London. Otherwise I have like a whole bunch of Spanish-speaking folks, a Belgian. And it's weird because like uh the guy I work with, his name is Peter. And I was like, hey, it's really cool. And he's like a great engineer. And just chatting with him and he's like, yeah, before this I was like on the React Native team. I'm like, what, really? Like you were like on the React Native team? He's like, yeah, that was kind of cool too. I was like, do you understand what this means to me that I'm even hanging with you in your just proximity? So it's strange. Like yeah, you'll just you'll see Dan Abramov just sitting in shorts and a shirt at like 6:00 PM just hacking away. Like it's weird. It's a little weird.

[00:03:54] Michael Chan: That must be awesome to just see your heroes at work. Uh-huh,

[00:03:57] Sunil Pai: uh-huh. A bunch of them are just dorks. Oh, that's the other thing. It turns out that they're all very like regular people in general.

[00:04:03] Michael Chan: Yeah. That's the thing with heroes, right?

[00:04:05] Sunil Pai: There's a whole bunch of shit code in the Facebook codebase. Like React doesn't save you from that at all. Uh, but hey, shit gets done. It's, it's good fun. Yeah.

[00:04:14] Michael Chan: I meant to say that in my, my talk today. Uh, I haven't mentioned this, but we are at React Rally right now. Um, that's why we're in the, the same space together. Um, but, um, I, I had wanted to, to tell people to like, to really dig into their heroes' code because you see how, like, you see the stuff that they put on like Facebook and Instagram, like, like it's the, it's the. Picture version of code versus the stuff that like actually like makes money and get things done. Like, it's not always pretty.

[00:04:42] Sunil Pai: Oh, no one talks about their failures. It's weird. We should be doing that because like there's definitely like 20 failures for every success, right? Yeah. And we don't- and we- the entire point of this conference is to like humanize these people, to get people who are just doing regular stuff on stage. Yeah. But we end up like 6 months later like hero worshiping them, and that's odd. We shouldn't. I'm telling you, they're all dorks. Like such nerds all around us. So yeah.

[00:05:06] Michael Chan: That's awesome. So uh so why don't we start here? What's what are some of the uh the mistakes that got you to where you are today?

[00:05:14] Sunil Pai: Oh, uh so so I got into college, uh fairly clichéd uh South Indian uh academic story where I did well in school and I got into a good college, uh at which point I uh discovered that I could uh I discovered girls, I got into the college band, I smoked a bunch of weed, and uh like I just ruined everything that I- I hated my teachers and my classes. Oh my God, they were just so terrible. Just destroyed my love for programming in 4 years. So I ended up taking like 7 years to get my 4-year degree. It was weird. Like my dad, by the end of it, was like, just go write the exam, you're better than this, just get the degree, like we paid for it. Uh but that meant like one massive career course thing because I I thought like before I got into college, I was like, "Ha, this is clear, I'm doing a whole clichéd thing. I'll be doing something academic." At the point I was like, "Oh, maybe I want to do AI in like an American college with some uh famous professors that I was following at the time and all." And all those options just shut down like immediately because I wouldn't get into any college with the kind of uh academic record that I had.

[00:06:18] Michael Chan: Oh, sure.

[00:06:18] Sunil Pai: Right, so uh so then I worked with my uncle for a bit for a year. Uh that was great. I I wrote uh embedded software for trains.

[00:06:26] Michael Chan: Whoa, no way!

[00:06:26] Sunil Pai: That was super fun. Like, there's like, uh, there's a town in India called, uh, oh my God, I can't- I don't- uh, Chitrangan, where they make like the trains, not just the coaches, but like the actual engines they import from, right? So, and you plug into that with the serial port and you start hacking on the software on it. And it's great because the entire village runs just around this train manufacturing thing. It's a government-run thing, etc. Uh, so I did that for about a year, and that was intense, but like, it got to me. Like, sure, it wasn't really the sort of thing I was looking for.

[00:06:57] Michael Chan: What was the- what did the software control in the trains?

[00:06:59] Sunil Pai: So there's a whole bunch of proprietary stuff that happens. It's written in mostly like C, C++, a bunch of VHDL, low-level like hardware code. Uh, uh, we were doing this thing where, um, the project that- the major project that I was working on at the time was the problem with doing like diagnostics and stuff for software on trains. It, uh, if something goes wrong on a train, you can't really find out about it until the train comes into a station. You plug into it to the box and pull out the diagnostic data. So we started- we kind of invented a transport format over SMS, like literally encoding bytes into SMS messages and sending it over the wire, because that's literally the only way that you have any sort of network, because- No way. Deep in the jungles of wherever, you are not going to get good network.

[00:07:49] Michael Chan: Yeah, yeah.

[00:07:50] Sunil Pai: You can't count on- well, there's no Wi-Fi, there's no- Sure, sure. So we had to send SMSes out with encoded messages. It was a fun project. Uh, I did that first.

[00:07:58] Michael Chan: Encoded, kind of like, like, like pager messages back in the day?

[00:08:00] Sunil Pai: Pretty much, yeah, literally. And then there's something that's listening to it and like tries to convert it and then shows a list to someone who's looking at it. So-

[00:08:07] Michael Chan: 911 emergency.

[00:08:08] Sunil Pai: Effectively, like the train itself is like screaming 911. That was fun. Uh, then I, I joined a company called Pramati in Hyderabad, and that's where I met my first great manager. Uh, this, uh, Chandru- his name was Chandru, and I owe him like so much. So he also is not a programmer. He was like an ex-editor at the Indian Express newspaper.

[00:08:29] Michael Chan: Okay.

[00:08:29] Sunil Pai: Like, he was like into design or something, but he ran like the UX/UI part of this company. Uh, their client services, fairly typical, like doing client work for a bunch of projects all over the place. So I went up to him and I was like, yeah, I don't really know much, I did really badly in college. And he was like, that's okay. And we found out that we have like guitars in common, that we like playing the guitar. So we like chatted about that and then we're like, oh shit, we're supposed to have an interview. And he's like, you know what, it's fine, why don't you just show up? Like, we will pay you like what we pay all our other junior engineers and like let's figure it out. And I remember the first day I came in, he's like, okay, I get you don't know anything, figure out how to make an AJAX request. So mind you, this is in 2006. Uh, Firebug had not released yet. IE was still the most popular browser.

[00:09:14] Michael Chan: Yes.

[00:09:15] Sunil Pai: So alert-driven development was everything. And I had no idea, mind you, I had no idea of even those basics.

[00:09:21] Michael Chan: Yes.

[00:09:22] Sunil Pai: And it took me 3 days to figure out how to make an AJAX request, to even find out what the hell it was. I think I recollect weeping at some point in the middle of that. It was weird. I was like, this makes no sense. My life is crap. But like, I had Chandru and he was just so supportive. He's like, it's fine, you just do step by step. First you do this, then we like learn how to do something else. And mind you, he didn't program either, so he was like learning with me.

[00:09:44] Michael Chan: Yeah.

[00:09:45] Sunil Pai: And suddenly I'm a web developer after that, and I love JavaScript. And JavaScript was like a toy language. I remember like, uh, enough of my classmates told me that, oh shit, like you went to a fancy engineering college and you're doing JavaScript. This isn't even engineering. Like at the point, they're like, why are you doing this to yourself? Figure out something else. And I'm like, no, it's kind of fun though. It's nice. All you have to do is refresh. I haven't like compiled anything in a while, which is weird, by the way. It looks like we just brought back every compilation pipeline into our industry.

[00:10:13] Michael Chan: Yes.

[00:10:14] Sunil Pai: But that was great. So I stuck with them for a little under 3 years and I learned so much. Like I I remember when Firebug 0.1 launched and it was just a Like I literally went running around office showing it to people. I was like, check it out. If you change like the style attribute, you can just put up, up, up and it like, like you could change numbers just by doing up. And they were like, no, this doesn't seem right. Like how are you doing this?

[00:10:39] Michael Chan: That is, I mean, that was a magic moment. I remember the same where you, I had always had to visualize in my head the box model of, uh, you know, of, of a box, of a div and I remember opening Firebug for the first time and it showing me that, like with the different divisions. And I was like, holy shit. Like this changes everything.

[00:11:00] Sunil Pai: It changed everything. Oh my overnight, like suddenly, like you could start thinking about your code differently.

[00:11:06] Michael Chan: Yes.

[00:11:06] Sunil Pai: Uh you could see your code run, you could step through it properly. And that was, that was a magical moment. I remember. Yeah.

[00:11:13] Michael Chan: And like seeing, like seeing all that, that like the network tab activity, like seeing that like come in and like how long it took and like all this stuff is.

[00:11:20] Sunil Pai: Insane. I, uh, that happened. Then a couple of years after that, Chrome launched. Yeah. Which again, like, changed the game. And I remember, so I was working on a- at the time they were called Rich Internet Application Frameworks, RIAs. Yes. Yeah, yeah. So I was working on one of those for a client, and it was just dog slow, but nobody cared because all JavaScript was slow at the time. Uh, and just Chrome came and all our stuff, like, just- it was something like 10 or 20x faster. Everything that we ran. And we were like, okay, what now? What happens next? This is strange. We have never had this kind of power.

[00:11:54] Michael Chan: You just put a little like thing on the bottom, best if viewed in Chrome.

[00:11:57] Sunil Pai: That's what we should have done. Oh, that's what it- that's what we do now, I assume, right? Like, that's, that's what we do anyway. We build in Chrome, we deploy in Chrome, and then we spend like the weekend figuring out the IE bugs, I guess.

[00:12:09] Michael Chan: It's true, it's true. Like, we'll figure that out later.

[00:12:12] Sunil Pai: So I did that for a while. And then like, so after Pramati, I I've never- I started hopping across companies. Like, I would spend like a year in a place, uh, but not like in a bad way, not like I would get like unhappy or anything. It was very much I wanted to learn how to do something new. I, I worked at a design firm for a while. I did this government thing with the trains. I did client work. Uh, I wanted to join a a product company, so I spent uh a year with Yahoo and I built Yahoo Maps. By the way, that was weird. Like, I didn't I didn't know what team I was joining when I joined Yahoo. And they said, you're on the Maps team. And I was like, Yahoo has Maps? And they're like, yeah, like it's kind of a big deal.

[00:12:50] Michael Chan: You're fired.

[00:12:53] Sunil Pai: Yeah, no, it's okay. But it was fun. Like, so I spent a year with them doing that. And that was good. I think, well, well, I don't, I'm not even sure if maps.yahoo.com is alive. But at the time, at the time, it was huge. From what I understand, most of Craigslist Craigslist maps were had Yahoo Maps. Okay. So hey, I got to production. I'm not ashamed of it. Uh, so I did that. So I hopped across a bunch of places. It was really good. Uh, my last gig before Facebook was at an e-commerce place called Myntra. Um, that was fun. Uh, I did the one project I think everyone will end up doing for the next couple of years, which is to convert a PHP codebase into a Node codebase. Okay. I mean, in 5 years we'll be doing, we'll be moving from Node to Go or Wasm or whatever. So I was doing the- it was during the PHP to Node where everyone was just shifting projects. That was a- that was a great time as well. We- we scaled to India scale, which is strange, by the way.

[00:13:44] Michael Chan: Can I tell you about it? Yeah, yeah, tell me about it.

[00:13:47] Sunil Pai: Like, you- so Myntra was big enough where, you know, you can look at the metrics and you can make judgment calls about the country itself. And I'll tell you the strangest thing that happened. It happened the night we deployed the final codebase. We had tested it, it was fast, Like we were beating the pants off competitors, like super fast websites in India. And that like counts because like shitty internet everywhere. Sure, sure. So we had metrics like up the butt. Yeah. And it was great. Like I was seeing, oh wow, like we're getting 3,000 requests a minute. It's all good and all that. And I was, and and we went home and I was just, just kept watching the metrics through the night. And at 12 o'clock, it looked like all my servers were crashing. It was weird. Like it was a steep drop off. And I started panicking. Your heart sank. Yeah, because that's the first night of my thing deployed. And I reach out to the ops folks and they're like, everything looks normal. And I was like, yeah, because, so when something like Twitter goes down, people bitch about it, that's fine. But when an e-commerce company goes down, people abuse the shit out of you because they think you're doing it like purposely to like fuck with their money and stuff because it's it's a it's a matter of money, right? Like

[00:14:49] Michael Chan: you got bought off by a competitor or something like that.

[00:14:51] Sunil Pai: In fact, later we got, yeah, so it was, so we I've I was freaking out. And that's and it was the other strange thing about it was that it was it happened at exactly 12, like at midnight. At midnight. Like 3 or 4 minutes plus minus. And it was so strange. At which point I realized that that's a cultural thing about India, which is they see 12 o'clock and they're like, oh, it's time for sleep and they throw their phones away. It was so weird. And which is why then like we started digging into the data and I now know the best time to send a push notification. By the way, this is like if you companies out there are listening, don't send it between 5:30 to 6:00. 6:30. Everyone's on their way home, uh they don't give a shit. Uh so you do it either at like 4:30 or like afterwards, like past 6:30, 7 o'clock. Super strong pro tip. Like, it turns out that you should treat your servers the way, uh, uh, TV folks treat pricing for ads, you know, like based on different times of the day. Yeah, it turns out those, those are the same as server uh traffic patterns.

[00:15:48] Michael Chan: That's so crazy.

[00:15:49] Sunil Pai: Yeah, so like, yeah, you, you end up learning so many things about people. Also,

[00:15:53] Michael Chan: it's midnight, phones down.

[00:15:54] Sunil Pai: Yeah.

[00:15:55] Michael Chan: Gotta go to sleep sometime.

[00:15:56] Sunil Pai: The other thing is that because we were selling uh like clothes and stuff, uh there's a section of people in the world who seem to get off on searching for like pictures of bras and stuff. And it's weird. Like we go through the search terms and we always have to clean out things and be like, why, why do they do this? I mean, porn is free on the internet.

[00:16:16] Michael Chan: Right, yeah.

[00:16:17] Sunil Pai: Why are you even doing this to us? Like it's-

[00:16:19] Michael Chan: It's like a gray area.

[00:16:20] Sunil Pai: Exactly.

[00:16:21] Michael Chan: Yeah, yeah, yeah. One of those moral gray areas for people, I think. Like, oh, it's just, you know, I'm underwear shopping. I'm not looking at porn, I'm underwear shopping.

[00:16:29] Sunil Pai: Sure. Uh, this isn't even a JavaScript thing, but uh another story from then is, so while I was building this page, especially the search page with all the products, right? Yeah. I got really familiar with all the models that we use for all the clothes. Like, I I got to a point where I knew what every person's uh uh favorite posture was. One one dude used to put 4 fingers inside his pocket and leave the thumb sticking out. Bhadwan used to tilt a little back because clearly he thought his left side was the best side.

[00:16:55] Michael Chan: Yeah, yeah.

[00:16:56] Sunil Pai: And finally, at one point, we moved to a new office where all these different offices came together. And I remember seeing uh one of those models walking past me uh uh in the corridor. And he looked at me and he gave me the dirtiest look. I was like, what was that about? But my friend was with me. He's like, why did you look at him that way? It turns out my natural instinct now to look at these people is to just make a scrunched up face and just be mean. And that dude was like, who the hell is this stranger doing this to me? It was a fun time. I did 3 years with them, great company. We got acquired by the competitor Flipkart because they they just realized we were better than them, so they might as well spend the money on us.

[00:17:31] Michael Chan: Oh, awesome. Wow. Oh, cool.

[00:17:33] Sunil Pai: So that happened. Uh, it was good, great team. I miss all those people. Uh, but yeah, then I spent a year doing nothing, which is to say I came out with a CSS-in-JS library as uh an experiment and It was just like to help a friend who was like building a website at the time. And I was like, I I don't want to do this again. I just wrote 3 years of CSS and I just, I I can't do it the same way again.

[00:17:56] Michael Chan: And this is, is this Glamour? Exactly, exactly. And this is 2015-ish, about late 2014?

[00:18:02] Sunil Pai: 2015 sounds, wait, 2015, 2016, I don't remember. It was around the time, like I got-

[00:18:08] Michael Chan: I think we met at the React Europe in 2015, summer of 2015.

[00:18:14] Sunil Pai: Right. Did I had I put out Glamour by then? I

[00:18:17] Michael Chan: don't think so.

[00:18:17] Sunil Pai: No, I don't think Glamour had come out yet. It hadn't. Uh, but it was supposed to just be an experiment for me. Yeah. And I I wanted to save it somewhere so it goes on GitHub. Didn't expect anyone to have a look at it. But slowly started having conversations with people. And I remember the first version of Next.js from Zeit used only Glamour. Yeah. Like it didn't have anything else. Yeah. And uh Guillermo, who is like such a sweetheart, he put he put it up in his slides and he's like, "Glamour is awesome." It is awesome. And suddenly like I started getting the GitHub star treatment where I refresh every 10 minutes. I'm like, "Who are all these people? Why are they here? Who are you? What's going on?" Uh and I found myself being dragged into conversations, very uncomfortable conversations where I had to have an opinion about how things have to be built and how it shouldn't be built.

[00:19:10] Michael Chan: Isn't that such a funny thing? Like you, you give a talk or you open, open a library up and then all of a sudden people start pulling you into random conversations to settle a bet basically.

[00:19:18] Sunil Pai: Effectively. And it's odd because I don't want- this is exactly what I mean. I, the only, the only delta I have with somebody else is that I wrote 400 lines of code. Okay. Because otherwise we are pretty much on the same level. I'm not the expert. Sure. I've written 10 years of CSS and I'm good at that, which kind of actually makes me an old hand. I'm part of the older school of web developers. I'm not part of the React thing and all that. It took me a while to get like- React pissed me off so much. Are you serious? Like classes and this, like it gave me- it was not fun. Yeah. But I just- and yeah, so suddenly people are like, huh, Sunil Pai, uh, CC 3.1, oh, CSS-in-JS is ugly. I got abused. I got a bunch of DMs. Which is also, by the way, weird to all all of you who ever did that to me. You folks are weird and you should like learn how like social manners, I guess. It was odd. Uh a bunch of like hero types that I had in the industry said really nasty shit.

[00:20:17] Michael Chan: I had that too.

[00:20:18] Sunil Pai: That, by the way, that's the one that hurt.

[00:20:20] Michael Chan: That hurts.

[00:20:21] Sunil Pai: That that really hurt.

[00:20:22] Michael Chan: That is the worst.

[00:20:23] Sunil Pai: And it comes out of nowhere. Like you wake up in the morning and you're like, 4 tweets about this and you're like-

[00:20:27] Michael Chan: Yeah, and you're like, I've never talked to this person. I've always looked up to them 'cause I enjoy their blog posts. Like they're really smart. I've learned a lot from them. And they're telling me that I'm an idiot.

[00:20:34] Sunil Pai: Yeah, it's it was it's it's so hard. I think that's why I'm kind of the trolly asshole character that I am right now. It's more of a defense mechanism. Sure, yeah. Because otherwise I'd cry, bro. Like, yeah, I I would have wanted to weep at the time. This is the only way to deal with that kind of treatment.

[00:20:50] Michael Chan: Do you think- okay, so so this this brings up a question though. Do you think that you inadvertently do that to other people, like protecting yourself on accident?

[00:20:59] Sunil Pai: Oh my God, I hope not. Like, I try You know what, I like- are you asking whether I'm mean to other people? Like,

[00:21:07] Michael Chan: yeah, I mean, like, because I wonder sometimes if, like, you know, they have obviously gotten to a point of fame where I know about them, right? And so then maybe this is just part of their, like, you know, their mechanisms for dealing with, with new technology and, and whatnot is by, like, kind of calling me out.

[00:21:22] Sunil Pai: That's possible. That's, you know what, that's very likely. It doesn't make it right, but at least I can understand it.

[00:21:28] Michael Chan: Yeah. And so I just, I, I wonder if, like, if there's in any, any way, like, your defense mechanisms kind of maybe doing that.

[00:21:36] Sunil Pai: You know what, I've actually had people call me out on that before.

[00:21:39] Michael Chan: Yeah,

[00:21:39] Sunil Pai: uh, like, where I'd make a joke where I think it's just funny and I'm just letting off steam after I've read like 6 people say shit in another thread. Yeah, because Twitter is all about the sub-tweets. And then someone's like, why would you say such a thing like that? That's awful. That's such- that you don't do that in a community of people. You say such a thing. And there's no way in 280 characters that I can explain the last 10 years of context to them, like why I would even say that. And it's- and I don't blame them. I was like, okay, fine, I do need to watch what I'm saying. Yes. Oh, that's another thing. Uh, I have way too many Twitter followers. Like, I have way fewer than like a lot of other like famous people, but it's weird. Like, I, I can't say like, uh, dirty shit anymore. Like, I, I control myself. It's okay. I I can't take potshots at a bunch of other things, which is fine. Like, I have other friends for that. Like, I have WhatsApp groups and shit. But yeah, I- and it's good, me, you know what, it's given me a little bit of discipline because it- I think it's taught me that, like, my words have power. Because if other people's words affected me so much. Yes. Yeah. Uh, but yeah, it's- it was odd, and it's- it's been a weird journey. So I did- anyway, so that was the year that happened where I was just jobless. Burning through my savings and-

[00:22:53] Michael Chan: Writing CSS-in-JS libraries.

[00:22:55] Sunil Pai: CSS-in-JS libraries. There's some people that I met in the community that I know that I'll be friends with forever. For example, you, uh, fucking Ryan Florence, Kai, Kai, that's it. So Kai Ohlensperger, who's the uh author of Emotion.js, that that was weird. Like he just reached out to me based on an idea that I had written for last year's React Europe talk. Uh, which was CSS in JS but purely compiled out and all that. And he just took that idea and ran with it. Yeah. And it was weird because it started off being the polar opposite of something like Glamour, but he iterated on it and got to a Glamour API. It basically matches the Glamour API right now. Then him and Mitchell just made that like a speed beast. Like, it is the fastest thing. Like, it's odd. Both him and Mitchell are like supremely talented. Uh, and I'm- so I've made these, these incredible friends. And by the way, we are in our 30s. We don't make friends anymore, right? It sucks.

[00:23:54] Michael Chan: We don't make friends, we don't go to weddings.

[00:23:56] Sunil Pai: Exactly. We don't do that shit anymore. So this is like very- I feel like a teenager. I met Kai for the first time in my life, uh, this- during Diwali this year, right now. Same here. Uh, and it's weird because it feels like we've known each other for years now. We know everything about each other. We know what we each dislike, what we like. And it's been amazing hanging with him. And the dude is tall. So tall. You can't tell on Twitter, but he's so tall.

[00:24:21] Michael Chan: This is the weirdest thing about like meeting, knowing people on Twitter and then meeting them in person. Is

[00:24:26] Sunil Pai: you always get the height wrong, right?

[00:24:27] Michael Chan: Always get the height wrong. You can never get it right.

[00:24:29] Sunil Pai: Same thing happened with Max Stoiber. Max Stoiber is a tall dude. He's so tall.

[00:24:35] Michael Chan: Yeah, yeah, yeah, yeah. And it's, I don't know, I think age is always kind of hard to gauge on Twitter. Sometimes you get it right. I remember thinking Max was- I mean, I knew that he was younger, but he like, he looked a little bit older in his photos. And then when I saw him in person, I was like, oh yeah, no, you're- you're whatever. Super tall.

[00:24:49] Sunil Pai: And it was annoying because then like, I want to take pictures with the people I meet, but now the selfie has him at one level and me at one level.

[00:24:57] Michael Chan: It feels awkward to hand it- hand the phone to the tall person, be like, hey, can you, uh, snap this photo for me?

[00:25:02] Sunil Pai: Yeah. So I did that for about a year and, uh, I kind of started running out of money and uh I started looking for like opportunities. I was all I was always talking to like startups and a bunch of people kept reaching out to me for help for like, because clearly they knew that I was into React and they're like, hey, we're thinking of using React, do you think it's a good idea? I'm like, oh yeah, it's a good idea, like let's do this. Uh I'd build off like a prototype for them too, but that wasn't making me any money. Um so I started looking like slightly broader, like not just inside India and stuff. And I got myself an interview with Google. Uh, and that was kind of exciting. Uh, I'm not going to mention the team or who I met. Sure, sure. Because that turned out to be a weird experience. Uh, they- I don't think they liked me very much, Google. Anyway, but what was happening was I was going- I was heading to London for an interview with Google and uh Dan was like, "Hey, since you're coming over here, you should just interview with Facebook as well." And so he referred me, uh, and so I literally did the interview in Google. Google didn't know that I was interviewing with Facebook, but Facebook knew I was interviewing with Google. Uh, I did Google, I checked out of the hotel, walked 50 meters to the next hotel where I checked in, and then went and did the other interview the next day. The Facebook interview was super fun, uh, and that was nice. And then I went back and I waited in India. I kind of thought I had the Google gig, but it didn't happen, and they gave me like really shitty feedback. Uh, but Facebook kind of dug me. They were like, "Ha, like everybody who met you had a great time. You, you clearly like know the things, you work." There was a great culture fit, so to speak.

[00:26:35] Michael Chan: Sure, sure.

[00:26:35] Sunil Pai: Oh, and also I uh realized that Facebook isn't evil. I might get fired for this, so my phrase is that they're incompetent at scale. It's im- it's impossible to do something for 2 billion people at a time, especially- I agree.

[00:26:50] Michael Chan: Yeah, right, it is, it is.

[00:26:52] Sunil Pai: The simplest feature will be found by somebody and abused like mad.

[00:26:56] Michael Chan: Yeah, yeah.

[00:26:57] Sunil Pai: So Facebook had this whole move fast move fast culture for a time and they've dialed that back like a lot because now like they seriously consider uh the repercussions of just the simplest diff, the simplest feature that you put out there. And it's a it's a hard thing to do because-

[00:27:12] Michael Chan: Well, it's a big target too. Like people want to see Facebook fail. I mean, it's the Goliath.

[00:27:17] Sunil Pai: It is, yeah.

[00:27:17] Michael Chan: And so like you got just a million Davids trying to throw rocks at your head.

[00:27:21] Sunil Pai: It's it's very easy to, it's it's given me empathy to these companies. Don't get me wrong, I still think they're mega-corp, boring corporations. Of course. But I don't think they're fundamentally evil. You know, that's the difference. Maybe they're evil by accident. I don't know.

[00:27:34] Michael Chan: Wow.

[00:27:36] Sunil Pai: Anyway, yeah, I'm just- hey, just saying like it is. But I like the people in Facebook. Like, internally, the work culture, the way everyone treats each other is just amazing. Yeah, uh, sure, everyone works really hard, but I can- on a Monday morning, if I think I don't want to go to work because reasons, that's fine. Like, it's cool, everybody understands it. No one really questions it because everyone has like a lot of faith in each other. Yeah, no one really tries to abuse the system. So yeah, like some Mondays I'm just like, yeah, I'm not going in. But then sometimes I'm like, yeah, I'm gonna work for 2 days straight through the night and bust out like a whole bunch.

[00:28:14] Michael Chan: This will be done in 3 days. Yeah, yeah.

[00:28:16] Sunil Pai: So I joined, uh, I, uh, I got the Facebook call and I moved because That was also my first time in London for the interview, and I loved it. It's just the most magical, multicultural thing ever. Yeah. Just so many accents everywhere, which is just such a turn-on. Like, it's awesome. Uh, so I, I moved there with the wife, and, uh, my wife actually like pushed me to it as well because she did her uh uni degree in a place called Lancaster, and she loved the place, and she knew that I would love the place as well. And I ended up Loving it. So we moved, it was nice. Um, the rent is super expensive. Fuck you, London. Uh, and uh, and then I found the opening in the Oculus team and I was like, okay, they need like React folks. You know what? So this is what I tell people. Like, I was so excited and happy to not do web development for a while. And then I spent my first 3 weeks with Oculus just fixing CSS bugs with React Native in like React VR. And I was just like, this is this is a cosmic joke. Like, why am I the CSS guy? Why why does this come to me everywhere. Like, I did not expect to be the CSS guy. I've written a shit ton of CSS, but that's kind of-

[00:29:25] Michael Chan: Like, you just keep getting reincarnated into the same human.

[00:29:28] Sunil Pai: Yeah, it's weird. Like, like, you know what, I accepted, okay, maybe it's fate, but it's a cruel joke is what it is. But yeah.

[00:29:36] Michael Chan: Especially for such a terrible language.

[00:29:38] Sunil Pai: Especially for such a terrible language. You know, you know what, actually, that's just it. There are two parts to CSS, right? It's the attributes. There's one long list of attributes and values that you give. Color, this, that. That's amazing. Awesome. That's brilliant. There's nothing better, I think.

[00:29:54] Michael Chan: I agree.

[00:29:55] Sunil Pai: Okay. I think selectors are garbage. Like, yeah.

[00:29:58] Michael Chan: And when it's because they they were never intended to do what we do with it. Like we abuse them.

[00:30:02] Sunil Pai: Exactly. We have no choice but to. I mean, it's abuse, but it's abuse so that you get to prod. Yeah. But, and the the problem with CSS, trying to explain the problem with selectors to people is that it doesn't fit in a tweet or a screenshot. Yes. It happens when you're on a project 6 months or a year old where it's starting to grow and suddenly you're like changing features and doing rewrites. Yes. That's way simpler with- JavaScript had the same problem in the in the late '90s and, well, not late, the early 2000s because of a global namespace. It had exactly the same problem. Yes. Load a bunch of modules in order. People got so- like, I think that's why, like, people got- people got used to being so careful about it. Yes. That now they, they rally when they see, like, a huge dependency tree now in npm. They're like, oh shit, this is so much more complicated than it used to be. But the whole point was that we were not capable of doing that. The whole point of dependency trees right now is that it's not your problem anymore.

[00:31:00] Michael Chan: Yes.

[00:31:01] Sunil Pai: And people freak out, oh look, there are like 1,000 files in my node_modules directory. Like, why does it matter? It's literally not meant to matter. Should we make- should we just call it .node_modules and make it a hidden folder? Do you think that'll help?

[00:31:13] Michael Chan: Ooh, that's a good question.

[00:31:14] Sunil Pai: Like, because it doesn't matter at all. Sure, it matters in the sense like, oh, make sure your bundle size isn't too big and all that. But no, people seem to freak out when they see like a big tree.

[00:31:25] Michael Chan: It is intimidating. Right, like, I think like, uh, like, like Ruby kind of hides all that from you. Like, they do hide it. And so like, you you don't ever see that. And I

[00:31:34] Sunil Pai: know that's the whole point of computers though. Like, abstraction is supposed to hide this stuff for you.

[00:31:37] Michael Chan: Yeah.

[00:31:38] Sunil Pai: Can you imagine what these people would do if they started counting the number of transistors in a in a processor? Right, there are billions and trillions of those things.

[00:31:46] Michael Chan: Yeah, yeah, yeah.

[00:31:47] Sunil Pai: So I mean, let's get some perspective here. Yeah. And you know what, that's the other thing that I learned when I I started with this uh with the Oculus team, right? So there there are two flagship really Oculus devices. There's the Rift for like video games and stuff on PCs, big monstrous massive graphics cards, uh all that stuff. And then there's the mobile stuff we do, uh especially the the thing that we just came out recently, it's called an Oculus Go. So that's like an S7 kind of specs. Sure. Like the specs are not even like this year's best phone, like possibly of 2 years ago or a year ago when they made the hardware specs. And I'm thinking to myself that if we can get- I did a little demonstration of chess that we built with React. Yeah, that was great. Right? So that is also running React Motion, right? And it's getting 60 FPS animations on the single-threaded thing. I'm thinking to myself, hey, if I'm able to pull out this kind of performance from a shitty mobile device, I think the rest of you can manage CSS in your JavaScript. Like, seriously, stop freaking out so much about it. Sure, you can abuse any technology and make it like terrible, but come on, man. Like, there are a lot of people doing like way better things.

[00:32:58] Michael Chan: The hate on that, it's like, it- that one took a surprisingly amount of- a surprisingly long amount of time.

[00:33:06] Sunil Pai: Yeah, it's still- it's still hated. Like, I have a saved term that I go to, and there'd be like, I think it's about a 50/50 split of people- it's- it only generates strong opinions either in one way or the other. There are people who love it, or there are people who are just disgusted by it.

[00:33:22] Michael Chan: I think you gave a talk, it was at React Europe maybe a couple years ago, where you were- you were talking about that kind of initial web development experience where you like, you do like a, a span and you like color red and whatever. And now with React and with CSS-in-JS, like you get back to that kind of experience, but then all of the optimization, like, or like the onclick, like right on the element, all of the optimizations, all of the things that make that fast, like are handled by at the framework level.

[00:33:52] Sunil Pai: Exactly. Yes. Oh my, that is, that is a big change in that. Like you owe, we owe that to React, like to introduce that kind of thinking, A, to like think ambitiously about what you can get the computer to do for you and then get back to like the developer experience that you want to be productive. That's insane. Because the first time you see it, it's weird. Inline handlers? I spent 10 years not doing that because everybody and their dad told me it was a bad idea. And suddenly I'm like, Facebook is doing it? Like, really? And like, it makes you think that Facebook sucks at JavaScript, right? Totally. Like, you're like, oh, clearly they hire badly. And like, and it suddenly-

[00:34:31] Michael Chan: I think we'd seen a wave of kind of like poorly thought out Uh, JavaScript frameworks starting to come out from fairly big companies.

[00:34:38] Sunil Pai: Oh, sure. Yeah, exactly. Oh, everyone was getting on this, uh, chain systems, right? Like just you, you bind these objects together and they magically update, but it was never really performant.

[00:34:48] Michael Chan: Yeah. And so we'd seen a bunch of those and this just felt like, oh, well, Facebook's got a shitty framework that they use for UI too.

[00:34:54] Sunil Pai: I, I, I watched the talk, uh, the JSConf 2013 talk where they announced it. I watch it at least like once every 6 months or so and I die laughing. So I love Tomo, I love Jordan walk. Not just love Jordan walk, I think like he's kind of a genius or whatever. Oh, he is. Yeah, but that's a terrible talk. Like it is not a good talk. At least it's not a good talk to market the idea because he literally goes up and says, oh, this is JSX, our version of XML. He says something like- Yeah. And he says that to a room full of JavaScript developers. Uh, I'm I'm just cringing. I'm like, oh my God, I can't believe you just said that.

[00:35:31] Michael Chan: Yeah, your NIH bells go off like hardcore.

[00:35:34] Sunil Pai: Yeah, pretty much.

[00:35:35] Michael Chan: Yeah. It was so funny. The first year of React, it seemed like everyone was talking about like the virtual DOM, right? And like maybe like a year after that, it was like, oh, like the value of this thing is that we don't have to think about it or nobody does.

[00:35:47] Sunil Pai: Exactly. Everybody made a virtual DOM library that very few people ended up using, right? The the the most successful virtual DOM library was Preact. And again, it's because nobody cared about the virtual DOM behind it. Right. It's, it was like, oh, finally we have like component interfaces and all. I tried a bunch of those virtual DOM libraries. They're very well built. You know what I mean? Uh, but it meant that you would have to reinvent all the other bits around it, like a component system and state and stuff like that. Yeah.

[00:36:13] Michael Chan: Yeah, no, I agree. I think, um, right around that time. So we, I think we started, I think I wrote my first React code back in 2013. Um, and then We started working with it like kind of 2014, maybe March. And then, um, then we met in 2015. But I was- I- we talked about this last night at dinner. I was primed at that point for, for that shift. Like, in- I didn't get it right away at first, but I, I was already building in my Rails apps. I had partials that, that would have like the Vue code for, you know, for the Rails. But then I would put like a script tag and I would put like CSS like inline there. Um, and like, like an on, you know, kind of like this one-off, you know, selector and like an inline handler and all that kind of stuff. Because I wanted that to be something that could just go away.

[00:37:02] Sunil Pai: Yeah.

[00:37:03] Michael Chan: Like when it, when it disappears, like, you know, maybe, maybe we're smart enough to remove the template, but that CSS and that JavaScript are living in the app for the rest of eternity.

[00:37:11] Sunil Pai: Yep. Nobody deletes CSS ever.

[00:37:13] Michael Chan: Ever.

[00:37:14] Sunil Pai: Ever.

[00:37:15] Michael Chan: Unless you, I mean, the only way is to start over.

[00:37:17] Sunil Pai: Yeah, that's right. I've done that a bunch of times. It's very liberating. Like here's 6,000 lines of CSS just out the door. I don't mind spending the next 2 months rebuilding it again, but yeah, it's a good feeling. Oh, I actually have a story about the that year that we met. Yeah. Like why I even showed up at React Europe that year. So about 6 months before that, uh I was at Myntra and we were just getting React into like a few places. Like our main stack did not have React, of course. Like I was just like starting to read about like React in like late 2014, early 2015, because of Pete Hunt's and David Nolan's talks. Yep. Those are great talks.

[00:37:55] Michael Chan: Amazing talks.

[00:37:56] Sunil Pai: Still like one of the better talks in the React community. Uh, and at the time, my company decided that they were going to shut down our website and go only apps.

[00:38:06] Michael Chan: Wow.

[00:38:07] Sunil Pai: Right. And I was the JavaScript dude there. So I was like, am I getting fired? Like, is is this how it ends? It's odd, but okay. But no, like I had a great manager, Shyam at the time. And he was like, you know what, no. First of all, like, you have a lot of value. You've done so much. Like, you've built out our Node stack and this and that. Why don't you just figure it out? Like, take a little time, figure it out, and like, keep yourself interested. And then React Conf happened. And at React Conf, they announced React Native. By the way, for, for about a month right before React Conf, I was look- I bought a Java book and an Objective-C book, and I hated it. Like, I went 10 pages and I was like, no, terrible. Oh, terrible. This is not for me. And like mentally I was thinking, okay, I'm probably gonna quit in a month, like, or 2 months, like, because there's clearly nothing else I can do. And they announced React Native and I just, I was like, this can't be real. Like, this is so unreal. Uh, but we weren't at React Conf. And you remember they gave access only to the people who attended it. They gave beta access.

[00:39:07] Michael Chan: Oh, people were pissed about that.

[00:39:08] Sunil Pai: Right? So what me and another colleague, Param, who's like just the smartest cookie ever, I'm looking forward to working again with him in the future. So we used the talk and we like reverse engineered a version by ourselves of React Native. And we took that and we sent it to Christopher Shadou. And he replied back saying, okay, you have access to the repo. So that that's how it is. Which is why I went to React Europe to find out what the Android story was, to corner Vijay and to like ask him questions about it. Yeah. I made sure that I was staying in the same hotel that the FB folks were at. I was like, this was a big plan for me. I wasn't just there for the talks. So it was great. It was great.

[00:39:46] Michael Chan: That's awesome.

[00:39:47] Sunil Pai: Yeah. So we got- we were the first folks in India to get React Native into production. We even built our own over-the-air update system. Yeah, because that's how we managed to convince uh management. We were so used to making like 10 changes a day to the website. Yeah. And suddenly there's a uh month-long cycle to push out your mobile app, and we were not okay with that. I'm like, no, we can now push it out 10 times a week again. It doesn't matter. And they were like, okay, let's do this. Let's get into production.

[00:40:11] Michael Chan: That's awesome. Well, it's uh it's been about 40 minutes and we have a talk that we're really desperate to see, uh to see Kent C. Dodds. Um so real quick, last question. Do you have projects and people that you're really excited um about or you think are doing good work right now?

[00:40:26] Sunil Pai: So a lot of my free time, so to speak, is spent hacking like around Suspense right now. Trying to find out what the edge cases are, what it can be used for. How else, which group of people do we piss off now? Yeah. And that is really great. I'm keeping a close eye, non-committal, on the stuff that we are doing in the design world. I think FramerX is the next step. I'm not sure if FramerX is the answer, but they've clearly thought about what the next step should be and how how we make applications. That's fun. I also- and I was mentioning this to you earlier, is I think this year or next year is the year that JavaScript developers stop being web developers primarily. Mm. Because there are so many new uh mediums for us to express ourselves in now. I think VR is getting there. I think it's a little too early to be like super mainstream, but it will get there. It's obvious. Um, stuff, I think people are going to write React renderers a lot of way more React renderers in the future. So I always keep an eye open for like what next programming language community is the other React folks gonna get into.

[00:41:36] Michael Chan: Yeah.

[00:41:36] Sunil Pai: It's an interesting pattern. Uh, yeah, nothing specific. Oh, and of course, like I look at every CSS-in-JS library. I make sure it- I have I have an opinion on it. I make sure I have a strong opinion on it.

[00:41:47] Michael Chan: You gotta keep a pulse on it, right?

[00:41:49] Sunil Pai: Exactly, of course. Like I need I I have a saved Twitter search to make sure I know who's hating on it. Make sure, because people give up their opinion on it very easily.

[00:41:58] Michael Chan: Yeah.

[00:41:58] Sunil Pai: Like literally there'll be an Orbit question saying, hey, what is the best advice you got in your career? And the first answer will be, don't put your CSS in your JavaScript. Like, come on, man. Like, clearly you haven't even tried. Like, obviously. So yeah,

[00:42:14] Michael Chan: it's nice to know that you're watching over the space for us. Yes, I am.

[00:42:17] Sunil Pai: Thank you. It's cool, it's cool. If anybody crosses the line, I'll let them know.

[00:42:21] Michael Chan: You're our Batman. Uh-huh. Uh-huh.

[00:42:24] Sunil Pai: Uh, that's it really. Otherwise, uh, what I really- I'm excited about JavaScript becoming more open for people who aren't- I want- I don't want to say not good at programming, but very early in their programming journey. Uh, we are- I think we are getting to a place where we're going to start ditching authority, uh, because sure, there are a lot of great ideas from the last 10, 15 years, Uh, but some of those are holding us back. Some of those are ivory temples and they're just not inviting to beginners and people we actually need to reach out to. It's weird that designers aren't all over JavaScript, and I think it's because we keep them out. So it will be nice. It would be nice to fix those problems. I think that's- I think that's gonna be the next big JavaScript thing where we envelop other domains.

[00:43:10] Michael Chan: Awesome. Well, I'm excited to see that unfold. We'll have to talk about that more. Awesome. Well, thank you so much, Sunil, for being on the show. I really appreciate being able to talk with you and uh and and connect a little bit more.

[00:43:22] Sunil Pai: Thanks, Michael. I had fun too.

[00:43:25] Michael Chan: That's all for React Podcast episode 23. For links to the people and projects mentioned in this show, though they are few, visit reactpodcast.com/23. And finally, consider supporting the long-term health of this weekly show by visiting react podcast.com/partner and choosing a plan for our Patreon. Join us next week for a hilarious episode with Burke Holland. We talk VS Code, Azure cloud services, and how he found the identity of Horse.js.