This episode is brought to you by WorkOS. If you're building a B2B SaaS app, at some point, your customers will start asking for enterprise features like single sign-on, SCIM, provisioning, role-based access control, and audit trails. That's where WorkOS comes in, with ease-to-use and flexible APIs that help you ship enterprise features on day one without slowing down your core product development. Today, some of the hottest startups in the world are already powered by WorkOS, including ones you probably know, like Perplexity, Vercel, Jasper, and Webflow. WorkOS also provides a generous free tier of up to 1 million monthly active users for its user management solution.
making it the perfect authentication and authorization solution for growing companies. It comes standard with rich features like social logins, bot protection, MFA, roles, and permissions, and more. If you're currently looking to build SSO for your first enterprise customer, you should consider using WorkOS. Integrate in minutes and start shipping enterprise plans today. Check it all out at WorkOS.com. That's WorkOS.com.
Hello and welcome to another episode of The Bike Shed, a weekly podcast from your friends at ThoughtBot about developing great software. I'm Stephanie Min. And I'm Joelle Kinville. And together we're here to share a bit of what we've learned along the way. So Joelle, what's new in your world? What's new in my world is actually a little bit spicy. I visited the local neighborhood Facebook group, as you do occasionally, and it's always interesting to see what people put in there. You know, it's things like, oh, I found somebody's credit card on the ground or somebody's keys at the park, things like that. But something that has been in that group a lot.
is a lot of neighborhood people complaining about bike lanes in the neighborhood. The city's been putting in a lot of bike lanes recently, and that's caused a lot of controversy. And this podcast is called The Bike Shed. I like to bike as a way of commuting around town. And so I've been really appreciating having more bike lanes. But it turns out this is like, if you want to find out what fires up local politics, it's bike lanes, man. It's surprisingly controversial. Yeah. Okay. I mean, my opinion on this is that we should all be able to get around either by car or by bike or on foot.
Yeah, I feel like it's like when you have a fixed street size and then you add it on bike lane, I guess that will be challenging for people who mostly drive because, you know, they do feel like their space is being taken away from them a little bit. Yeah, it's hard to figure out infrastructure to allow everyone to be able to get around. I am also a pro bike lane kind of person. I think you and I have both talked about biking on the show, even though this podcast is not ostensibly about biking. But here you and I are also cyclists as well as developers, I think.
Yeah, I am glad that they're putting in more bike lanes and it's kind of a bummer that it has to be a spicy thing. I think it's important to have empathy for people. If it's a situation where some people are losing parking, I can understand why that might be frustrating because parking is already really challenging to find in the Boston area. So I can empathize with that. Some streets have gone where they've lost a lane. So it's gone from maybe two lanes in each direction to one lane in each direction. And like, understandably, right, that makes it maybe a little bit even more traffic and makes that commute to and from work every day more frustrating. So I do think it's important to have empathy that there are real reasons that people are upset. They're not just haters.
But at the same time, like you said, it's balancing the needs of different users and having some for people in cars, but also making sure that people on bikes, people on foot are able to get to where they're going and feel safe and be safe, right? We don't want any deaths in the neighborhood. So it's a tough thing to balance. So I was just in Boston about a month ago, and I actually saw you there. And one thing that I really appreciated was there was a trail that was just for bikes and pedestrians that I got to ride one of those bike shares on.
That was really fun. And I love when you have just a separate infrastructure for that. So there is none of that conflict between drivers and cyclists. So that was one thing that I really enjoyed about being in Boston. And I actually was really impressed by the bike infrastructure there.
Yeah, it's incredibly popular and for good reason. And so that actually leads me to what's new in my world, if you're ready to hear about it. Yeah, let's hear it. Which is that I have moved from Chicago, where I lived for like six, seven years, to upstate New York in the Hudson Valley. And one of the biggest reasons is to live somewhere where I can walk and bike everywhere and not really have to drive to get around. That was going to be my first question. What is the bike infrastructure like in the new place? So one of the really cool things about...
the Hudson Valley where I'm at now is there's a bunch of rail trails that are just former railroad tracks that have been converted into mixed use for, for walkers and bikers. And that kind of connects all these little towns along the river. And so that's been really fun. There is some pretty good bike infrastructure in the city I'm in now. And I'm also just in a much like smaller city. So I think it's like, I don't know, like a 25 minute bike ride to get from one side of town to the other. And so that makes me feel like I can do anything I need to by bike. You don't have to worry about it being too far away the way that Chicago kind of felt sometimes because it is a pretty like sprawling city. Like it has a very big footprint. And yeah, long time listeners might remember this time last year, I actually did a bit of a trial run month long stay in the area to figure out if my partner and I wanted to move here permanently and it went really well.
and we finally did it. And yeah, it's been really great. And so it is actually a very big thing that's new in my world because I, yeah, moving. Turns out your whole life kind of changes a little bit when you relocate. And now you're also in the Eastern time zone. So we get to be the same time for scheduling.
Yes, that has been really nice, actually. I didn't realize how even just an hour would change that kind of work routine because I work with a lot of folks, not a lot of folks, but more folks than usual on the like Western and mountain time zones. And so now being on Easter time, I have like a quieter morning where I have like an extra hour just to do some catch up stuff, just to like do whatever I need to do before my first meeting. And that has been really nice. Yeah, I used to be like, okay, get to work. Now I have to go to a meeting. But now I'm like, oh, I can, you know, just kind of ease into a little bit more, kind of square some things away. And yeah, I think my like daily sync updates have been a little.
more thorough because I actually have time to think about what I want to say before I jump into Zoom. Yeah, I guess being in central time, you don't get a quiet period at either end of the day. You're just kind of in it all the time. Yeah, exactly. So yeah, that's been nice. So Joelle, I want to tell you about a really interesting saying that I heard the other day about kind of leveling up from a junior developer to a senior developer. And the saying goes, junior developers collect solutions while senior developers collect patterns. And I'm curious if you've heard this before or like what kind of your first impressions of that kind of heuristic.
I mean, we love a good heuristic here on the show. It's like, it's very pithy the way it's expressed. I'm not 100% sure I know what it means though. What would you say the difference is here between patterns and solutions? Yeah, I would say that solutions maybe are one-off. Like they are kind of more isolated to just like whatever the strategy was for solving some particular technical problem. And I think there is some amount of kind of like...
rediscovering a solution each time when kind of tackling something new, like a new problem or something unfamiliar. Whereas I think the idea of patterns here kind of leans into the figuring out like what do the problems I've encountered have in common and the solutions have in common. Maybe it's more situated in context and being able to maybe try fitting a couple of different patterns to try to approach something and then deciding which is the best one. based off of how those trade-offs look, as opposed to kind of only having the skill to kind of come up with one solution, right? And then just that being kind of, you know, what you think is the way to solve the problem. So this would be the difference then between like wondering, oh, what is this like token parameter doing around and looking at something and be like, oh, they're doing two-legged OAuth here. I mean, potentially, yeah. There's something to the idea of like a solution being like the first thing that you can come up with and then therefore being what you go with and not quite having enough experience to see different ways of solving something. I think that's...
What I encounter sometimes when working with more early career developers is they're ready for the review and maybe ask, oh, do you consider something like this? And then they're like, oh, no, that is cool. And then we're like, great, let's talk about it together. But maybe not having the experience yet of seeing different patterns or different ways of doing something and knowing how to evaluate which ones to reach for. I think what I'm hearing is almost the idea of collecting categories of solutions. So instead of just playing around with a couple of solutions that are very similar to each other with slight variations.
having enough experience to be able to be aware of sort of other totally different approaches to solving the same problem in that same sort of problem space and being able to know when to apply them. Yeah, I think that sounds pretty accurate. I think this was on my mind because I am working with someone who is in that kind of middle space of trying to level up from solutions to patterns or categories of solutions. And she was asking me like, How do I actively learn this, especially in day-to-day work, as opposed to being told to go read a book on design patterns in your own time? I'm specifically curious about how to support people in that particular kind of growth area at work. I'm curious for you, what was your journey like to move between these two phases? Very fraught.
I think. I don't know. Maybe it's just always a bit of a growing pain for everyone. But I think there's, you know, you kind of go from like not knowing about design patterns at all, just like not knowing they exist, like literally thinking that your job is just, okay, solve the problem in front of me. And then when I find a solution, I'm done. To people saying, oh, like this code could be improved or like, you know, it could be cleaner. I don't know. Just kind of, you know, getting feedback that like something's not quite right, but you don't really know what to do with that feedback because you're like, oh, I did the thing. I made the code do what was asked of me.
Yeah, I think at some point I went and read a book, but it was kind of a twisty journey to get there. And I actually, that actually manifested in a conference talk that I wrote that I gave a few years ago called the intro to abstraction I wish I'd received because I feel like that was this like underlying concept, the idea of abstraction and code that. I don't know, I never felt like anyone explained to me really well. And that's obviously really important in understanding how to go from, I don't know, like writing for loops or whatever they teach in very introductory programming classes to this idea of like, oh, you're actually, you can build a very complex system, but that also means that you need to introduce these abstractions or models to house kind of that complexity. Learning abstraction is hard, right? Because it's not just patterns, but it's knowing when to sort of judiciously apply them. We've talked a lot about dry, the don't repeat yourself principle, and how that is often sort of misapplied or misused.
And I think that I often see with kind of intermediate level developers is sometimes an overuse of abstraction or incorrect use of abstraction because you've got these tools and you want to level up and now you're just applying them everywhere, oftentimes with poor results. So you do want to get beyond that sort of beginner level where you have no abstraction at all and that's introducing bugs to your code. But you have to get over the sort of intermediate hump where you're over applying or misapplying abstraction. And that's the thing that I think we all have to work our way through. Yeah, I would love to talk about some strategies for...
doing that. And I think I was having a conversation with this intermediate developer and trying to think of some things that she could do to actively practice. And I realized it's so hard to do on your own because you don't know what you don't know. One of the things that I started to come up with is telling her, are you aware of when you do feel like some code is messy and could be improved? You just know that you might get that feedback that's like, oh, could you refactor this or could you extract this? She was like, yeah, I do know that. I have a little sense of that. I'm like, great. Now let's try to...
codify that a little bit, like what, like engage with the code that makes you kind of feel like, oh, like, I don't, I don't know how to, I need to do something with this, but I don't know what, and start to describe it maybe, like see what are some characteristics about it. I'm thinking just some like deeply nasty conditional logic. You and I, last episode we did together, talked about procedural code. Sometimes I think that is one of those instances where it can be a little bit like, like maybe this could be better. And just in general, kind of anything that's hard to just keep a mental model of in your brain, like when you step away from it and then come back, do you have to?
where we go line by line to refresh your memory on what it is that the code does. Those are some things that I can think an intermediate developer might be able to start noticing. I think what I'm hearing is encouraging this developer to start adopting their own set of heuristics for code quality and going beyond just individual cases of, I don't know, we've got some things here, let me just fiddle with things until they work and start trying to build bigger picture intuitions. Yeah, that's a really great point. And also, that's different from relying on other team members to their intuition to kind of tell you, which is obviously a totally fine strategy.
and is definitely something to learn from as well. But in some ways, you also want to be building that muscle yourself. And I'm sure the kind of those things in tandem, having other people point those things out to you and then starting to take that and then trying it yourself is like a very, I think, effective way to grow. And these heuristics don't have to be particularly complex or fancy, right? You'd mentioned the idea of paying attention to how deeply nested your conditionals are or your loops are. That by itself, if you're like two or three levels in and that becomes maybe not necessarily something bad, but it can be a code smell, something that...
encourages you to pause and think, is there a better way to do this? It's a great start for someone who's just trying to dip their toe in these waters. Yeah. I'm glad you mentioned code smells because that was actually the place I revisited next is like, okay, what are some easy smells to kind of help someone start to attune their nose to? And I revisited ThoughtBots Ruby Science because they have like a really great comprehensive section on code smells. And I honestly just picked the two like really...
obvious ones, like obvious and easy ones, long method and large class. I don't know. I almost feel like those don't get enough attention as like, oh, these are actually really great smells to kind of keep in the back of your head. Maybe it's because they're so basic. But yeah, I really like the descriptor of them was just like, can you describe what these things do in like a sentence? Can you just like remember what their responsibility is? And I was talking to that same developer and sometimes I would kind of provide these heuristics and she would go like, oh, it can be like that basic. It's like, can I describe this in a few words? And I think...
you know, maybe sometimes it's easy to get into that, like really kind of like you said, overcomplicated headspace of trying to apply a bunch of distractions when really you kind of want to just start a little bit more basic with, is this method long? I think sometimes too, there's a little bit of that being intimidated by more senior people on the team and being like, oh, well, they're probably in their minds doing monad composition or, you know, some other fancy thing. And really all they're doing is counting lines, but you don't know until you're at that level. And so it can feel intimidating at that point. I think it's totally fine to have like very, very simple heuristics. I'm curious about at what point is giving a name to like a concept?
And, you know, I've definitely talked about this before, but I'm trying to think sometimes, you know, you start introducing intermediate developers to names of concepts and that feels really scary and overwhelming when really it is something that they've already been doing or like don't quite need to remember. It's like, you know, you don't need to remember the vocabulary for all of these different patterns. Like it's fine to just do it. If it's a pattern that you're sort of, you just encounter over and over, maybe you have an intuition around it. And to yourself, you just recognize, oh yeah, it's that thing where we have a wrapper object or something like that. That can be fine. The naming becomes valuable when you're talking to other people. And sometimes it can also be really helpful to cement something in your mind.
So if you've seen a similar pattern show up in three or four places and you have a vague intuition, they're all kind of the same. But then somebody shows up and like gives you a name to tie to those four places. All of a sudden, the fact that they're all doing the same thing is going to come into like really sharp focus where it was all kind of hazy before. Yeah. Where it's sometimes overwhelming is where you just drop a bunch of names and sort of nomenclature up front. They're like, wait, what is a factory again? What is a flywheel? And then it's really overwhelming. So I'm a fan of adding names after the fact rather than up front. I like that. Or I think maybe most importantly is showing an example.
Because these things are so abstract, like for someone who is trying to wrap their head around them for the first time, I think most people aren't able to just like think that way immediately. And so one thing I've been trying to do is if I am kind of using a technique in my PRs, leaving a little like annotated, annotating comment saying like, oh, like, you know, trying out this pattern, give a link to a resource. I think there's like that refactoringguru.com. It's like refactoringguru, one of those two. It has like a little raccoon guy and has a bunch of like little cute illustrations. So that I think has been a really helpful way.
to, I don't know, even if someone just like emoji responds, like a thumbs up to that comment, I'm like, cool, like maybe it'll integrate, they're absorbing this information and might be able to make a connection later on. I was also thinking about another point in my learning journey that it was not so much about design patterns, but I think could be applicable here is when I was trying to get better at testing and Stefa Carey actually asked me, do you feel like you've read really good tests? And I'm like, probably not because I couldn't, I just couldn't think of ever reading tests and be like, oh yeah, that makes total sense to me. But in the same way that, you know, I mentioned, oh, like when you are seeing some code or you've written some code, that's like, oh, something's not quite right. The opposite is also true. It's like when you read some code, that's like, wow, that is totally, like that totally clicks for me immediately. You know, in the same way, like starting to figure out like some heuristics around that, like what about it is it that I'm able to just understand very easily. So I think.
Yeah, like finding good examples and kind of being able to collect those for people who are trying to learn those concepts, I feel like is also sometimes a really great thing that a more senior developer can do to help someone in that space. I love that. Both the like capturing snippets of code that you really like and then taking the time to try to articulate why is it that I like this? What is it that's really nice can really help. We talked a few weeks ago about active versus passive learning and that next step of not just, oh, I like this chunk of code, but understanding why. What is it that makes it nice to work with as opposed to a different approach to doing the same thing?
Yeah. And I also think there's something really powerful about doing it with the code you're working in every day in your actual like work code, as opposed to just kind of a maybe more contrived example in a book, because it is a little more realistic. And hopefully you have enough familiarity with it that, you know, you're not having to stretch your brain in other ways too much. It's like also just helping you be able to pattern match a little bit more in your in future work that you do at your job. I'd like to pitch another sort of very concrete solution to getting better at this. And that is becoming more involved in code review. And I know that can be really intimidating as a intermediate or even junior developer to be reviewing.
code for more senior people. But I think the whole team benefits when you do that. And that's a really tremendous opportunity for growth. Yeah, that's a really great suggestion. What kinds of things are you thinking? What are some ways to level up how you're engaging in code review? Number one, don't be afraid to ask questions. You see a pattern or something you don't understand, ask what is happening here. Or maybe you see a thing and you understand it, but you don't really know what the purpose of it is. It's totally fine to ask why. What is the motivation behind this? Why do we structure it this way? It can also be a sort of a next level once you start.
noticing certain patterns and things, you can ask for confirmation. So you can see a thing and say, oh, I'm not super familiar with patterns, but it looks like we're doing some kind of decorator here. Is that right? And then maybe it's like, oh, well, it's kind of like a decorator, but we're doing like a variation on this thing where we're doing this presenter pattern. And that's like a decorator, but not quite. And here's a link to an article. And now like you've got a little bit of a boost because you correctly identified something, but also some nuance got brought up to you and you got an article to read. And so everybody wins there. Wow. Yeah. I really like that a lot. Like asking for confirmation because that requires.
you to kind of push yourself a little bit to figure out what's going on. I like that a lot. But the challenging thing there, though, is that you have to ask questions and you have to be okay not trying to feel like you know everything or not trying to hide the fact that you don't know everything. So it requires a certain level of vulnerability that I think is important if you're going to learn. And sadly, not all work environments are conducive to that. There's somewhere that's just survival requires you to do other things. Yeah, that's a really good point. But yeah, if you...
are able to share with your team, like, hey, like, I really want to learn, I'm actively learning this particular skill, like, help me do that. Or like, just so you know, like, I'll be asking questions on your PRs. I really think that can be so effective. Because like I said, it's so hard to do on your own. Because yeah, you just are kind of operating from that lack of knowledge. And it's hard to figure out like, how to get to that the next step. I think that's also a great opportunity to ask for a synchronous kind of walkthrough of the code as well. Because having an author of some code explain kind of the structure can be there's just so many more ways of understanding it beyond just kind of like,
the files changed in arbitrary order. So I think that is actually like talking through something is a really good way to talk about patterns, at least in my experience. It does some of that nuance of like the trade-offs and kind of those characteristics of the problem kind of emerge from just a more casual conversation about it. And ideally, good code review is something that's modeled by the more senior members of the team. Ideally, it's more sort of question answer based than it is just orders coming down from the top.
And if your team doesn't have great practices around code review, like the BlogBotBot's code review guides, various teams have different guides that outline different practices for code reviews. But if yours doesn't, this is a great place to start. So I have one last kind of little topic related, which was in talking about patterns with this developer I've been working with. She asked me, what if you don't agree? And I love that question because that's so real. And it's part of the job, I think. I don't know. Do you have any initial reactions to that?
What is the context here? Is this getting feedback, like a suggestion for a change, and thinking that you don't like that suggestion? Or where's the disagreement coming in? Right. A disagreement about a pattern or an approach. So this is where a little bit of team policy will go. ThoughtBot's guidelines say that final decisions rest with the author of the request, or of the original code, because we tend to work in a much more peer collaborative environment. Some companies will be set up so that someone higher up can just tell you, you have to change this, no choice. Anyway, you want to work in a way that's collaborative with your team as well. So if your team is...
going with a broader pattern or approach, you don't want to do only the changes you make follow a different style just because that's your preference. Maybe your team has decided to use RSpec for testing, but you're a big fan of Minitest, and so you stubbornly insist on using Minitest for any work that you do, and the other 10 people on your team are all using RSpec. That's kind of silly. So there's some amount of people should respect you as the original author if a disagreement occurs, but at the same time, you want to have code that's cohesive with what the rest of the team is writing. Right, because I think that cohesion...
can really help with understanding. At the same time, I also want to kind of point out, because this was true for me, that blindly following patterns also does not help you learn why they're being used. And I, for a long time, feel like I didn't have the confidence to say, like, when I had a preference or not, because I just didn't, I didn't know. And so when she asked that question, like, what happens if you disagree? I really liked it because that in some ways means that, like, you're able to critically engage enough to have an opinion about it. And, you know, you might not always kind of have your way be the way that's agreed upon. But yeah, like just...
kind of following other people's heuristics may not necessarily help you succeed in being able to collect those patterns for yourself, right? And apply them when you are running into a problem and kind of having a hard time figuring out like, oh, like this, actually this pattern isn't working for me, but do I still just use the one that I think I'm supposed to be using? I guess before sort of all those other things, the first thing is having a conversation. And again, if you're getting suggestion on code review saying, hey, what if you use this pattern? And you're like, oh, I disagree, but I guess I'm just going to do it. That's not the optimal situation. If you feel like you disagree, maybe then that's an opportunity for a follow-up comment or...
oftentimes it's a question of trade-offs. And so then it can be, okay, let's talk about the trade-offs. Here's what I see as the trade-offs. And here's what I'm optimizing for, which leads me to think this would be better. What do you see? And then you can have it back and forth of like, oh, well, we have a different set of trade-offs that we're working on. Or maybe I think we should be optimizing for X, but actually based off our project goals, we should actually be optimizing for Y. And so with that sort of wrong foundation, I was picking the wrong pattern. And so that can help me change my mind. It can help the reviewer change their mind. But just starting by having that conversation, you're going to learn either way coming out of it. So don't be afraid to start with a follow-up comment. Someone leaves a...
a suggestion and you can sort of follow up on it and say, oh, what about this? Or did you consider this? Or here's the things I was considering and here's why I was leaning that way. And that can then be the start of a really productive conversation instead of just being conflict. Yeah. Or even like, I don't know how to do that. Can we try it together? And I've certainly gone through the process where, you know, maybe I got a suggestion from someone more experienced than me and I tried it. It didn't quite work. And so then I loop them in on it. I'm like, hey, can you look at this with me and figure out like, is it something I'm not doing quite right? And, you know, maybe it turns out, like you said, we were optimizing for something different or they thought that the goal was something different.
Being able to have all of those things on the table and seeing them, I think, is really fruitful in making those connections. And then now you know, right? And maybe you'll find a use case where that pattern is a better fit. Honestly, that's the most fun part of software for me is just the trying stuff and seeing how it goes. And I've learned much more to embrace that in recent years, I think, of just trying stuff out and kind of leaning more into that intuition. And hopefully it also resonates with other people when they review my code. But if not, that's totally fine, too. Let's figure out something else that does.
I guess that's, again, a very important thing is being honest with yourself about the why you disagree. Even if you choose not to have the conversation, it's what is it that I think is different here? Why do I like one choice over the other? And sometimes it might be as simple as I've never used this other technique and uncertainty scares me. Or I'm afraid that it's going to take me a lot of time and I need to ship this feature this week. And those are legitimate things to consider. And then you can look at solutions. But maybe it's not like a technical objection. Maybe it's a personal one. Oh, my hot take is that more often than not, it is one of those latter two things that like.
I haven't, this is new to me. And so it kind of scares me a little bit or I just, I don't have time. And it's so tough when people kind of obfuscate that information and try to use, you know, more technical arguments or like, or just kind of try to push something on someone regardless without really giving like a good reason. And I think that leads to confusion, honestly. Like it doesn't help, especially people who are on their learning journeys, right? When those things are kind of conflated with other types of explanations or reasonings behind something. The flip side of that is knowing when something is good enough.
And you don't need to apply more patterns to it. There are some people that just love to sort of get code to a really kind of perfect place. And there's a point where that's no longer worth it. So knowing when to call that, that sort of requires experience and some heuristics of its own. But sometimes you get feedback and it's like, you know what? That is great feedback. Yes, it would marginally improve the code. And also for the amount of work that it's going to be, that's not worth it. And I'm choosing not to follow that here.
Cool. Well, thank you for having this conversation with me. I feel really strongly about like this particular growth area and it being just something that we as an industry are not very good at supporting people and getting from kind of that A to B. And yeah, I kind of just wish there was more content out there for, especially like on the job, like how to teach abstractions and design patterns, because that's really, I think, the kind of big distinction from someone who is able to just execute to someone who's able to think about those things and kind of be a steward for the team's code. On that note, shall we wrap up? Let's wrap up.
Show notes for this episode can be found at bikeshed.thoughtbot.com. If you enjoyed listening, one really easy way to support the show is to leave us a quick rating or even a review in iTunes. It really helps other folks find the show. If you have any feedback or questions, you can reach us at hosts at bikeshed.fm via email. Thank you so much for listening to The Bike Shed, and we'll see you next week. Bye!