Remote Ruby

Embracing Simplicity in Code: Smart Home Automation, Ruby Upgrades, and the Future of Rails

January 26, 2024 Jason Charnes, Chris Oliver, Andrew Mason Episode 255
Remote Ruby
Embracing Simplicity in Code: Smart Home Automation, Ruby Upgrades, and the Future of Rails
Show Notes Transcript Chapter Markers

Ever wondered how the 'less is more' philosophy could revolutionize your coding practice? We're back with a treasure trove of insights on paring down to amp up performance and maintainability in your projects. Kicking things off, we share our experiences in decluttering codebases, inspired by the simplicity that Elon Musk champions. From the transition in Jumpstart to Hurrocons from Font Awesome to embracing Rails defaults for the sake of newbies, it's all about enhancing learning curves and reducing complexity. And if you've been juggling with the art of productivity, the Para method by Tiago Forte might just be your next audiobook binge!

Transforming your home with smart automation isn't just a futuristic fantasy; it's a present reality that we dive into, discussing the ease and efficiency that smart devices bring to day-to-day life. Imagine controlling your home's ambiance and utilities with a simple voice command or a programmed routine; we chat about the marvels of voice-activated LEDs, the convenience of Home Assistant, and my personal plunge into the world of 3D printing. But it's not all play; we get technical about the Ruby 3.0 upgrade and the fine points of a JIT compiler, revealing the mix of excitement and challenge that comes with innovation.

Lastly, let's talk about the future of database architecture and job processing in Ruby on Rails. The conversation includes the adaptability offered by feature flags, the strides of ActiveJob with Rails 7.1, and the refreshing simplicity of Sucker Punch. We're eagerly awaiting what Rails 8 will unveil, especially as we look back fondly at early MongoDB days and speculate on SQLite's potential. Join us as we share our trials, triumphs, and the thrilling future ahead for Rails enthusiasts and developers alike.

Speaker 1:

This is Remote Ruby. Have you any remote ideas to the meaning of the word? So let me just start with I haven't talked to you since last year, not even last year, like almost last fall.

Speaker 2:

Yeah, it was pretty much like our whirlwind recording sessions that two weeks after Rails World or whatever, and then we were just like let's take the rest of the year off, which was a great idea, because the year got crazy. But man, I missed you guys. Jason is not here today, but we miss him, Yep but I sent him some memes.

Speaker 1:

I have like instant and easy access to Jason. Right, I want to bother Jason. I just bother Jason, you know. But I'm like damn, I have like all this stuff that's happened and I haven't talked to Chris in so long.

Speaker 2:

That's almost like dude, I miss the floor. Yeah, I miss it very much, so good to be back. What has happened in the last?

Speaker 1:

two months. What hasn't happened in the last two months? Whoa Did you?

Speaker 2:

see DHH and Jason Fried tweeting about the Walter Isaacson book about Elon.

Speaker 1:

No, I don't necessarily read DHH tweets.

Speaker 2:

Yeah, I like Walter Isaacson's books anyways. They're like really good biographies or whatever. But something caught my eye in one of their tweets that was like they were reading the book and there mentioned something about how he was like managing all these projects and stuff. And I ended up reading that, listening to the audio book, going to and from daycare and I feel like the last two or three months, like since we kind of took our break from recording my like MO, has just been like delete stuff, simplify, get rid of gems, get rid of like everything features whatever. Yes, I have been on a relentless sort of thing and that's pretty much what the like book talks about with Elon, where he's just delete, delete, delete until you delete too much and you have to put back 10% and that's how you know that you've stripped it down to the bare bones because you went like a little too far and had to put stuff in because you broke things. I really like that.

Speaker 2:

Today I was just like you know what, when Jumpstart came out, hurrocons didn't exist, font Awesome was like the only good option. Zondacons from Steve Shogar existed, but I didn't have every icon we needed or whatever, but they looked a little more modern than those sort of like cartoony, look a lot Font Awesome. And so today somebody had pointed out the Font Awesome CDN was a bit slow or something with the JavaScript was kind of slow. It's not always, but I was like you know what do we even need that? Let's just get rid of it. So I went through and was like side quest Friday morning. Let's just go fight this dragon off on the side and delete it all the Zondacons, replaced them all with Hurrocons, just dropped the SVGs in line and that way we don't have to like read the file when we're rendering the views and then insert it in the HTML output and yada, yada.

Speaker 2:

So it's simpler and just all around much better Deleted like 300 lines of code or like net negative like 300 lines in the PR. And we've been doing that for the last three months and noticed version two I'm going to probably ship after this podcast and it's 1500 lines of code, simpler than before and it's like does more things and is just generally better all around. It's been like my thing, because I don't know if you felt this, but like his projects go on. They just kind of build up so much cruft and it's very easy to be like God damn it. We have to maintain all these stupid things because one person uses this feature or something in Podia or hatchbox or whatever it is. We can't kill it, or it feels like you can't kill it but you could.

