Party Corgi Podcast

MDXConf Speaker: Laurie Barth

Episode Summary

MDX Conference speaker interview with Laurie Barth.

Episode Notes

Episode Transcription

Chris Biscardi: [00:00:00] Hey, Laurie.  

Laurie Barth: [00:00:03] Hey,  

Chris Biscardi: [00:00:04] thanks for coming back on the podcast.  

Laurie Barth: [00:00:07] I know I'm so popular. You just need me here all the time. You don't know what to do without me.  

Chris Biscardi: [00:00:11] I really do. But also there's some people that have never heard of you. So you should definitely introduce yourself.  

Laurie Barth: [00:00:17] Hi, I'm Laurie. I'm a staff software engineer at Gatsby.

I help maintain MDX. Uh, I do TC 39 things. And sometimes when I find time I make egg head videos and write blog posts, man. That's a really long list. I'm going to stop now.

Um, so do you see, 39 is the standards committee for, uh, Aqua script, which is the standards that JavaScript are based off of. I work on the TC 39 educators committee, which means, um, people who get involved with TC 39, like to argue about syntax. And my job is to explain to everyone what syntax they're arguing about so they can join in on the fun.

Chris Biscardi: [00:01:01] Ooh, that sounds like professional Twitter.  

Laurie Barth: [00:01:04] Yeah. Professor professional, um, support of trolls feels like the most, um, depressing way to look at it. No, I think it's, I think it's great for people who aren't just kind of the, in the weeds folks to know what's coming so that they can weigh in because oftentimes, uh, enterprise use cases or, um, There's all kinds of use cases that like the typical person paying attention to TC 39 doesn't know about.

And so it's important that we get more voices involved and that means they need to know what we're even discussing.  

Chris Biscardi: [00:01:42] That makes a lot of sense. Given your background in like enterprise consulting and also the content that I've seen you put out around sort of like. JavaScript syntax that's up and coming.

Right.  

Laurie Barth: [00:01:52] I literally just like writing things where I'm like, this is how this works now, you know?  

Chris Biscardi: [00:01:59] Okay. So what's, what's the, what's the next thing. What's the, what's your, like, this is how this works next, like super exciting thing that you, uh, are aware of.  

Laurie Barth: [00:02:08] So I always forget the term for this, which you know, is really useful on a podcast where I can actually show you things, but you know, you can do plus equals.

To for expressions. So they're talking about doing, doing those, um, with like Julian comparative operators. So like question Mark equals, um, or, and equals, or, or equals it's a term for it. It's like conditional expressions or something. I don't know, but it's really wonky and cool. And it's one of those things that like, no one knows why they need it and I guarantee you once they pass it, it's going to be everywhere.

Chris Biscardi: [00:02:47] So, this is like the replacement for like the, if this and that, then that variable thing. Right. I'm excited.  

Laurie Barth: [00:02:56] I know. I kind of like it. I mean, there's, there's all kinds of stuff, right. There's like 20 proposals at once, but that one kind of struck me as something I never would have come up with on my own, but I could see use cases for, and those are always my favorite because it feels like there shouldn't be that many of those left.

Like we should have done all the things that are obvious by now, but apparently not. There's always something. Now, if we could just get pattern matching and I think everyone in the universe would be happy.  

Chris Biscardi: [00:03:24] Oh, man. I really want pattern matching.  

Laurie Barth: [00:03:26] That thing has been in proposal land for forever. I don't know.

Apparently. So pattern matching had a champion and that champion kind of had other stuff going on and it's recently been picked up by someone new. So there is hope that it is finally gonna make it to the finish line.  

Chris Biscardi: [00:03:42] I, I know who that person is and I know what the proposal is. Cause I've read it. Yeah, because I'm super excited about pattern matching.

So I'm super excited.  

Laurie Barth: [00:03:50] So, so my thing is I've been, I was sitting there waiting for like a good year, two years for optional training and knowledge coalescing to go in a, it was just sitting there and I was like, come on, it's gotta happen. It's gotta happen. And then it happened. And now I'm like, it's almost like a part of me has died.

Like, what am I waiting for now? I got everything I wanted. Can I just say the amount of times I use optional training, every is just like seriously concerning.

For so long. I, I, I need to use it wherever  

Chris Biscardi: [00:04:20] you didn't make up for all the years. We didn't have it. You know,  

