Laravel Worldwide Meetup - Go Ahead. Rewrite Your Codebase.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Music] [Music] you [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] he [Music] [Music] and we're live we did it hello world hello laral world my name is Dan seela I'm a developer at vehicle and myself along with my co-host Margaret and a cast of many of the vehicle team are thrilled to be able to bring you the return of the laravel worldwide meet up speaking of my co-host Margaret how's it going today pretty good Dan it's an exciting day to bring back the um laral worldwide Meetup we're very excited to be here so thank you so much been a part of laral community since about when I went to my first LaRon back in 2017 and I've always been such a great fan so it's an absolute honor to be one of the co-hosts so excited to be here same same this is this is great and we uh we're going to do our best here at the vehicle team we have some big shoes to fill taking over the tradition that Frank started hosting the laral world Meetup so uh Frank vanderton once again thank you so much for everything you do for the laral worldwide uh Meetup and the laral community in general and uh we we hope to do you proud in hosting this meet up and with that we uh today we have a a very special guest who doesn't need a lot of an introduction to the Lille community and I know there's a lot of people uh really excited to hear uh hear Caleb speak but before that we just have a a few things we want to go over sort of some Community related stuff right Margaret yeah for sure so uh anyone that's new to the lville community or anyone that's been in larel Community for a little while so this might be a little reminder but if you want to find some really great work um you can always go to Lara jobs so go to lar jobs.com and find some great laral work if you're looking for some you're looking to hire or looking looking for a job there's a lot of great resources on there and then next we have Lille news so this they have a great podcast as well as a Weekly Newsletter that does go out so if you want to stay up to date with what's going on in laral community please go to llne news.com and then we have another great podcast so um sorry the last podcast so that's also hosted by Jacob Bennett and Michael Dinda this podcast uh this season Matt Sofer will be hosting and then he also has Taylor otwell uh for this season as well so if you want to go check out what they're up to and what they're going to be talking about make sure to headit up laral podcast.com and then next week we got a pretty exciting event so LaRon EU uh with Keno he's G to be um hosting so very excited if you want to find more information about what's going on with lar conu it's going to be happening Amsterdam and you can check out the website l.u just around the corner and LaRon us has been announced so we'll see you in Dallas Texas this year so that's going to be the end of August again for more information please go to larac con. us lot of great talented hosts um speaking of hosts we want to thank vehicle for being our host for the laral worldwide Meetup so um big thanks to them and if you're they have a really great team of developers so if you have a larel problem um and they be they love to help you out so please check them out at vehicle.com or you can hit them up at go vehicle.com and with that we are going to start to segue into our speaker today the the reason that we are all here like I said uh this this man doesn't need a ton of introduction the Lille Community but we're going to do it anyway Mr Caleb porio creator of laravel Livewire and Alpine JS uh you might be can also find them in recent uh recent times on podcast such as no plans to merge and notes on work also the the author of The ebook make vs code not suck and a person that I was first introduced to through the the lville news podcast as the string King for all his contributions to the larel code base and string helpers um and there he is and most importantly I find that uh this man is nearest and dear to my heart because he introduced himself to me as an honorary Canadian due to his origins in Buffalo New York Kaleb how's it going on it's going uh so great a um thanks for having me yep you know I don't have hoser yet um but but I do actually say a few Canadian isms but it's much more my lifestyle that resonates Canada so that that means then that we we both pretend to like Tim Horton's coffee right yeah well I mean I actually do but uh because I'm a real Canadian me too um it but it it's like everybody knows it stinks but it's it's good you know I don't know yeah it's Comfort it's the cream everybody says it's the cream that's the line it's like oh it's the cream everybody's addicted to it's this like syrup of fat and sugar and makes it so good good so how's it been going Caleb what's what you been up to recently it's going great I'm in uh sunny Florida um and uh it's sunny but it's cold which is a bummer but I'm I'm just working on live wire and stuff you know so if I remember back I saw you speak at LaRon us last summer and I think that was You released the latest version of liveware at that point is that correct yes and how's how's that how's that how's the follow-up been from the release how's that been going great I honestly feel like this is the first time since releasing it that things are like stable and now we can just start like honing it and adding things and whatever and we're not just putting out fires um but yeah it's it's been awesome I was just like we're going to talk about rewriting liveware you know because I did that um and I have no regrets it went really well and it's like boosted you know adoption in a big way so I don't know a rewrite success story if you will rewrites they're always a good idea awesome cool so what's the what format do you have for your talk you have some slides to share how do you want to do this yeah I got slides I'll just share my screen and I'll just ramble along with these slides that don't make a lot of sense and we're not going to do this this isn't going to be structured it's not going to be well thought out this is this is just spew you know so as I spew um people like hanging out think of stuff to ask Dan and Margot or whatever I mean you guys just Talk Amongst yourselves but um we'll do like a Q&A section at the end like I'm hoping to do like a pretty sizable let's all talk about why rewrites are awesome or terrible little round table discussion if you will okay so that was kind of one of my questions did you want us to interject with questions or maybe try to compile them and yeah whatever feels right follow your heart D all right all right whatever feels right cool uh anything else we're missing there Margaret no I think uh everyone's ready to get this thing going and hear what Kayla has to say so all right so let's try this technology Caleb you want to try to share your screen and then we'll kind of hand off to you and then Margo uh Margaret and I will step off stage uh but if you get in any trouble the uh the code word is tippytoe and we'll come back in we'll help you out it's all good we're all in this together right all right there we go there we go I can I can seeing some screen setion screen setion um okay I'm gonna miss the chat thanks all for hanging out in the chat um but uh okay let me get this slide thing here go there we go I SL there we go all right I can see can you see slides oh wait wait I gotta get I got to get that actually an O to my favorite movie of all time right there favorite movie yeah nice I only saw it because I'm a big Cohen Brothers fan so it's not my favorite movie but they're like my favorite directors and this it's so I love it because of that the dude the Dude abides all right well anything else you need here Caleb we'll we'll step out your wave all right well uh looking forward to it we'll uh we'll step off stage if you need anythingit I got a Tippy Toe here quick is there any way for me to see my face well I I guess seeing my screen probably not uh we can on the stream we will all see your face so yeah you'll see my face I won't see my face so just tell me if like there's like a booger or anything that I need to address you you look all clear man I think your the Farmers rap bits are off your face after breakfast this morning good that's right okay all right we'll step off stage if you need us let us know and we'll we'll see you shortly sounds good yeah all right hello everybody and welcome to the laravel worldwide Meetup we're going to talk about rewriting code bases today something that is always a good idea and if you're considering it definitely do it you don't even need this talk to convince you um but that's what I'm here to do is convince you to rewrite it and also convince you to not this is actually one big bait and switch you're G to see it's gonna be fun um so I was thinking about what to talk about and like I could talk about Live Wire and Alpine but I always talk about those things now and it's fun to talk about programming just general program pramming so I tweeted out and Jeffrey was like tell me about rewriting your stuff like how did that go and I thought that's a fun topic and it's a fun topic because I think it applies to everybody and as I've been reflecting on my career thinking like every place I've worked at I've either been involved in a rewrite or they just did a rewrite or they're planning a rewrite it's just kind of this thing that I think is so core to the experience of just being a working Dev that there's so much to talk about so we're going to talk about everything in programming as well as rewriting stuff so big bad rewrite this one's for the Legacy coders yeah so you the Legacy coder you work you work in a job and you hate your life because the codebase you work in is old and crusty and you go to fix something and there's a million Tangled things everywhere and you don't know how to find anything and things are scattered and you're working in bootstrap like two or you're working in your front- end build uses webpack zero and your local Dev environment uses like vagrant or like Homestead or something or some Trend that hit five like seven years ago and you started writing the thing maybe it's not even in laravel maybe it's in codeigniter maybe it's not even in PHP maybe it's in another language like net or something um whatever you live this life where you work in a codebase that doesn't reflect your interests and the interests of people at conferences and on Twitter and stuff so it just doesn't feel great and then you go to these conferences and you feel out and you talk to people and you're like that all sounds cool but you know I spend my days not working in the latest and greatest so I can't even talk to you about that thing or somebody launches something awesome and you're like I can't even use that awesome thing because I'm working in this thing and the only way to use that awesome thing is to pick up a bunch of side stuff or like do side projects that you know and abandon your your family and loved ones after work hours um so it's a hard life it's a hard life that you live and that is the developer experience of the Legacy coder and that's who we're here to address first let's define legacy what do I mean by Legacy I think it's a super broad term that people use Loosely so I'm going to Define it in super broad terms Loosely I think Legacy means any code you resent yeah it's old code yeah it's stuff that uses I don't know antiquate Antiquated Technologies and is messy or something but really my definition of legacy is the code that you resent which honestly is is like the code you wrote yesterday like we're always writing Legacy code you know um but yeah if you resent your code it's Legacy and that's the stuff that we're here to rewrite so I kind of touched on this before but the developer condition to me you know I was just sort of reflecting on there's The Human Condition you know us as humans but then there's the developer condition I think what captures rewrites I think capture uh a lot about the developer condition and this is this is big part of life as a developer is this scene right here like take a look at this it's beautiful there's sun coming in it's Serene it's minimal it's Ikea focused and you come if you came to your desk like to work that day you would feel great about the work you're doing and you would feel inspired and you're starting from a clean slate and this is what you want to feel like when you're working in a codebase you want to open up your Editor to start a feature and you want it to feel like this beautiful and clean and inspiring but unfortunately we live in the real world and you show up at desk to write some feature in that Legacy codebase and you really end up feeling like this and this is an actual picture that I took of my desk like Circa you know 2008 working on a legacy code base pea bottles everywhere cigarette butts everywhere yop play yogurt right next to the Heinekens this this was me at one point um but really I think this perfectly captures that feeling of of the opposite of that it's like you're working in the doll drum and yeah you resent the code base so I think that really for me development is really oscillating between these two states and it's always reaching for this that's why we rewrite that's why we pull open a new Branch even just whatever anything we do we want to exist in this space this is why it's fun to make new stuff and try new stuff because you capture this feeling where this is the feeling of resentment of mess of Cru of legacy of time and worn keyboard so yeah rewrites they're great let's talk about why rewrites are great because well a they give you that feeling of succulents on your desk instead of bottles of PE so why else are they great they're you know you get to use modern tech that's the obvious one is like you're working in some old Tech you want to use the new thing so you rewrite your code base and then you can use all the new things you're you have a blank canvas and you can wave your magic wand and just go it's a really fun freeing feeling to like sit back and think if I could start this over from scratch what tools would I use that's a beautiful thing and consistency over time you know constraints get thrown at you with deadlines and you your codebase becomes inconsistent developers switch out different Trends come and go teams switch out there's just things that happen that that almost any like Long Live codebase is inconsistent in some way whether it's the patterns or the code styling or whatever and rewriting it you get to start fresh and make it consist consistent and this is a really big one for me one of the probably the biggest value of a codebase rewrite is expressing Concepts that are lying dormant in your code base and what do I mean by that so when you start a project you start with the you know basic models and tables and things you need to accomplish the goal and it's obvious if you're writing a to-do app there's a to-do model you know but then as as features get added or constraints as like life goes on there's little conditionals that get added around there's a new little database column where does that go it could go here it could go there there's a new little you know Loop here Loop there a job that gets fired this thing's kind of related to that but not does this need a new model or should it just be in the same model blah blah blah there's all these little things and there's not a clear answer at the time there's no way to have Clarity so you do your best little by little but over time patterns start to emerge you go to do something else and you go oh hey the thing I'm doing has the same shape as things I've done in the past and by shape I mean similar nesting and conditionals and dependencies on different parts of the codebase and you start to recognize these similarities and these are the the concepts that emerge in a codebase these are emergent Concepts and a rewrite allows you to sit down and identify what are the the concepts lying dormant in your codebase that we can unearth give a name give an actual file to an actual test an actual systematic description of and then bake into the cannon of our codebase like that's a really important thing about the about rewrites that's the most important thing for me writing Live Wire and Alpine uh was was exactly that to unearth the concepts that have been lying dormant for so long so let me tell you about the Livewire and the Alpine rewrite so both of these took the Alpine codebase is a lot smaller and the rewrite was a lot shorter but it still took me like a year and mind you this is also because I don't have a manager so it's just me managing me which means stuff just takes longer because I just spin my wheels um the Live Wire one I I ended up rewriting it three times and the third one I was just like I just have to stick to it I'm not going to find the Golden Goose I got as close as I could get but even that it took me a year and a half is like a conservative estimate for how long rewriting Live Wire took so that's uh if you're going to take something away it's that rewrites just take forever um but let me show you a little bit of the differences in the code bases between Live Wire and Alpine before and after after the rewrite so here's Alpine 2 y so like I said Alpine 2 is a really it was a really simple code base like there wasn't a ton there it's it's gotten a lot bigger there's a lot more going on but I didn't know how to write a front-end framework like how do you write a front-end framework I just started writing one but over time I had to learn all of these things as I went and just like I said before it just things get a little crufty and messy so this is I think the the thing that I hated most about this code the thing that I resented most was this component.js file that just contained way too much like all sorts of stuff like look at this oh this is i1 only for some stupid thing who even knows and it's stuck in the the component.js file I couldn't even tell you what membrane is I don't even know what membrane is what does that even represent I have no idea so this line this like file just goes on forever and there's all like this is the god file it's basically what I'm saying it's the god file of the code based merged it just did way too much and it this is one of the things that kind of pushed me to doing a rewrite um so this is live War v3's code base and one thing there's actually no component.js file because there's no component in live wirers core when I was like sitting there thinking about all this I was realizing that there is no such thing as a component in Alpine it was really a junk drawer for everything else in Alpine you have X data is about the closest you come so I rewrote it it's so much cleaner like look at this it's just beautiful come in here and I just feel great about it I don't resent this codebase at all which means it is not a legacy codebase and there's lots of individual files that do very individual specific things and like look at this these directives here so every single directive in Alpine has its own file and they're all registered here and I could take any chunk of these and comment them out and everything else would still work Alpine would work except those directives wouldn't work but everything else would down to even X data which before was like core inside Livewire or sorry inside inside Alpine so anyway I'm here to say I rewrote the thing I une some Concepts I'm really happy I did um and I don't regret it at all uh so Livewire version two is a very similar story there's another the funny thing is there's another God class that is the component uh component index like in Livewire 2 that's this file it's huge it's bulky it does everything and I hated it and I needed to figure out how to tangle how to detangle all that stuff and it wasn't easy it took a long time but now liveware 3's codebase is so streamlined the component JS file is really small it does just what it needs to do it's really well scoped and here's something that I think is important to show you I know that you don't you know maintain like an open source project like this you're probably more in a normal larel app but every feature in liveo now has its own folder so you pick on any given feature like form objects and everything to do with form objects in exists in this folder folder I could delete this folder and then I'd have to remove it you know its call from the service provider but everything else in liveware would still work except that feature even the tests live in that folder browser tests unit tests they all live right there which is so freeing and it takes a little bit of you know it's not easy to get to this point to allow the core to to do something like this but once you do it's so freeing and I feel like anytime I create a new feature I get that feeling of a new code base itself because I'm starting from a blank canvas and it feels clean and I'm not like sprinkling a little bit of that feature over here and then a little bit of that feature over here it's just all condensed into one file or folder and we're going to talk more about this because you can actually do this in your laral apps and Jeffrey is doing a course right now on modular laral apps okay so that's the live where and Alpine rewrite I just wanted to show you some of the nuts and bolts um but it was a great decision I totally don't regret it we're going to talk more about this but um the reason that it was such a good idea for me or one thing that I think is important to note is I'm My Own Boss so I can do whatever I want even if it's not in the best interest of my business and in some cases that is true um where you might not necessarily be in that position and you're beholden to other people and so you might not be able to do that I understand that um I also am able to just hurt the business for a year or two you know because it's worth it to me because I have to work in this codebase I need to love the code base like that's I need to if I'm going to work in this thing every day I need to love it and that's really why I rewrote it um and then the other point is some point that I had that I totally forgot so let's move on they're not great okay this is the bait and switch rewrites are actually pretty horrible most of the time and you shouldn't do them most of the time says Tony the Tiger the new system so I was thinking about I was at like Hobby Lobby the other week and buying like a piece of cardboard and they couldn't check me out for some reason and they're like scanning it and the lady's like really annoyed and she's like it's the new system and I was like that's perfect because that this is this captures all the negativity about rewrites this captures um why they're a bad idea how many times have you heard somebody say that oh it's the new system oh we got to learn the new system oh this is just super slow it's a new system I don't know the new system yet oh the new system we have to do this thing well we can't do that because it's in the new system or whatever it's like so I don't know the new system that's why they stink because yeah like Management's trying to get us to use the new system but really what new system means is we don't know it it's worse and people tell us we need to learn it even though we already know how to use the other thing and we're mad about it you know like come on right um okay another thing they take forever this is why rewrites are not great they take way longer than you thought and then even longer than that so if you're going to budget time for it budget I don't know five times as much time that you think you need and they take so long that by the time they're done it's like they're already a legacy codebase there's 10 more tools that you should be using by the time they're finished so yeah because it's a big ask okay business people don't don't get the internals of development stuff you in that Legacy codebase you're living in squalor you feel that way you feel the cobwebs and the spiders coming down in the bottles of pee on your desk but it's this weird thing where because we're in the virtual world a business person who's interacting with your thing because really because you're working in an internal system when a business person is is interacting with your tool they're using a UI that works fine and is designed well and they go I don't understand why this is so bad to you and I don't also I don't see why you want me to take this massive money hit for this long period of time so that we can get back to where where we are right now like why does this make sense there's no point in this so even getting stakeholders business folks product people to get on board with a rewrite requires a so much trust from their end like I've thought about this so many times business people are out on a limb with developers because they have to tr there has to be that trust relationship there has to be this good relationship between software devs and product people where like but really it's like you as the developer know that like they're out on a limb and we're not always that trustworthy because we don't always make the most sound decisions on like I definitely am way too clever often times I'm way too chasy chasing shiny new objects a lot of times like they're out on a limb so I feel bad for them that they have to deal with us at all but I think that's a big thing with rewrites um all right so here's a here's a bad rewrite in the wild the liveware and Alpine rewrite those are great you know good shining reviews this is not a good rewrite so I'm a part of this boat club um so we travel a lot and rather than owning a boat I can just it's basically like a country club you pay a fee and I I could find a dock like anywhere and just go on and make a reservation and get a boat out for the day super fun actually really cool so if that interests you go sign up for Freedom Boat Club because I'm about to trash them or at least their app so this is this is their app when I signed up like a year or two ago it is uh old feeling like there's that striped background that's kind of weird but it's it looks like responsible you know you know what it does everything is orderly and you can tell that a professional designed this well at one point probably 10 years ago it's a little old looking but it works so this is good enough but let me tell you specifically why this is annoying it's good in every other way but if I need to make a boat reservation this is I need to go look to see if there's reservations available all right I can't just search in uh Florida you know whatever I have to go through these drop- down menus you can see that one right here so like location I have to go and click my country first which is like what there's like three countries available here and they're mostly the US okay United States okay now I got to pick a State scroll down and pick Florida okay now I look at the docs they don't even say where they are they just show a ton of docs I click through them then I go to the reservation I click the date I'm looking for and then okay you you're tracking me here I did all that work and now I want to see a different date to see if there's the same stuff available on a different date I go to do that and it wiped everything and I have to go back and click United States again and it frustrates the crap out of me so you're following me here right they did a big rewrite this past year this is the new rewrite this is the new system it stinks and here's the thing it looks like junk I'm so sorry I'm being so so mean to them I've written I I'll tell you about my own faux PA in a second to make this go down a little easier but here's like my first complaint why do rewrites always use full width like it's like we always go from a nice constrained layout to full width layouts that are just sprawling and there's like so much space and it's not consistent you don't know where stuff is it just looks janky and the worst part about the rewrite is it has all the same problems that it did before I it's like literally just like a react interface that mirrors what the bad old interface did so when I go to change a date I have to still go back at whatever so it didn't even solve the problem and this is a huge bummer um yeah and and that's that's Freedom Boat Club so but I I've done stuff like this like when I started in development like 10 years ago or more one of the first projects I did I worked for company and they had this site that a they' hired a design agency years ago to make this this really good-look site at the time an expression engine was really well done they paid like 30 or 40 Grand so then I come in and they're like we want to modernize a site I'm like no problem we're going to use WordPress there's a bunch of cool plugins for WordPress we can even buy a cool theme it's going to cost you like nothing and we did we did the whole thing and we rewrote it and I think it looks actually very similar to the difference between freedom Bo Club pre- write and after rewrite I just made it worse basically by modernizing it which really means like full width huge like WordPress Carousel thing with pixelated images and it's like 50 megabytes to load the page and oh my gosh I made their lives worse because I rewrote the whole system um yeah so again rewrites are no good and that's why this talk is a big bait and switch and really the best thing to do is avoid the rewrite altogether we'll talk about actually doing a rewrite but I think the most important valuable thing to talk about here is how to avoid having to rewrite your entire code base those are the interesting things that we really should focus on simple cells Simplicity uh so I just read this tweet from somebody today it was like H I don't even remember who sorry for not giving you credit it was like sell Simplicity instead of features or something like that like stop adding new features because you think that that's what you need to like sell your product start simplifying stuff or offering you know simple features whatever and I thought this is pretty true like I use fathom analytics um yeah and it like Jack Ellis and uh Paul Jarvis I think is his name they it's their app and it's like a Google analytics alternative um and I use them and I love them and I thought about why do I use fathom why did I switch from Google analytics I switched because it's simpler I actually don't want all those features there's so many features in Google analytics it's overwhelming to me so fathom analytics is like a breath of fresh air it's like oh yeah I really only care like knowing how many people are on the site you know when I launch something or if there's a spike or who visits the most Pages whatever I don't need to like track you and where you went after you left work or whatever you know so Simplicity cells and this goes for like everything this is the most V Simplicity goes against the nature of the Curious developer you know because complexity uh I don't know I hate just saying like Don't Be Clever we all want to be clever but it is really true like to actually achieve Simplicity you have to make sacrifices you have to sacrifice functionality and you have to sacrifice like yeah scope and things like that you want to make the system as robust as possible and you know that one little Edge we need to make sure that it accounts for that but having a simple system is so much more valuable and it's really difficult but it'll pay dividends and it'll like the anti-s Simplicity is maybe what got you needing to do a rewrite in the first place um yeah only real music's going to last use lasting tools uh here's a code base from eight years ago that it's called screen it it's this little like hack project I did um at a job a while ago and I made this larel app and I haven't touched it in eight years the last commit is eight years ago and if you went in this app it's actually not that different from an app I would write today it uses pretty much the same stuff there's like the user model inside the app directory with fillable and hidden and casts and I have controllers and blade files and a routes file and it looks very similar and I thought that is so cool that a technology that I chose eight years ago and that was actually I'd already been working at the company for two years using laravel so like 10 years ago the apps that I was writing and the tech decisions I made for using laravel is still a good decision how awesome is that even the like project structure is very similar I think Taylor does an incredible job at making us feel like we live in a fresh new clean world but keeping it consistent so that your 10 old codebase doesn't feel that old which is crazy I watched a talk at one point I forget who it was I'm so sorry I should give better credit but it's like it had it was this wheel of progress like you know those evolutionary Wheels it was kind of like that and it was like the core was like really system Hardware level stuff and then as it went out it it it went out to like front Endy stuff and it showed like the pace of movement and how it just gets faster and faster and faster as you get farther away from the core and that is so true that the front just moves so much faster than the back end like a front end framework just moves way faster than laravel and then uh you know a pattern in that front end framework or a library for that pattern in that front end framework moves like so Lightning Fast um so I think this is actually a good argument for using backend oriented tools and keeping things simple like the blade I used eight years ago I can still use um and even if I use liveware I can still use all that blade um so yeah basically choosing tools at last and how do you the best way to know if a tool is going to last is if it's already been around for a while so betting on new stuff as a guy who was once in that position of creating new stuff and is my stuff is relatively new it's like I get it I want people to use new stuff but in reality if you're G to like have to live with this code base for a good while make sure something stands the test of time and has like good monetary backing behind it is it funded um just people care about this is there community support for it blah blah blah whatever only real tools are going to last all that other BS is here today and gone toor oh stick to the status quo um yeah using conventions is like the the the married couple to uh using lasting tools basically like stick to controllers and models and stuff I don't actually use controllers stick to your live wi components and your request objects and your models and stick to those basic patterns and jobs and whatever those conventions in laravel because as soon as you diverge from those and you solve something in a clever way that might seem logical at the time that's a big opportunity to resent your code base it might be brilliant but most of the times where I've done something like that I've it's really just been a point of resentment and I always I admire looking at like Taylor's code bases if you look at any of like jet stream or something look at these code bases they're very simple like there are not if you're hungry for like brilliant patterns I don't think you're going to find them there you'll find the Brilliance in the minutia but in general the patterns are very happy path simple laravel like controllers and me really just making small methods and naming them well I think is the most secret sauce you need in programming um but yeah stick to the status quo okay removability this is actually I'm going to contradict myself a little bit but I showed you in in liveware that features thing with all those folders you can remove one of those and liveware still works and that's a beautiful thing to me and and not even just that but removing chunks of code or a method if you're writing your code with removability in mind mind this is insurance against resenting your codebase because you have an escape hatch and you can back out of something so much more easily or rewrite that part of your code base um so re removing things is really awesome in your laravel app how do you do that and I think you really like my my most fundamental like Principle as a developer is this I call it like the single file principle but just keeping related stuff together call it whatever you want but if you can keep it in one single file do it if it needs to be a folder fine but if you can keep everything related to some thing in one folder so that when you need to remove that thing you just unplug it and everything else works that is a beautiful thing especially if your tests live right next to it and again you're in a larl app here's where I contradict myself because laravel isn't set up to group things by domain or feature it's set up to group things by function like there's controllers and models not post and then controller and then model you know um but Jeffrey so I said jeffre is doing this course I think there's kind of be like a growing sentiment so here's a trend you can hop on board and resent in five 5 years modularizing your codebase so that if there's a big you know feature or part of your codebase put it in a folder where the controllers are inside that folder and the tests are in that folder and your models are in that folder and lar but don't like don't you know don't go pie in the sky and reinvent like so that you have all of the laravel microcosm in one folder and blah blah blah whatever I think jeffre course does a really good job of keeping it still canonical conventional laravel but modularizing it a little bit um and then doing that allows you to do isolated refactoring so I just refactored the request system in the live wire codebase and this was something that I I almost was like I got to do this in the next version of Livewire I can't do this in this version because it doesn't support it um okay so yeah so I kept all the stuff related to sending a network request in Live Wire in one file and I needed to like bust it all open and do way more complicated things and I thought I might just have to wait for V4 but because I wrote it in this modular way I was able to do an isolated refactor where I unplugged the current setup and just rewrote everything from scratch I just deleted that file and rewrote it from scratch so I didn't like inherit all the Badness of the last thing and so now it's in this clean request folder it used to be one file and now it's like got all these Concepts but it's still isolated um yeah look at me bragging about code all right accountabil buddies this is really important um a huge part of preventing rewrites is having a a culture of accountability at your company and what I mean by that is you're going to write better code when someone's looking over your shoulders just a fact like when I'm par programming I actually don't love par programming but it always makes my code better like it even if even if you're not like combining two brains to be brilliant and come up with like really awesome Solutions the value of par programming is a warm body is watching me and I'm not just going to flub stuff or skip stuff or make take shortcuts or whatever I'm going to like dive deep and solve stuff properly and well and pull request like code reviews I think go hand inand with this super important uh for companies to do that kind of thing or have that culture internally because it just ensures that quality over time because if it's just up to me to always be consistent and dependable and make good decisions and blah blah blah it's just it's not always going to stick um because yeah whatever I'm not a good programmer I need people staring down my throat uh okay you have no idea how high I can fly is uh the words of Michael Scott this is an interesting bit but here's the thing you can quit your job if you don't want if if you're pushing for a rewrite if you hate your codebase that you're working in and you got all these ideas and you feel like you're swimming Upstream from everybody else on your team and there's people who are okay with it or whatever or business is always pushing back and you're like disgruntled just quit go find a new job there are other jobs that use the stacks that you want to use and your life's just going to be happier and it's no harm no fall so this is actually something that I've learned throughout my career that I really value is you don't have to stay at a job forever and you don't have to change yourself to be happy at that job or change the job for you to be happy you can just find a different environment and if you change your environment you might find that a lot of problems just vanish and don't even need to be solved um so yeah if you hate your codebase and you're like really mad that you're not allowed to rewrite it just quit your job no problem all right okay all that has been convincing you not to rewrite it and I know I like I was like hyping up in the comments like burn it all down like rewrite all the stuff um but if okay we're going to rewrite the thing let's talk about actually doing the rewrite Caleb come on uh first testing is so unbelievably huge so unbelievably huge if I go to Alpine's codebase and npm run Cyprus and it's going to take a second but I'll I'll ramble while it's taking a second I can run acceptance tests for all of Alpine so if I need to rewrite Alpine I can literally just trash everything and rewrite it and use this exact same test Suite because it doesn't care about the internals at all it literally just like if I hit this it just opens up a browser and it just runs code in a browser Clickety clackety stuff as if I paid somebody to just sit there and do this all day so watching these test runs is just such a beautiful thing to me because it's such insurance that everything works properly and with a live where rewrite this is going to just be like acceptance test ASMR here I'm just going to leave that running while I talk when I rewrote Livewire oh no there's a failure what is happening Alpine's broken I swear this all runs well um okay so Live Wire when I rewrote Live Wire I carried over the test suite and uh just it's still in a folder called Legacy tests and we've been you know pulling them out of there but there's still a folder that if I rewrite the whole thing and this folder passes this thing works like I can tell you pretty with good amount of certain that this thing works and it's also like a to-do list of when you're doing the rewrite of just getting all the test to pass you know that's huge so even if you don't have a good testing setup uh start adding one I don't know make that the first step before the rewrite is writing all the acceptance tests even if they're not automated tests maybe they're handwritten tests for somebody to run write out the test scenarios before you do the rewrite rewrite for the trash I think this one is is really important and cool I did a lar cast series called called building Alpine from scratch and then I did one for Live Wire building live wire from scratch where I just cre created Created like a a very simple working version of Alpine just from an index.html file from scratch just from first principles to see like what is the core the Beating Heart of this tool and I did that with liveo and when I did that with liveo for lar casts I I hit on a bunch of Concepts like snapshots and things that I took over with me into the rewrite it was such a good opportunity to set aside all the complexity for a minute and really just think about the core essential stuff and just have that opportunity but the important thing here is that I wrote code with intent to trash it and you can do this branches are really cheap you can take out a branch repos are cheap you can do you could take a week maybe do don't try to sell people on a rewrite sell people on taking two weeks to attempt a proof of concept for a rewrite and see if it's better and how far you get you know yeah deadlines super important you need deadlines unfortunately and you're going to bust through them but you still need them yeah I don't know it's pretty self-explanatory this is one you got to stay strong H you're going to get far in this rewrite and there's going to be so many times when to get that final test to pass you're like this is why the codebase sucked because this stuff is hard and I have this little clean microcosm of a rewrite and now I have to destroy all the cleanliness with all these conditionals to make this thing work for this one feature stay strong see if you can ax that feature see if you can isolate it see if you can one area we did this was eloquent model support in liveware version 3 we didn't want to break everybody's apps but we also wanted to do something new that was better internally what we ended up doing was creating a folder called Legacy model support or whatever and literally it's like the V2 stuff is in this folder and you can feature flag it on in the config so that we're not like screwing over all our users but we don't have to live with that in our lives you know I've done this in a few places but there's Temptations at times like you rewrite this perfect thing and you're about to just send it all to hell because because you're actually you're like there's a reason that this stuff is really complex and hard because yeah like whatever stay strong roll out strategies so you do all that you do the rewrite what's your strategy for rolling it out you have three options the first is the cut over the traditional rewrite the thing in the background set a date cut over tons of problems with this there's some nice stuff with this the nice thing is it's you really can start from scratch and you can keep everything separate um but the actual cut over is often way too late and really hard to pull off that Freedom Boat Club thing I was telling you about that was months and months and like they transferred me over to the new system I had to call and get that done and then only half the docks were on the new system so I went to like make a reservation they're like oh that Doc's not on the new system you have to call them and talk to them so cutovers are tough for a million and one reasons um I'm not saying it's the worst thing but it's the worst of the three options I think the Strangler figs this is actually a term I learned about after tweeting about rewrites this is I I would call this like the Frankenstein apps where you basically either create a separate app and like have a load balancer sifting requests for certain endpoints to that to that separate application you might share sessions between the two apps you might even share databases but it's this way of kind of like seeding a new code and eventually wrapping up the old one and then just consuming it till it disappears and it's a reference Martin Fowler came up with this term when he was in Australia it's a reference to the Strangler fig tree in Australia where like a tree or the Strangler fig plant there's a tree and then this the Fig plant like the seed hatches seeds hatch at the top of the leaves and then it like grows down even into the roots until it kills the tree and then like it is the tree now um so that's I think a decent strategy for a rewrite I when I was at Titan they had an app that did this I'm sure Matt would love to tell you about it he's actually a great one to talk to about this pattern because they had a a codeigniter app that they turn into a larl app slowly over time and I forget if they put codeigniter inside of laravel or laravel inside of codeigniter but it was literally like two apps where one was just shrinking over time the biggest con of this is this can drag on for so long and sometimes never be finished and that isn't a great feeling and then you're just working in a Frankenstein app that feels weird here is the best option that I think personally if you can pull it off the one more thing option the brand new version so for me this is what I did it's liveware version three there's new documentation there's new everything it's like a new product and base camp does this Bas Camp one two three maybe even four now um AOL discs did this new versions of software and when you when you start fresh with a new version then launch that as a separate version I think what Bas Camp did is really cool they keep the other apps going but then they put all the improvements into the new app and they Market this and this is the thing that represents is the best representation of everything they know up to this point but they don't have to like force everybody along for that Journey they can just iterate on the application I think it's brilliant and here's actually the best part about this you get all the benefits of the cut over you get your own little isolated world you don't have to deal with like a legacy database schema or whatever you get all those benefits but the normal con of the cut over of it being like really hard to trans people over that's gone because people can just stay on the old app and use the new app or and not use the new app but the real power is this can make business sense and this is the biggest thing I want to leave you with is when I did that live wire rewrite it made business sense I look back and it has helped Livewire immensely because V3 shipped with a bunch of features that people were dying for so it was me releasing something that people wanted to use and attracted more people and if you look at like all the analytics you can just see like this is live version one and then two comes out it's like bam boost then it's like kind of riding that wave and then this is three it's like boom to the moon so for me this was a really good business move and maybe it is for you maybe there's a way to pitch your rewrite as a new version of something and that's a whole new marketing opportunity so this way you can kind of align that business thing with the tech thing um and I just wrote reverse reverse and this is to I don't even know if you get any of these references but this is cuz I thought reverse reverse like the chaa slide and then I Google Images a picture of people doing the chaa like a girl um but I said reverse because I think it goes in reverse order this is the best second best worst okay and let's talk about it that's it that's rewrites should you do them should you not I don't know you tell me let's talk about it hit me with the q's and the A's and yeah all right all right we got some uh some questions here for you okay first one uh we have from pratique he wants to know web RTC is it possible with Live Wire oh this is gonna be a live wi Q&A I'm here for it whatever um is it possible it is possible I've thought about it I thought like how cool would that be like a chat app or something that you're actually just peerto peer chatting for people that don't know what web RTC is it's like right it's like peer-to-peer streams of data without going to a server um it's like how you can stream video and stuff I don't know thought thought it'd be cool maybe someday yeah cool I had a question Caleb uh you mentioned uh rewriting um Livewire and specifically talked about rewriting something multiple times and yeah I I assume then that means that at some point you did a rewrite and you got to some juncture you're like this isn't feeling good or this is right so what what was that indication for you that made you think oh I'm going to start again because this isn't going the path I wanted to yeah um I mean ultimately it's just sense you know just like you would just sense that things aren't going in the right direction but it's really when it's when you start to add it it's really that period of when you start to add back in the real constraints and then everything falls apart it's like ah this pattern I was chasing that was going to solve all my problems is starting to crumble um and I'm starting to having to just do the thing I did before where I just sprinkle stuff all over the place so um yeah I don't know that's a great question I wish I had a better answer but I think you just know you know and you're just like ah this isn't what I wanted I wanted a better life and this isn't a better life yeah that totally resonated with you where you said it just the new thing ends up looking so much like the old thing if you're not careful keep an eye on it right it's so tough and I all those edge cases that that lead to that generally that's why the new version concept is great because you can actually change requirements you can like go back on features you can actually say you can undo a yes you know like no is temporary yes is forever you can actually make yes not forever so yeah I do think it was a really great point you made about like who who ultimately owns the app in some way right and I think like for yourself as the as the maintainer and the owner of the library or for someone like dhh in base camp it's easier for dhh to make that decision as a as a co-owner of that company versus you know someone like myself who might be doing you know contract work uh with with a client right like there's very different considerations there obviously totally I think Adam's doing a Tailwind rewrite or at least messing with one at least according to Twitter and I it's he tweeted something like I think dhh actually responded him like totally like owning something is awesome because you can just make the worst business decision ever and rewrite the whole thing for fun and it's it's true that's a perk owning um somebody did ask in the chat will the video be available later most certainly um I did have another question related to um when you talked about like test coverage it's obviously super important this is a question I find myself asking a lot is and I don't have a great answer how do I how do I know that I have enough tests to give myself some confidence that now is the time for the rewrite or now I can rewrite with some confidence did you run into any strategies there question how do you know that you have enough tests yeah I mean test coverage can go so far right but it doesn't necessarily cover all your bases right and I think a lot it's such a tough challenge to recreate the new thing and cover all of those edge cases which hope you have covered in test yeah and never missed some right so yeah there's no good answer there in a perfect world you started with a test culture and like for Live Wire I mean we just test everything we make new stuff but there's a a really hard and fast rule that almost never is broken that if there's and this is common in a lot of apps but when a bug is reported it starts with a failing test every bug starts with a failing test no bug gets fixed without a test that if you change it revert that code the test fails You Pull It in the test passes and because we've done that for so long we have this gnarly test weite that takes forever but man I feel like if the test weite passes liveware freaking works like so I guess it's just a sense that you develop um by really using it to your benefit for so long I guess I don't know and it's almost like and if I break something that a test like doesn't capture it's like I don't know we tried to capture everything if it broke it's it's like uh I don't must not be that big of a deal then we'll add a test later I don't know so that's probably wish I had a better answer that's probably true don't know yep but there is also some bravado like there is a a certain amount of like we just launch something that is a little broken because it'll fix itself in the wild if you get some willing customers to you know test it out beta test or whatever like things iron out themselves pretty quickly when everybody freaks out and tells you it's all broken you know and I think that's a really good point too is like how how how important is this thing or how used is this thing right true uh you know if you have a a very highly used application that's making a lot of money then that's something you want to be much more careful about than hey I could launch this thing and worst case two people are going to have a bad day right and they can work through those problems right so yeah I think really having good Insight some analytics like you mentioned too into like how are people using this how many people are using this what are the most critical paths that people are using in this application because those are the things that whatever strategy you choose you want to make sure you get right definitely in the time um another question here we're going to show this comment on the screen because we got ability um so the question is how would you justify re rewrites or even refactoring to stakeholders or clients that are always looking for the next new fature to ship yeah it's tough It's that problem um this is the best answer I can give is is um package up uh a make it a win-win package up a feature in the rewrite or something um make it make it so that it makes sense for them them too you go like like what is the thing that you want that we can't do because of our Tech stack right now or that's going to take us forever like this rewrite will let us do that thing or we're going to rewrite it with that first you want AI in your tagline we're gonna give you AI I don't know like I think that's a good way to do it but yeah uh stakeholders are out on a limb because and a lot of times and that's why I put that slide in there about quitting because sometimes they're right and you're wrong sometimes you just want to use new stuff and it doesn't make sense and you should that should just be full of devs who are happy to use that old thing and you should quit honestly so I don't know I do agree with what you said there Caleb I think the the incremental approach is always especially when dealing with clients and it's like can we do this in a way that's going to give you clients some value but also allows us to improve the code as we go so I think probably a full rewrite at that point is tough but refactoring like that should almost be like just baked into the cake so to speak with our process over time right and so you know I think there's a lot of analogies you can draw between software development and say something like working or building a house right and I think this is this is one of them here it's like hey you want me to put in this sink and this this uh this this countertop here but this is probably while I'm doing that a good time to move where this valve's located or something like that right so maybe not exactly what they wanted but making this change is going to make this thing easier and then maybe make things in the future easier which can be part of the the sell to the client as well right it's that culture it's like I mean there's so many places that don't have a good Dev culture a good like Dev product culture because I mean it you need somebody like going to bat for you to product people ideally not yourself that's protecting you and that there's a culture of refactoring and code quality so that it prevents the scenario where somebody else comes in who cuts Corners who's really fast and then product people go like hey that person can do that in a day why do you take a week you get the axe you know it's like that is such a tricky trap um and I think it all goes down to culture which all goes goes back to like leadership and the climate and just making sure that people are really educated at The Perils of like poorly maintained software and moving too fast without doing things well and and that's in my experience that's such a tough one because of like the the lack of the the the tangibility of software itself right and kind of again drawing that analogy to like construction if if a plumber comes into my house and does a really poor job and they leave and like that there's water dripping off the pipe I don't need to be an experienced plumber to know that they haven't done a good job they've probably cut a corner right and maybe that's why they were $1,000 dollar less than their competitors versus with software it's it's such so much if you're not a technical person of any nature it's it's so much more not tangible and hard to grasp you like like you said that the simplest thing to look at is like well this person was able to produce the feature in a day why did you take a week and a half that's a that's a real tough explanation sometimes and then there's like some stuff doesn't matter like some stuff don't waste your time writing tests it doesn't matter like I don't have tests for the liveo or doc site at all because it's not that complicated of an app and I'd spend more time writing it than it even benefits me to do M um so I don't even do it and there's so many projects that like like Peter levels he's out there bouncing on like an index.php file making millions laughing at us because we have code quality standards you know I don't know it's like there's it's there's no nothing's easy no nothing's clear the concept of test goes to me goes always back to just like Assurance right giving yourself some personal Assurance as best you can that the thing's working and doing what you want it to do right so I think in in the example of of your doc site there like yeah it's not super important that I have lowl unit tests that test certain things or what text is displayed maybe what's important is I set up like you know a ping every hour just to make sure this I have a a bug tracker is like that's if if a bug ships I'll learn about it in within a day and I'll fix it and it's there not that complicated but yeah but like live whereare a complicated system a big app it's like I need that test Suite is my is the life blood like literally is the most it's more valuable than the code itself to me yeah yeah absolutely um so just quickly interjecting here with a question about I think has said do we ask questions here so yeah if you have a question make sure to put in the chat and then we'll filter through and select some different questions I know there's a lot of different Live Wire questions here too but one other question to kind of add in here because I've seen it happen a couple times let's just say if you refactor a lot U I guess how exactly was uh if you're refactoring constantly do you even need a rewrite I guess I know that's yeah ideally not and I think like just to reiterate the point that I am I think the biggest Point i' want to drive home is do everything besides a rewrite like that you can possibly do before you do a rewrite like I I sold this talk it was like a little bit bait and switch and I'm just whatever having fun but in reality like do everything besides the rewrite first and yeah so having culture of refactoring all those things that my whole like section on avoiding the rewrite I think there's a lot of ways to ensure that your application does need to be Rewritten that the first Alpine and the first Live Wire iteration I felt like they needed to be Rewritten like few months after after they were written and I lived with that for a while um but these rewrites I I feel like they're not legacy because I don't resent them that's what it is do you resent your code base like if you can keep it to a point where you don't resent it and how do you saave off that renion is like tests and and refactoring and code quality and taking time to care for things and keeping things consistent and clean yeah is that your uh definition of uh Legacy code I did really enjoy that code you resent I just yeah I I uh that is my definition I was familiar with I think Michael feather's definition was like code without Tess I I like yours even better Caleb yeah code you resent is Legacy code yeah if you love it squeaky clean I think there there is totally something there to you know you get into the rewrite that's that's a huge undertaking and and I think in my experience most often it's it's not the entire app that as a developer is giving me those pain points right there's there's C certain areas right you've always probably been on a project be like oh we got to go into the user controller to this is going to be a nightmare right and so again I'm use these analogies a lot but but the whole kind of construction analogy I think of it like maybe I'm living in a house and I'm not over overall happy with some things in my house the plumbing the layout the lighting etc etc I could just tear the whole thing down and that's going to be a huge undertaking I'm gonna have to find a place to live right but maybe instead I could start with like what are the things that really pay me the most well I don't know I spend a lot of time in my kitchen and the lighting's not great yeah and I'll just focus on that first how can I make the lighting better in my kitchen and then and then you you know rinse wash and repeat and you move on to the next thing and over time all of a sudden you're like this house isn't so bad I didn't need to build a whole new house this was probably cheaper and and got me to where I wanted to go at the same time the house is a good example because there's always that uh yeah you could add on the addition but at that cost you might as well move because you're not going to capture all the value of that addition when you go to sell it like you're going to capture like 70% or something so so if you just move you get all that without you know whatever that's kind of besides the point but the point being that there's 's always that like when does it make sense to just move or do the rewrite you know and with like something to your point if you refactor your kitchen with good lighting um it'll make you feel like you know those pictures I put like that developer experience of like the minimal and then the really shitty space it's like that to me really is everything and it's like it's funny how I can feel like I have bottles of pee on my desk and then I fix like one thing or I like refactor like one file and it feels like everything's beautiful and clean and the sun is shining instead of like the world falling down inhaling acid rain on me it's it's so funny how you can flip so easily so that's another point to like see if you don't have to rewrite it like maybe you just clean up the kitchen add a skylight and now you're like oh this is great I love this place you know absolutely I love the house an allogy too sometimes you see like those big oversized trucks still carrying the house tank in other place where maybe it just Seas to just rebuild that would be maybe I know true right when they like literally take up entire houses it's like insane to me that you can even do that it's like what that's possible anything's possible anything is possible I had a question I saw in the chat here um and it was kind of sim something similar on my mind and it relates to like you mentioned deadlines Caleb and the question here is like how did you manage to to get to V3 release for Live Wire did did you have to put your any additional pressure on yourself or the question also mentions like did did was tweeting about the fact that you're going to release this thing at LaRon was that the extra motivation you need how did how did you manage especially working for yourself how did you manage getting to that release date and and keeping up with that deadline yeah uh so I did the thing that we do where I like set a date and then blew right past it set another date blew right past it told people that date blew past it fortunately I'm getting pretty good at not telling everybody my lies but I still let him slip and I did let it slip a few times and and then like I remember like Taylor would ask me about it and like so he was kind of my I I let him be my boss in a way CU he was like so and I'd be like all right like I don't want to totally just like tell him something that I can't stick to and then I would tell him something and try to stick to it and then still blow past it but Lan was the final like it's gonna happen it's going to ship whether I like it or not and I did have to make concessions um I didn't pull in all the tests I kept them in a legacy folder that I told you about there's things that I did f file uploading code is all the original V2 file uploading codes there were things that I was like I can't make it to this Finish Line as beautifully and as perfect as I want because I can't just be here forever so we got to ship yeah gotta go absolutely gotta go absolutely Gotta Do It um I did do you have something right now Margo I don't know if you had a question I have one if you don't at the moment uh go for it D yeah the another thing you mentioned like the three different strategies of like cut over uh the Strangler pattern and then like the one more thing which highlighted some of the uh advantages to the one more thing approach yeah my question was have you is there any challenges that are introduced with that approach and you know at a high level I think well if I'm rewriting I'm eventually only going to be maintaining one thing whereas with the one more thing approach now I have V1 to maintain and V2 to maintain and V3 to maintain and does that introduce any challenges yeah you're right that there is it's not like when you're in a yeah thank you when you're when you're yeah oh God they got them right if you uh yeah like if the alternative is you have an evergreen code Bas and there is something singular and nice about that um but in my experience the old stuff I wonder what base camp folks would say and I know I think they actually have like people dedicated fulltime to the old stuff but more people are going to use the new stuff than the old stuff and it's just going to get more and more like that over time so there's going to be fewer bug reports and and it's like I don't know at least for Live Wire and Alpine it hasn't been that big of a deal to me I wonder what Taylor would say as well because he has to maintain old versions as well um but it's like kind of not that often that I have to like back merge something to 2.x like I pretty much treat it like if somebody comes to me and says there's this actual thing broken in 2.x here's a fix for it I'll merge it and I'll tag it but if it's just a fix in V3 I don't like think is this a problem in V2 and that because it's such a different code base so but you're right that is totally a con of the the total new thing but honestly if you do the new thing I bet you won't regret it in that way you might regret in other ways but not that way and I think that goes back to the control thing if it's if it's your business if you're base camp you know you could also uh incentivize your users in different ways to to move from V2 to V3 if that's ultimately where you want them to wind up right yeah if all your attention's there people are going to go where your attention is yeah they don't want to hang out I did wonder do they suffer from any of that you know if if I'm a developer and and I have to work on the V1 code base all the time right do I resent that code or not I don't know yeah you need that's the thing I didn't mention that do developers who are somehow immune to like code resentment you just find those people that just like sling tickets all day and don't even care like this is my job I feel like I've worked every place I've worked there's been like that one person who just is like happy to do it don't really care about like new stuff yeah people find challenges in different things right send me the tickets yeah is that you know I enjoy being in older messy code bases and that challenge of trying to understand it keep it running add enhancements make it a little bit better when I can right and I think there's definitely people well thank people that's not me that's you're doing the Lord Lord's work that's my we're not the same I hate that I mean I I enjoy a new Green Field code base as much as there it's a good muscle to flex but for me that's what it is it's like a discipline I always need to develop where there people like you and Matt staer says the same thing it's like good for you yeah thank you all right what else we got here Margo I'm just looking through the chat here um um okay let's see here we have we can switch it up a little bit still rewi question but question is doesn't have to be by the way you could just do it if people are dying for the live I really don't care anything we got we got lots queued up but this one here is H are there any new design ideas you've implemented when rewriting the code base that you would recommend like code design Caleb Caleb good name nice it's not often I meet one of those are there any new design ideas you implemented when rewriting the code base that you would recommend I think you mean code design obviously um recommend like patterns and stuff yeah I think that's kind of the nature of the question yeah yeah uh just have really good tests and honestly the single file principle that's the only pattern I basically care about in programming is like keep related stuff into a single file or a single folder that you can remove and remove that whole thing and make your methods small and well- named that's like the only programming advice that I think matters to me kind of yeah okay yeah um and I thought too but the uh again going back to the the the approaches to a rewrite and specifically the Strangler fig pattern which I think makes a lot of sense right and then it's like anything it depends there's trade-offs to every approach right yeah um and I think one we were talking a little bit last week about this too but I think one of the challenges introduced to that I'm just curious you have any experience with this Caleb is if I'm working for a client that's constantly shipping new features and we're in the midst of a rewrite yeah how can we ensure that not only that we're building to fature parody for you know the day we started the project but over the course of that as new features get added to the original thing how can I make sure that I have feature parody in the new thing right that's brutal you just you just beg them to not yeah to add new features I don't know just no new feature freeze I that sucks um that's a big con of that it really exists with any of the rewrite approaches except the the new that's another Pro of the one more time approach is like not one more time what is it one more thing um the one more thing approach is like the that huge benefit of of the new stuff just gets added to the new thing and not the old thing it just makes the new thing more marketable it makes business more happy and eager for you to launch the new thing you know it's like yeah tough tough tough Margo's back we she'll be back um I had a question about um the uh we talked about um not fighting the framework um and specifically uh well maybe not that specifically but the my question is in in regards to like approaches that you've encountered to be able to avoid maybe the necessary the necess necessity or maybe even the feeling that I need to rewrite in the future right and I think specifically you talked about modularity you talked about Jeffrey's course and you said I think in uh was it Alpine uh youve you've kind of moved to more of like a modular structure a little bit yeah both of them but live way pretty extreme yeah um I guess like is is is that a takeaway for you and and do you have any other approaches that you've picked up to like if I keep this in mind while I'm writing this new thing in the future I'm I'm less likely to to resent my code yeah it's really [Music] um it yeah for me the patterns I don't know if they apply to Applications as well as they apply to like package type systems stuff that's fair but the two patterns that have that I've doubled down on and I have no regrets is first that modular pattern of keeping things modular and really isolated but the thing that that needs is an event system that those hook into because they need ways to hook into different parts of the life cycle um they can't just live on an island something has to call that code somewhere they have to be in the pipeline um and a really lightweight event system like I have in live Wares core I just literally have like a function called trigger it's just like a function you say trigger a string and then data that you pass it then anywhere else in the codebase you just say on and then that string and then a call back that gets that stuff that really basic thing it's like an event system introduces IND direction to your code base you can't follow code execution anymore because there's that that disconnect where it's like the trigger happens but then what are all the listeners you know that's the huge trade-off and I don't know if it's always worth it for codebases but for my application is so worth it and I'm really glad I made that trade-off of direct yeah indirection so yeah yeah I think that's a really really great point you make about the what is the code itself is it a library uh that's used by millions of people is it an application that's been around for 20 years anywhere in between right that definitely matters a lot yeah absolutely welcome back Margaret thank you thank you look into the chat and I'm seeing uh not quite on the topic of uh of rewriting but there are a few uh questions that are on the same topic um and I'll show one of them here but uh you debuted some Livewire Dev tools at larcon and there are some people in the chat Caleb wondering when that's something oh yeah I meant to to like talk about this um so I think I might let this be a failed promise I I have like a a um and this hearing about this is the first time anybody's hearing about this I haven't talked about this at all I may attempt to resolve it but basically I've always like bragged about how like I take forever to do stuff but I do the stuff you know I don't like say I'm going to do something and then not do it I just take two years longer this could still be that but I might abandon ship on this one because it's the least valuable place to put my time right now and if that's so clear to me that the only reason I would be doing it is to fulfill you know I mean I feel bad because I was definitely like showed a pretty much finished product on stage and was like you can have this and now I'm just going to rip it out so uh I'm really sorry to say that I'm currently not working on it and I have been saying that it's like the next thing I'll work on but I'm a liar I think developers are just liars because you just have such high hopes for yourself and then reality sets in so I'm a liar that's that's all right we won't hold it against you and I think maybe there's an opportunity there for some uh some Community Support right you uh yeah and there actually is a community Dev tools that Marcel uh maintains but um yeah maybe I mean maybe I should release to the wild the version I have is yeah I we'll have to figure that out I don't know it's I I want to maintain if the maintenance burden wasn't so huge and if the it would it's just going to be it's tough It's a tough project and it's like gonna take so much Daniel holds it against me it's gonna can I we swear are we allowed to swear on I don't know I don't know we might not be allowed to swear on this you didn't tell me we'll take care of it and post oh all right um well I think this has been there's been a lot of uh involvement in the chat and discussion here and I want to ultimately be respectful of your time Caleb so maybe uh Margo I don't know if we have maybe one or two more questions we could we could field here and then uh and then kind of wind down our discussion after that yeah for sure I'm just looking because there's a lot of great questions here and a lot of them could consist of a very long answer but looking at more of the shorter questions um try to Rapid Fire I'll try not to do the the ramble thing okay cool um so sticking to the the rewrite topic um so how about not a full rewrite rather incrementally rewrite bits of the code base every now and then I think we largely talked about that right you should do that yep yeah very much that's the correct answer correct um and then them are kind of specific so this one's about Live Wire fine someone specifically asked you said live V3 is a lot better but will you rewrite V4 from scratch again hell no hopefully never I'm sorry heck no um hopefully never no I love the code base it's going to be the same code base for a while yep okay awesome all right so those are two quick questions um we'll kind of maybe play around with what we're going to do with these other questions but thank you so much Caleb I think we have uh we a very formal thank you but thank you for being our very first inaugural speaker so great time thanks for hang out everybody certainly I could speak for Margaret and myself a lot of nerves on our side being the you know first time hosting this and wanting to do the Lille Community proud and definitely very easy to have a such a a friendly guest as yourself and knowledgeable guest Caleb so thank you so much for joining us and sharing your insights and I know a lot of people really enjoyed it well you guys you guys are the best I'm super glad that this has been rehabilitated and uh especially with the likeness of uh you know you find vehicle folks absolutely it's going to be great awesome well thank you very much Caleb we'll uh we'll bid you du and send you on your day enjoy the the hopefully sunny weather in Florida and uh we will talk to you soon all right all right take care have a great day chat is unhinged see you all right bye all right well there we have it thanks again Caleb for joining and thanks for everyone for uh for tuning in and participating in the chat uh very much appreciated and feels really great to get our first uh addition in the the resumption here of the the worldwide Meetup under our belts here right Margaret that's right so thank you everybody for tuning and we have a couple more announcements for you so if you're staying please please listen up for some future announcements that we got going on so we have a monthly Meetup we're very excited to welcome Jo when will the monthly Meetup take place Margaret so this will be happening on the last Tuesday of February so to be absolutely certain about what that date exactly is and that's what we're going to try to aim to do for every Meetup have it the last Tuesday um we're going to be doing it on February 27th at 12m so same time we're trying to also figure out the best time that we can get everyone worldwide um to be able to tune in and again we will have this video posted on the laravel YouTube channel under the live section so make sure to check that out um if you can't make our next one but we're gonna have at least one or two speakers so yes our next one we'll have Joel Claremont he's gonna be talking about life beyond DD so very excited to have him thank you so much Joel and also Koo as well so not exactly sure if keko has a his talk planned yet but we have Keno's M musics for now but stay tuned um for their talk next month and then to stay connected to make sure you have that reminder make sure to go to meet up. lal.com sign up for the reminders you'll get an email reminder about the event and you'll also stay tuned for any other news that we have going on absolutely awesome and with that I think we we're about wrapped up here Margaret we did it we made it to the finish line here any uh parting thoughts for the community here before we sign off thank you so much for being such a great Community m very excited to be a part of this and to see where this goes so thank you so much everybody thank you again super stoked to be uh have this Meetup resurrected and we uh we hope to do the Lille Community proud so thank you very much for tuning in and we'll see you at the end of February bye now
Info
Channel: Laravel
Views: 14,933
Rating: undefined out of 5
Keywords:
Id: 5cdYaQbzgHE
Channel Id: undefined
Length: 81min 9sec (4869 seconds)
Published: Tue Jan 30 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.