Speaker 1:

So it's button exists right there, baby yeah.

Speaker 2:

So, man, I felt very much freer lately and also just kind of in jumpstart in general, like everybody has ideas that they want to see in the template. We have a stronger sort of line that we don't cross this line. Yesterday someone was like we should use you, you ideas, for every table, that way we don't expose a number of records or whatever. That was like we could do that. But every little step like this that we deviate from the rails defaults, the harder it is for people to learn the project and to use it and stuff. And you use ideas and they're not a magic bullet. So version seven might be, or you lids or whatever, but they're still not friendly and things like that, so they don't really fully complete solution to the problem. They like solve one thing, introduce complexity in another area, and I was like it's not good enough. No, we got to start saying that and even if it's the wrong answer, today we come back to it and just change our minds. That's okay. We put back those decisions Like it's not a big deal.

Speaker 1:

I've been feeling real good lately, just spring cleaning basically it's really hard for me with my ADHD to like really listen and not pre-plan what I'm already going to say. Going to admit to you the second you started talking.

Speaker 1:

I already knew what I was going to say and I'm still going to say it because I have got the next book for you. I haven't read a book in a long time. Until very recently, I read building a second brain and the Para method by Tiago Forte, and I figured out where iTunes stores all the audio books you download, or iBooks.

Speaker 2:

So I'm not going to be something, but I'll have to pick them up on audible, because I pretty much like only listen to books anymore, because I get too distracted. And then the only real time that I have to focus is like driving Jackson to school and back, and I don't have a commute anymore. So it's kind of rare, because I'm in the same way. I don't make it through much. I've heard the building a second brain book. For sure, I'm not sure about the second one, though.

Speaker 1:

Para method is the one that came out first and it describes like the same online framework.

Speaker 1:

Yeah, same author. Okay, I feel like for you the underlying framework. It's called Para P-A-R-A. It's an acronym for projects, areas, resources and archives. Based on what you just told me, you would get a lot out of that. Yeah, I won't go all into it right now, but I have been constantly archiving things because the whole system is look, if you're not using it right now for an active project, put it in the archive. It'll be there if you ever need it again. Right, just cleaning things up, man.

Speaker 2:

When we're at Rails world at the boroughs, talking with Adam Levin maybe it was on our podcast recorded, but he had talked about managing tail end and stuff, where it's like so many opinions being opened as issues and things and it's like ideas and whatever. And he was like, if it's a new feature, it's not an issue. We moved that to discussions, discussions, yeah, and I was like, oh, okay, so we went through like pay and notice and jumpstart and like every single repo of ours for the most part, and we're like, nope, that's a discussion, that's a Q&A Are you asking about maybe there's missing docs or something, but it's not an issue necessarily, it's Q&A sort of discussion or something. Handle request. Yeah, we're like ideas and whatever else and so, yeah, we've been doing that and it is like refreshing to go through that because, like, the issues really feel like a huge burden when I'm looking at them and I'm like, oh my God, and some of these are ideas that I want to keep around, but if I leave them as an issue, it just feels overwhelming and it sits there forever.

Speaker 2:

Build up this dread looking at the projects and I'm like this is just not good for my mental health and then also, like I know DHH and it is kind of notorious for the features they use or the ones they extract an open source, but they don't really care about most of the other things, like if active record was up to them it would probably just support my sequel or whatever they use. But that's been another thing where I've tried to embrace that a little bit more. Or it's like all the stuff that we actually Want to support because that's what we use. We will have very high polish on that and everything else will take second fiddle and that's fine, we're gonna just accept it. I used to be like very optimistic and oh, we could support that.

Speaker 2:

It wouldn't be that much work to support this other thing, this other payment processor that we don't use and it wasn't Until it becomes the maintenance burden the conditional implementation may have taken a day or something, but then it's like now you've committed to maintaining this for the rest of your life and Now I'm like you know what you want to add another payment processor to pay, make a plug-in, make a gem. Yeah, that depends on pay.

Speaker 1:

It's perfect, you know so I talked about that. I was like, dude, just make a. You guys should do is make a plug-in template Replay and just be like yeah oh, you want to add a thing, there you go.

Speaker 2:

We could totally do that just it's already pretty much there, built into the gem. Just delete the implementation stuff, yeah, rename the, the class or something, and you're good to go. But yeah, yeah, it's been freeing.

Speaker 1:

That's for sure. One thing from para that I've really started to embrace a lot more, that I didn't really understand when I first read the book, is difference between projects and areas. So For Tiago forte, a project is anything with a clear objective and a set end date. Area is something with no end date and ongoing. Basically. So like for me, my like open source projects, those aren't projects. In my like knowledge management system, those are areas. Because I do project like an issue, like taking care of an issue or doing like a support ticket for podium. That is what I make into a project. And just taking projects like this big idea and concept of them and making them as Atomic as possible, I mean, yeah, this is a tiny little project and now projects don't seem so overwhelming. It's like, well, I do projects in one day.