Laurie Barth: [00:04:23] to be fair, please. I say this, I do a talk about this, but please do not use optional training to access, you know, like any key or value on an object, please. Like that's not what it's there for. It's genuinely there to be a conditional.

Accessor, please. Don't just throw it everywhere. There will be so many silent errors. Your coworkers will hate you, but if you actually don't care, it's okay.  

Chris Biscardi: [00:04:52] Don't care about your coworkers.  

Laurie Barth: [00:04:55] You don't care if

you're going to put that as like the teaser for this episode, if you don't, if you don't care, if your value exists, it's like a really nice thing to be able to use. Awesome. Now you're just trolling me because apparently I troll people for a living.  

Chris Biscardi: [00:05:17] You said some really nice things about me to other people.

So I can always say  

Laurie Barth: [00:05:21] I try. Is that how that quid pro quo works? Wow. I can speak today. It's okay. I woke up this morning to reply guys in my Twitter mentions. I'm trying to explain to me that. When I say so I asked people what syntax they struggle with, because I actually think that's a really fascinating conversation to see what things, despite the fact that they work in a language aren't intuitive.

And maybe if we just like move some characters around, people would remember them and therefore they would be more useful because. Things that people look up all the time tend to also be buggered is that people create all the time, at least in my personal opinion. And so I ask people what syntax they don't like.

And B when you're asking people to share things that they don't do well, you tend to want to be vulnerable with them and give them an example that applies. Right. So I said, um, string literals in react, and I got fired a million people saying string literals are an ECMAScript concept. Not a react con concept.

And I was like, yes, thank you. I literally said string literals react because the minute you got to put that second level of curly braces, my brain seems to go like, what? But when they're just string literals, I have no problem with them. So I literally meant what I said. I'm sitting there, like, yes, I am aware of what string, literals and JavaScript are.

Thank you for explaining it to me. Just to troll people. I should just write a new syntax post, where I talk about string literals and JavaScript. Actually. That's exactly what I'm going to do tomorrow. Thank you.  

Chris Biscardi: [00:06:52] I can hold you to that commitment.  

Laurie Barth: [00:06:55] It was like the ultimate troll. You think? I don't know what this is.

Chris Biscardi: [00:06:58] Welcome. Yeah. I've seen people do things like, um, ship intentionally, slightly wrong code on Twitter and talk about it just to see the reaction from people.  

Laurie Barth: [00:07:13] But, Oh man, that seems so masochistic.  

Chris Biscardi: [00:07:17] Some of it. Some of it is extremely blatant, right? Like somebody recently just did like a,  

Laurie Barth: [00:07:22] or are you talking about cat when she made the joke?

When she was like, if numbering, Oh my God, I love her. She is he's honestly the funniest person I've ever met. No replies on that word, truly legendary where they're like, well, no, like you just use modular and she's like, no, no, I I'm thinking of for loop might be cleaner than what I use, but maybe reduce, I haven't decided yet.

And she's just, just rolling them totally over their heads and I feel bad. Right. Someone who's new to coding who comes to that. And they're like, okay, I genuinely want to use this as an opportunity to like improve my refactoring skills and think about it as in our way to do this. But the people who are just being smart asses, like go away serious

Twitter is a dangerous place to write code. That is the moral of this, this podcast episode.

Chris Biscardi: [00:08:19] I'm looking forward to your neck. Uh, Next Twitter code troll tweet. You do film any like very like. Heartwarming and like, uh, educational, like this is this, then this is that kind of tweets. And I'm just ready for the one. That's exactly like that. Just right in the middle of that thread of like heartwarming educational.

One of them is just like completely off the back end.  

Laurie Barth: [00:08:44] Not brave enough to do it because as we saw, I get replied guys for talking about string literals and react, and I just, I lost my patience this morning. There were like 10 responses and to be fair, So we all love Danny Abramoff. Right? Really well, meaning guy does a lot to educate.

He came in and the ass to me, what I meant because he actually cared because he was like, Oh, weird syntax. I would like to know why you think it's weird and why you can't remember it. And maybe we can do something about it. And he did that right before I went to bed. So a bunch of people tried to answer for me overnight thinking that I didn't know what I meant and that I misspoke.

And I come back this morning. I'm like, no, no, literally meant what I said. And he's like, Oh, that's really useful. Yeah. We've tried to put string literals directly in there, so you don't have to deal with the secondary curly braces, but there's a bunch of legacy code that it breaks super reasonable response.

Totally understand why that's the case. And a bunch of people are like, Oh, that's what you meant. I was like, I gave up,