Speaker 2:

Now like I try to make projects only take a day yeah, because that's always been an issue with my Usage of any project management stuff, like we use base camp. But I would create a project for like jumpstart and it would just be this never-ending project. And I realized like jumpstart is not a project, it's an area, like you're saying and Introducing that concept in that area.

Speaker 2:

Yeah, and just like I didn't know that was a thing like a concept I needed to extract or whatever, and like now I understand it and it's like we make projects, we set our deadline, we have a clear end goal and we archive it. When we're done, we can always unarchive it, we can like add to it, remove from it, whatever, but they're like these cohesive things that we do and then they're done. That Really really helps. And it wasn't until like last year when I started to like do that. I always knew there was something missing and it that's why I was like never stuck to anything. But now, right, it really improved the way that I like wrap my head around it and it feels totally different now. And then just the same sort of thing.

Speaker 2:

If you have ideas, you might need to write some of them down or like detail out specific ones, but a lot of the ideas will always come back up.

Speaker 2:

So if they're like actually important, you don't need this like giant backlog of ideas because you're never gonna go through it like it's just not Practical or useful in any way.

Speaker 2:

So that was another thing that I used to do, where it was like, oh, just keep a backlog of ideas and then pull stuff out of that and make that a project that you work on, like no, the stuff that is relevant when you're working on it at least for me, is this is a recent issue that People have been talking about. Let's address it now and like just choose things in the moment, as opposed to like let's read through the backlog and whatever. Yeah, but you also need to balance that, I guess, with some sort of let's choose some things that are Recent and well, like if it's a recent feature or something, let's impress our customers by doing it real soon. Or you go the other way and say, like what are the projects with the best ROI? If we do this and invest in it now pays off the most. So you want it like probably a balance of both or whatever. But a the backlog deaf just was another drain on my mental health.

Speaker 1:

Yeah, I got rid of all backlogs. I started using the concept of an inbox, but then I switched it even more smaller. So now I use obsidian for note-taking for the most part. So when I open obsidian, it creates a note for that day and that's my inbox. I just yeah, I'm doing stuff. When I have an idea, when I have a thought, I just write it in there and at the end of the week or at the end of the day I might go through and like, oh well, I actually kind of wrote like a resource in here or like a standard operating procedure for how I do something, like I'll extract that new note, new resource, throw it's where it needs to be or put in the archive, and then taking out like content from my projects and from my like areas and Turning them into like resources that I can then link back to from other areas as well.

Speaker 2:

I was just thinking about how wild it is to like Automatically creating a thing for the day is something like Apple Notes doesn't do, but it's such an intuitive, like tiny little improvement the software can do for you.

Speaker 2:

That gets you in the right mindset of how to work or whatever. And then that's the stuff that I really really appreciate, like that Intuitiveness that you could go a little extra step, tiny little feature really to implement, but it like teaches people how to think about the product or whatever, and that's really cool. I feel like it's some blend of like designer and engineer kind of saying to think about those things. But I always like that stuff or like I don't write software Just because of they like writing algorithms all day, every day or whatever. I like building stuff that is intuitive, that people use and whatever those that when you mentioned that, I immediately was like light bulb. That's a great thing. That would like if Apple Notes did that, that would change the way I think about using Apple Notes, which is why I'm not like consistent with it or whatever when I do try to use it.

Speaker 1:

So you use iOS shortcut to do that.

Speaker 2:

Sure, like you gotta set it up and yeah, exactly, yeah there are a lot of apps that have it built in.

Speaker 1:

Note plan is a really good one, obsidian has it built in, but there's some plugins that enhance it. Craft Is really good with that idea. I really like that concept of like, where do I start? Like, where do I have a thought or something's in my head? I need to get it out quickly. Yeah, goes, like you can today belongs to today.

Speaker 2:

Yeah, the steps there are. Like it needs to get out as fast as and smoothly as possible and you can triage it later. You don't have to do it right away and like it'll always be searchable, so, like who cares exactly, triage it.

Speaker 1:

So yeah, and those are the some of the main concepts that Tiago forte talks about like you have search, you have quick switchers, like why do you need to like add in all this metadata into your things? Just really simplifying the process and like kind of simplifying the way you think about projects and your productivity.

Speaker 2:

Lately I went around the house and got some smart plugs and switches too. The other weekend I just turned off the power, went and replaced a bunch of switches in the house. Love the light. Controllable Is that. Which one? Is that the one on your wall?

Speaker 1:

Oh, it's on this, on this smart Switcher. It's got one, two, three, four, five buttons and each button has three different oh, like shortcuts for each. So if I hit like one button once, if I hit the middle button, it is one thing. If I hit it twice, it does something else. And then I hit three times, it does something else. And all five buttons have three actions each.

Speaker 2:

That's nice. Once we had Jackson like there will be so many times where I'm like I gotta put him to bed. I got to reach over there, reach up into the lampshade and turn off the stupid lamp and my hands are full already and whatever. And so so many of those things are as like I'm gonna buy one of those you know voice controlled switches, plug the lamp into that and then I will not ever have to deal with this again. I can't tell you how many times that's been useful. You have the shower fan and it's like I wanted to run, but I don't want it to run forever because I'm gonna forget to turn off the shower fan. So I bought a smart one and then just have it set up to like 40 minutes, 45 minutes or 30 minutes. After you turn it on, it'll shut itself off. That's okay, perfect. I don't need to fiddle with the humidity sensors and like tune that properly or whatever. It's just like easy yeah.

Speaker 1:

I can do some of that in shortcuts, like in the, because I use my like I home and home app and I have like you run home assistant yet no, but I 20. You say that I was literally looking last night what I need, because I have a Raspberry Pi 2 and that's not really helpful.

Speaker 2:

I Run on a Raspberry Pi 4.

Speaker 1:

I was literally looking at those last night. That's literally my Amazon search history, the.

Speaker 2:

Pi 5 is what you should get, and they are the 4 gig of RAM version. It what it wasn't stock like 20 minutes ago and you just missed out. I think it's now out of stock.

Speaker 1:

Nice.

Speaker 2:

I've been watching for those because they're like they just came out. They're super duper powerful compared to the 4s and It'll be an ideal thing to run, or actually you, if you want, you can actually buy a Device directly from the home assistant and that's probably that's thing to use. I Run that in my basement, connected to the router, and like have my Elgato lights. If it's 7 pm and my lights are still on and I forgot to turn them off, it'll go and turn them off for me.

Speaker 1:

Yeah, do that too.

Speaker 2:

All my cameras from ubiquity get fed into it. Garage doors, and well, no garage doors now, or not a thing anymore, because Chamberlain group or whatever it was like it's too expensive is their excuse to support a cloud service, which is nonsense.

Speaker 2:

Okay, whatever there's people now that have built little device to intercept their remotes and you could do it, control it locally on your network. But yeah, home assistant is wild. You can do so much with it. It is super cool.

Speaker 2:

Let's take a moment to thank our sponsor, honey badger. If you're like most developers, too much of your time gets sucked up with downtime issues, troubleshooting and error tracking. How can you spend more time shipping code and less time putting out fires, honey badgers? How? It's a suite of monitoring tools specifically for developers. It's the only system that combines air monitoring, uptime monitoring and cron and heartbeat monitoring into a clean, fast Interface. Sure, you can get familiar with any interface, but why waste your time learning some Franken system interface that looks like an airline cockpit when what you really need is clarity and speed? You won't know if honey badger will really save you time and trouble until you see how it works in your own tool chain.

Speaker 2:

With two lines of code in five minutes, you can see for yourself. Honey badger automatically hooks into popular web frameworks, job systems, authentication libraries and your front-end JavaScript magic and fixing errors before your users can even report them. That is a wonderful way to delight your customers. Five minutes of your time with the free trials. All it takes to see if it will work for you Just might be the best five minutes you've spent in a while. Check out honey, badgerio. Did I show you my home theater LEDs? Yeah, and they were done.

Speaker 1:

Yeah, I saw the. You posted the other day that they were like.

Speaker 2:

I saw I was like, wow, I'm done after like two years of sitting around. That was another project I did that that weekend was like I'm gonna go and like our bedroom has a fan and it's got a remote control, but like we only have one, so it's like I will need to turn it on or up or off or something, but I can't find the remote because it's in Brooks Nightstand drawer or something. And now it's like voice assistant Turn off the fan. And we do the same thing for that. So you can buy a little LED controller boards and like that light you have in your on the wall there. You can make those yourself or whatever, and use that open source firmware Called WLED, which is sweet but I mean, it's soldering iron, don't I now?

Speaker 2:

you can buy some stuff pre-installed. I'll send you. There's a guy in, I think, denmark that I bought my board from his websites Quinn led info or something and he sells little controllers and it like Became the Christmas house lights hobby on steroids and now he just sells devices for your office or whatever else. But it's cool, it's fun. Like you could program all that if you wanted to with Arduino software, but we've got time for that. That's the fun stuff, though it is fun until you like. Now I've got to build animations and I've got to connect it to Wi-Fi and then yeah, oh yeah, how do I like hard? Do I hard-code it to Wi-Fi and whatever?

Speaker 1:

But it's nice fun once you finish building it and you're like oh well, I don't really care about using this as much.

Speaker 2:

That's exactly the thing you're like, building it as the fun part, and then, or even sometimes, the building it is like I want to do animations Turns out. Writing animations is more complex than you thought, so then you like, maybe I'll just do basic on and off in colors or something. But yeah, I bought a 3d printer on black Friday for my Christmas to myself, or Brooke bought it for me or whatever, but that's been fun. So that's been my printing all kinds of random Crap I've got like battery organizers. I'm about to print off a bunch of drawer Child box that, like you can't buy ones off the shelf for certain cabinets. So I was like you know what? I could probably print those for a few cents each and it's basically Same as buying it but better. But again, it's one of those projects where you're like, oh, now I have a printer but I have to. Actually 99% of the work is learning how to do 3D modeling yourself, so going down that rabbit hole now, but it's fun.

Speaker 1:

I would love to, but whenever I look at the stuff that people make, I'm like so you're kind of just installing like a dollar tree inside of your house with extra steps.

Speaker 2:

Like, like most people who don't know how to design stuff, end up just printing off random toys and crap. It's just like trinkets and nothing useful. But the other day, trying to take the dog out to go potty, somebody put the dog leash in a different location and it's in a different location every single freaking time. I just want it hanging by the front door. So I got annoyed and then I realized, oh, I'm annoyed, I should go fix this. And we have a baby guy by the front door and I was like you know it'd be perfect. I just like make a little U shape that hangs on top of there and a little extension to hang the leash on.

Speaker 2:

And an hour later I taught myself plasticity is the tool, if anybody's interested. It's kind of like a mix between CAD and blender, so it's intended to be like CAD but more, I guess, friendly for making more organic shapes and stuff. It took no time and I had like my prototype, which ended up being I don't know what I'm doing. So it turned out like super sturdy, like you could probably hang off of it, and it's only like two inches big or whatever. So it's like very small, but way, way overkill. So then did it a little bit differently made a little narrower, made the handle holder fit the thing a little bit better, and yada yada. And that is a lot of fun, like I could see if we weren't writing software every day, doing engineering kind of stuff like that, cause it's the same kind of problem solving.

Speaker 1:

Yeah, you were talking about AutoCAD and whatever else you mentioned. I thought at one point I wanted to be a virtual reality game developer. So I have like a lot of experience with like programs like Maya and Cinema 4D and like all that modeling stuff. That's way harder than it looks.

Speaker 2:

I had one very tedious a long time ago in high school or whatever, I was trying to learn how to make like quick three maps, and the 3D stuff is complex. Some of that isn't so bad, but once you get into like modeling objects and well, in just like characters, our blocks is very difficult, yeah. So going from 2D to 3D is just like orders of magnitude more complex. So you guys upgrade to Ruby, 3d, 3d.

Speaker 1:

yet yes, we did.

Speaker 2:

Everything goes smoothly, cause it did not for me.

Speaker 1:

I didn't have a problem. Andrea is the one who did the actual upgrade, but other than like installing Rust, kind of easy.

Speaker 2:

Oh sure, yeah To do the JIT.

Speaker 1:

Yeah, I don't think there's a lot that went into it.

Speaker 2:

Yeah, I didn't have any issues originally because I was on my Intel Mac and upgraded and deployed it and everything was fine. But somebody was like yo, the Docker image doesn't work. And I was like it works fine for me and I was like so explain more about what is wrong Cause. Then of course things are broken, but don't tell you any context. So we dig in a little bit more and is like on an M line or Apple Silicon and whatever. Well, turns out, there's like concurrent Ruby throws a segfault and it's like an issue actually inside Ruby. That's been patched, but it's like only. I can't remember what the context is if you have to be in Docker for it. But it ended up leading to, instead of inheriting from the, the Ruby 3D 3 Docker image. The Docker image we'd now use is based off Debian and then downloads and compiles Ruby inside of it which is a blast cause that takes a good 15 minutes to compile.

Speaker 2:

So very anxiously waiting for Ruby 3, 3, 1 to be released with that fix, cause it was fixed pretty much immediately but hasn't quite been released yet. It doesn't affect everything, so it's not that big of a deal, but enough people I noticed had seen it and I was like, oh my God, like it's one of those situations where, like, the more people that can use Ruby 3, 3, 0, preview 1 and 2 and whatever, the better, because that would have been caught and fixed before Christmas if possible, and if more people were using that and testing it then, yeah, things would have probably been noticed ahead of time. I'm guilty of that, not contributing enough to using those like preview versions or whatever, but sometimes there are like those things that slip through the cracks that we wish more people had. So but overall, pretty smooth. There was very little like almost no breaking changes and just kind of smaller improvements. I feel like this release, nothing too major but it's fast.

Speaker 2:

Yeah, I just feel good. I think is it next release or something that they were talking about maybe why Jet will be enabled by default.

Speaker 1:

I think so Sounds right and a soon, near upcoming release, I would say.

Speaker 2:

Yeah, I can't remember where I saw that note or something, but I mean, if it's generally going to improve every Rails app, that was kind of like the the benchmark people were shooting for before it became enabled by default and it seems pretty darn good.

Speaker 1:

Yeah, well, because that was always the problem with the original implementation, because it made Ruby faster but it made Rails slower. And yeah, we're like well, this is useless to me. Yeah, if they weren't writing just normal Ruby, so yeah, so, yeah, I'm excited for that.