Chris Biscardi: [00:09:47] I had to do some work with something called HTM, which is like a runtime Java. Not runtime, Java, runtime, Java, runtime. JSX basically kind of implementation, but easily template literals for everything. So like you, it gets, it gets even worse than like the JSX that you're talking about right here. That's like open, uh, Open left arrow bracket.

I don't less than whatever. And then you start immediately with like a tag, a template literal, and then you have to write the component, like reference in and then you have to close and then you have to continue the whole block and still do the same stuff.  

Laurie Barth: [00:10:30] We talked about this before we started recording.

I'm currently working on like grief factoring. What was basically POC code. Um, Proof of concept, by the way, I try not to use acronyms. So working on refactoring that right now, and so much CSS and JS in there, which is like something I semi admittedly I hate, uh, sorry, coworkers, max and Jackson and stuff who have like, built incredible platforms on that.

But it's, I like cleaning, I mean, um, components that are, or like parent components that kind of. Blend together and mesh together a bunch of different things for basically a page view. I liked just being able to look at that at the top level. And there's so much CSS and JS in there that like from a readability standpoint, I'm like, no, this restructuring doesn't look any prettier.

I don't like  

Chris Biscardi: [00:11:20] this.

Laurie Barth: [00:11:23] You just want it to be clean, right. And be like, Oh yeah, I see the nice indentation line go in there. It's the pretty little like embedded pyramid of react components. It's all beautiful. That's what I want. And know you've got all these like extra curly braces and key value pairs. I'm just like table flip.

No,  

Chris Biscardi: [00:11:43] I have to admit that I've completely given up on like the concept of clean code or whatever. Like if somebody will say something to me and there'll be like, uh, I'll, I'll write code like this with like a space here in this random spot. And I'll be like, alright  

Laurie Barth: [00:11:56] cool. And will  

Chris Biscardi: [00:11:58] be like, but that doesn't work.

Laurie Barth: [00:12:01] John are tender. And I have a joke that like he, so obviously we all subscribe to the, make it work. Or make it, yeah. Make it work, make it right. Make it pretty kind of mentality. Make it fast. If you want to add that one on there, we all subscribed to that. John's definition of make it work is like the literal.

I keep push the envelope and sending him essentially troll level tweets. Version of like brute force code that I just got working and I sent it to him and he, and he just responds ship it every time. And I'm like, what really? I mean, this is literally the hackiest thing. I can even sync up in my brain of how to do this, that I could make this prettier.

In five seconds and it would still be floor level code and your life

he's like, no, I really like, that's where my bar is. I'm like, no, I think you're just trying to be supportive. And you don't know if I think this is good code or not, but I'm a little disturbed. Like it scares me for what you would approve. It just scares me. I'm like, what are you easily, John himself writes really great code and can produce really quality stuff.

So I'm just like, I'm not, I'm not sure. I'm not sure if you're trolling me or not. Like, are you trolling my troll? I am on shore.

Chris Biscardi: [00:13:33] Yeah. I've definitely had conversations with John like that where it's like, Hey, we should do it like this. And he's like, we could, I'm like, Really bad idea.

Laurie Barth: [00:13:46] Default responses.

Well, listeners, this is probably really not fun. Cause they're like, who's this random person who we both have happened to have worked very closely with. Um, but no, the, the idea of clean code I think is, is kind of a misnomer everyone's definition is different. Yeah. For me, I want code to be as easily understood by someone onboarding into the code base as possible, especially working in open source.

Right? Like if I build something, I would love the community to be able to pick up fixes to it instead of having to maintain it forever because I build a lot of things and a lot of people use them and therefore there are. A lot of potential edge cases, people can find, you know, over the period of the next 10 years or whatever it is.

That's a very idealistic view of the world. Not 10 years, let's say two months. Um, and I'm not wrong. Um, and so for me, it's yes, naming and all of that, but like, is this literally structured in a way that someone can tell what was going on? And you know, if I really want to, I control you right now. Cause I was just.

You know, messing with some of your old code from like,  

Chris Biscardi: [00:14:55] can you give it to me? Give it to me? What is this?  

Laurie Barth: [00:14:58] Prettier had messed up with the way that it was displaying the code in my browser. And you had a bunch of a change, like dot reduce dot map, dot find type codes, but they had all been put on one line.