Speaker 2:

I feel like there's good momentum in the ecosystem lately.

Speaker 1:

When they came out that Rails eight, they got way more transparent about what's coming in Rails. I really enjoyed that.

Speaker 2:

I did too and honestly, like, aside from turbo eight isn't like in a final release yet, but it's available. And then mission controls like the only major thing left, cause solid queue got released. I did a little screencast on that like the day after it was released and looks fantastic. It's just cool that it'll be like built in and like a new default. But for it to support cause that was sort of the thing was like good job, supported just Postgres and a lot of people use my SQL and then once apps are going to need some sort of job back end and so that being SQLite compatible is exciting.

Speaker 1:

So yeah, I'm super excited for that.

Speaker 2:

So many hours lost, so many psychic internals tried just I haven't hardly ever had any Any stuff internal inside kick that I've looked at or whatever, because we were debugging or anything.

Speaker 1:

Do you use it as a the job adapter? See, for everything, I know you're like we don't like you.

Speaker 2:

We don't use sidekick worker directly Right.

Speaker 1:

So, yeah, that would have solved all my problems. Actually, no, yeah, because it was the way it was handling arguments Like cause it like yeah, converts them into a string, like all sorts.

Speaker 2:

Cause it's just expected to be JSON compatible stuff and then active job will take care of that for it. Yep yeah.

Speaker 1:

That explains. Yeah, oh, my God, dude, you have no idea how long I've spent with that One sentence. I just told you which I knew. That's what was happening this morning. I told you like two or three hours ago. Yeah, as soon as I finished this test I can hop on. Me and my project partner.

Speaker 2:

We were famous last words jump off a cliff together.

Speaker 1:

I was like, dude, I can't.

Speaker 2:

That's interesting Cause that's like we hijacked the active job arguments stuff. For that in noticed and it's really cool because you can pass in like I want to give you a symbol with this value and like when we pull it back out, it's not been converted to JSON, so it's not switched to a string and we probably could we would still lose access to doing things like you pass in a user model and it can convert it to a global ID and pull it back out. We could use hash within different access and the symbol and string key thing would be solved pretty easily. But that's really not exactly what we're shooting for there. But yeah, using that stuff is pretty cool. But of course, as I built and noticed, I was like, oh, we'll just take that from ActiveJob. Well, 6.0 and 6.1 and 7.0 have different. They don't all convert the same class or the same types. Some were added in later versions. So there was like some weirdness that we ran into with that. It was like it's not all fully compatible between the versions which was a joy.

Speaker 1:

I would be so on the Sidekick Wiki because I had remembered when we had talked to Mike a long time ago, because I had always used Sidekick as the adapter for ActiveJob and life was great and peachy Hody does not do that. So I remember when we had interviewed Mike.

Speaker 2:

You don't do that, probably for the performance thing, to skip ActiveJob because the layers kind of slow.

Speaker 1:

I was just gonna say that, yep, so in the Sidekick Wiki because I was trying to explain to my project partner like I've seen these things before so I was kind of no, there's something in my head, I know where to go look. And in the Wiki it says that benchmarks show that ActiveJob is two to 20 times slower pushing jobs to Redis and has a three times the processing overhead. But that was with Rails 5.14. I'd be curious to see if those benchmarks have changed any. Just because I love Sidekick, but I would much rather use the ActiveJob API.

Speaker 2:

Yeah well, that's the whole part of the benefit of that is like if something happened to Mike and it wasn't maintained anymore, then the point of that is that your Rails app is not necessarily affected or whatever, and I remember John Nunezmaker was just talking about using like Flipper to feature flag different jobs, so they would be like sent to. If you wanted to migrate from Rescue to Sidekick or Sidekick to SolidQ, you could trigger them one by one or whatever and migrate them. But yeah, that's a pretty old benchmark Cause but I don't know what it's measuring exactly cause like I'd be curious to see now, because in Rails you and it depends on what you're doing, but if you're in queueing a whole bunch of jobs, activejob now supports the like in queue or perform all later and maybe they.

Speaker 1:

We can only perform async, isn't it kind of?

Speaker 2:

I think that's equivalent to like the perform later, but perform all later will do like a bulk insert into Redis instead of a whole bunch of them, and that I could definitely see if you had a 10,000 jobs, you're in queueing and it's got to do one Redis operation for each one.

Speaker 2:

Sure, super slow, I bet. But I think maybe that's why ActiveJob was got the new thing in Rails 7.1 to improve that. So that may be the thing that's okay. Now it's not so bad. It may still. It will still have overhead cause it's generic, but I think Sidekick may have been one of the only ones to implement that so far. I always did the same thing as you where I was like I don't operate at the scale where just going straight to Sidekick workers makes sense. So the delay or the small overhead that we pay totally fine.

Speaker 1:

There's some features in Sidekick Pro that you can't use. I think maybe it's Enterprise, one of those two. You can't use them. If you don't use I think both probably cause it's like ActiveJob only supports the generic things that are shared across all of them.

Speaker 2:

So I was just thinking about like so Go, Rails doesn't really run any jobs except to send emails in the background. So we've used Sucker Punch forever because I didn't want to run a separate process and maintain that. One of the cool things that I didn't know is a I guess I've seen it, maybe, but forgot all about it. But with SolidQ there's one liner. You can add a plugin to the Puma config and when Rails starts with Puma, it'll also boot up a separate process for SolidQ's supervisor, and then when it shuts down Rails, it'll also shut down SolidQ's supervisor for you as well.

Speaker 2:

So we can just deploy that and it'll be the exact same thing as Sucker Punch. But the problem with Sucker Punch was it's running as just extra threads, so there's no ability to queue stuff up to send an email in five minutes or something. So I'm really looking forward to that, because then we'll be able to basically get those extra features with the same benefit of not running another process, and that's not a big deal on most hosting anymore. But the GoRail server is running a really old Capistrano deployment and it just ran passenger and that was it. So eventually I'm going to swap it over to running on Hatchbox. It was running fine Actually it was running fine until last night, I guess, and a passenger crashed or something. So that may be my queue to go flip-flop it. But you yes, man, the puns just keep punning. Yeah, I'm excited for that stuff, though.

Speaker 2:

Mission Control is going to be really sweet. There's even a couple people who know about Mission Control coming, but they built SolidQ front ends anyways in the meantime, might as well, which is cool. I like that. Jobs will be in the database. You'll be able to query them and interact with them just like regular old models. That was always kind of a hard thing with Sidekick and I know you shouldn't be messing with that stuff much, but if you ever needed to kill a job or something that was scheduled in the future or something that was like discouraged, but if it's something in your database then it's pretty easy to modify or something. So it's good times, lots of new, good stuff. Working on SQLite too. We'll have to talk to Steven Markheim about that soon, but I know he's been heavy into it. And then 37 Signals Crew has been, because that's the back end for all the once products.

Speaker 1:

I've been hearing good things about that. Now I want to know when Manga is going to come back.

Speaker 2:

Oh God, Was it everything.

Speaker 1:

It was when I was in college. I thought that was what a database was, and then I learned.

Speaker 2:

I remember it got popular in college Probably senior year or something and I was like in the same boat or was like I'm just going to keep using my SQL and Postgres and whatever, because that's what everybody's been talking about before, but it sounds cool. And then it was really cool to go like prototype an app where you didn't have to worry about migrations, like something didn't exist. You just add the attribute and boom, it's there, and then you just delete the ones you don't need and whatever. It was kind of awesome for prototyping. I wish there was sort of a mode in Rails where you could like let's imagine we have this model and then we like defines attributes, see if that's what we need or not, and then have it turn it into a migration once you're sure. That would be cool that would be cool.

Speaker 2:

I think I maybe have prototyped something like that a long time ago, but I think that was one of the big selling points to developers in the early days of Mongo was like what if you didn't know what your schema was and you just like got to?

Speaker 1:

work right away. That's not a value add to me, I mean, unless your schema is like the size of a mountain.

Speaker 2:

For anybody starting a new project who didn't know what they were building exactly yet. It was great because you could just figure it out and you weren't like constrained to like hold on, make a migration, tell us exactly what you want, and if you got it wrong you got to undo it and you got to edit it and then you got to redo it. Or you got to make more migrations and then you got to collapse them later or whatever Felt like constraints, Lots of friction back then for doing that process. And then you like do it with Mongo and you're like I didn't have to think about any of that, I just worked on the idea. That's pretty interesting. There's got to be a way to do that.

Speaker 1:

but I encourage you to like stop and be like hey all right, I feel like maybe this is just Nate talking through me, but I feel like your app can be the most screwed up thing on the entire planet, but as long as your database architecture is like really well done, then you're always going to be fine.

Speaker 2:

Yeah, I agree with that, but you got to take the time to figure out what your database architecture needs to be sometimes, and it isn't necessarily clear when you haven't written in a single line of code yet or whatever. So I think it's like how do you get from? You have a mock up of what you need and no information about how it gets stored, or where or why or whatever. Going from that to now, we have a schema. That process like gets overlooked a lot, I think, and there's something to that process that I think people need more tools or something to just like experiment something like that, Whenever I need to make a database table or make a relation and I don't really know what's supposed to be on it.

Speaker 2:

I'm just like Just one JSON column.

Speaker 1:

Go to schemaorg, which is the linked and structured data. It has all of the schemas for that. That, like several-. Oh, this is the one coming like Google use and stuff.

Speaker 2:

Yeah, this is like what you can embed in your give you jobs on your website. You can like use that kind of stuff for-.

Speaker 1:

Yes, and it has everything you could think of and it has like they relate to. If you want ideas for a table, just go to schemaorg and type in the name of your object, like meeting or event, and it will like just list options and like what they belong to and like what the types are and what the allowed values are Like. It'll get you pretty far if you don't really know what you're doing.

Speaker 1:

I feel, like I would do that if I had no idea what I was doing. I'm like, okay, well, I need a post. I would go on schemaorg. Look at articles belong to authors and they belong to like main entities. Like you can kind of get a really good idea of like what it might look like just from doing that I like that.

Speaker 2:

Yeah, that's-.

Speaker 1:

That's a W3 standard.

Speaker 2:

And that is pretty similar to what I do a lot of times is like if somebody's like, hey, make a blog, I'll go look at blogs. Okay, seven out of 10 of these have categories or tags or some sort of like primary image or short descriptions or whatever, and then work my way backwards from that, look at what other people have done and then figure out how does this apply to your thing? That's a good way to do it and that's schemaorg has quite a bit they're very generic, but quite a bit of what is an address, because you might live in the US and have no idea that addresses are actually different in other countries and stuff Right. So understanding what an address should look like, to be generic globally, is pretty interesting.

Speaker 2:

Or you have to go to like Amazon and like what do they do and see how that works.

Speaker 1:

One idea I was reading about recently for trying to architect a new app was basically like, I do exactly what you're talking about too, where I like I go look at other apps and see what they're doing.

Speaker 1:

But what this person did was which I thought was really interesting was they would take a screenshot of the page or just use like a markup tool in general, like and I think they were using an iPad and they would. First they would go through and like highlight in a certain color all attributes of that object and then they would keep on like drawing out okay, well, so these are like the properties. Like I'll put them in green. So when I like look at the page, I can see all the properties are in green and, like the main, like other related objects, maybe like if I have an address for like a person, like that's a related object, maybe I'll put them like a blue and then, like slowly pulling yourself out until you're looking at the entire page. What is this entire page? This entire page is a representation of a post object and the post object has these fields that are belong to it specifically, which I can see in green, and these related ones, which I can see in blue. This is a really interesting like idea. That's a great idea.

Speaker 2:

Cause I can immediately imagine that Cause.

Speaker 2:

If you gave me a mockup of a blog, it would be like, well, here's an article and then there's an author Okay, that's probably user association and we're pulling the name from there, and then we have comments, and then comments have authors, so they're probably also users.

Speaker 2:

And being able to visualize all that Cause that's probably one of the things that's the hardest to learn, as, like a Rails developer at the beginning is we got to design, we got to go from like the UI to that representation in the database and then in our controllers, we have to make sure that we load all the correct stuff so that it can be rendered out to get that final result. And that's a really cool way to like just draw in a different color, every sort of different model, and then name the attributes, and then you see exactly where they're rendered on the page and everything you can see where there's a loop of. This is the first page of comments or all the comments, and then, oh, every comment has a sub box that's like the commenter, so that we probably need to like eager, load those users and whatever else. Pretty cool. That's a good, really good way of doing that.

Speaker 1:

When you then you can create like a basically your own database of like all these different ones. So, oh, I need to build a blog, like you just said, like I'll just go look at all the blogs that I've looked at, that I've already done this for I can quickly just go see like, oh okay, well, there they are, like I don't need to go searching for it.

Speaker 2:

Yeah, it's a good one. I like that. Well, we should probably call it. So we got something to talk about next week but I did, I've got.

Speaker 1:

There's so many things that I haven't even dude. Yeah, broached.

Speaker 2:

Yeah, I was going to say there's a ton of stuff after this are probably going to release the new version of notice and that took two months to refactor. I attempted refactoring. This is one of the rare times where, like, I tried to refactor 15 times, never quite got it right. So I actually just wrote Rails plugin new and then just to overrode the gem and like just started completely from scratch. So unfortunately that'll make the upgrade process quite a bit harder because so much has changed. But I was like I've learned so much since the first version.

Speaker 2:

There were some kind of core issues that made it hard to implement some features. People had worked around it and made some hacky PRs, but I was like I don't want that, I want to just fix it and do it right. So, yeah, I want to talk about that next time. So hopefully it'll be out by then and then we can talk about it. So sounds good to me. Oh man, well, good catching up. Dude, missed your face. I know Same. We can't let it go this long. No, I was getting lonely.

Speaker 2:

We'll just not make sure we don't schedule too many episodes yeah, never, so we're required to show up every week.

Speaker 1:

Never again. That was a hell week for me anyway, like that. There was a lot going on that week. I remember that week very specifically. That was not a good week, yeah that was rough.

Speaker 2:

So all right, man, I'll catch you next week. He's out Later.

Managing Projects and Streamlining Processes
Craft, Smart Switches, and Home Automation
LEDs, 3D Printing, and Ruby Upgrade
Rails 8 vs Sidekick and ActiveJob
Database Architecture and Job Processing Tools