So, I didn't know they were there cause they were trailing off the edge of my screen. So I was trying to find this bug and I was like, where is this? And I didn't realize that what I was looking at was being completely transformed and this giant line of code, I couldn't really read. And so by the end of it, I found the bug fixed it, committed it.

And then three weeks later I happened to have some time and I said, Uh, does anyone mind if I just turn this into a, for each? So this never ever happens again,  

Chris Biscardi: [00:15:43] to  

Laurie Barth: [00:15:43] be fair, by the time I found the bug and made the change, it made sense to be a four H anyway, cause I was adding up, you had a dot find and then I had to have a dot map and then a Boolean at the end to like, Um, to filter the rest or filter bullying.

And I was like, okay, no, you can't have a find a map and a find and a filter like, no. And that was on top of, I think, like a filter and a map and a reduced in the first place. I was like, no, we're not doing this. No one will ever, ever, it took me honestly, two days and like 20. 20 console logs, Steven, figure out what was happening.

Chris Biscardi: [00:16:21] Great example of like a time that I failed at writing clean code. Right. Stuff. I probably understood at the time that I was writing, it took you two days to get through, and you're a very accomplished developer. You're not some random was coming onto the project for the first time. It was like, Ooh, Gatsby, I'll click into this random folder.

I wonder what this file does.  

Laurie Barth: [00:16:42] I mean, but to be fair, that's kind of how I felt. I was like, what is happening? And, Oh, so here's the gnarly piece that I haven't explained to you. So it was working in probably 95% of the use cases because 95% of the use cases were going through react and reacts, resolved, mess method is greedy, which means that it didn't matter whether the full path extension was correct.

It was finding the right file when it did react. Why did I just say it's good? It's resolved is greedy. When it didn't go through Webpack, it needed the full qualified. Path with the appropriate extension and it wasn't getting it. It was getting just the extension. It never got concatenated with the rest of the file name.

You never would have known if you weren't going through this one, like code path to get to this function because 95 per cent of the time web pack was. Like, Oh yeah. Okay. We're good.

And this is why overloading stuff in common JS is a bad idea because required and result

in different, like depending on what technology picks it up, why did node and Webpack do this? Like I know why, but also I'm mad at them.  

Chris Biscardi: [00:17:57] Yes. Like, like Y as in like con Y like,  

Laurie Barth: [00:18:03] I mean, I've said this a million times, but I think like the hardest part of solving it, problem or writing any code is. The fact, or at least in the front end.

I mean, it's true in the backend, but I actually think backend is better at this in front end. We have a bunch of layered technologies sitting on top of each other and like integrating with each other in the same file, like in the same line of code. And so being able to distinguish between what's JSX what's react, what's Webpack what's, you know, Gatsby what's node, et cetera.

Is relevant. And so when we do things that are literally the same function name, but different, depending on which one is actually resolving it, that makes everything harder.  

Chris Biscardi: [00:18:45] True.  

Laurie Barth: [00:18:47] I have ranted about debugging code  

Chris Biscardi: [00:18:52] Laurie. We are running out of time. I could talk to you all day. I'm sure we'll have you back on the podcast again.

Uh, where can people find you? And is there anything else that you would like to say  

Laurie Barth: [00:19:02] before we close people can find me on Twitter at Lorianne tech. I've got links in there to like my site and blogs and I'm on a CAD as Laurie birth. Uh, and what would I like to say? I would like to say that everyone should come to MDX comps on August 24th.

Am I getting that date rate?  

Chris Biscardi: [00:19:21] I believe. Yeah.  

Laurie Barth: [00:19:22] Yeah, because, and this is particularly fun. I, my entire talk is literally just trying to break MDX V2 and see if I can bust up. Spintax I apologize in advance to the incredible person worm who actually wrote that parser. If I break it, it's not it's because I'm trying like really trying it's great code.

Here we go.  

Chris Biscardi: [00:19:47] I wonder if there's, if the, that segment on John is going to be a record, more recognized because of the, uh, audience for this podcast?  

Laurie Barth: [00:19:55] Probably, probably true. Yeah. Uh, John attender helped build and write and maintain MDs. I  

Chris Biscardi: [00:20:02] just realized we never said his last name.  

Laurie Barth: [00:20:06] He probably won't like that anyway.

Cause he goes by Jonno everywhere. If you can find a picture of him or find a recording in which he actually uses his voice, you have found the white whale congratulate.  

Chris Biscardi: [00:20:19] Alright. And on that note, thank you so much.  

Laurie Barth: [00:20:23] Thanks for having me, Chris. Bye.