Hey, folks, welcome back to another episode of the Ruby Rogues podcast.
This week, on our panel, we have Valentino Stole Hey Now, I'm
Charles Maxwood from Top Endevs, and we also have a yush A yush Nuwatya.
I always feel weird, like I'm saying it wrong. No, you're
right, absolutely right. So yeah, so we were getting on. We
didn't have a guest this week. I keep inviting people and then for whatever
reason, they don't get on our calendar. So if you if you have
a topic you want to talk about, let us know. But yeah,
Ayush is new to the show and we were chatting, and you know,
next week we're going to talk with him about Bridgetown. But uh, I
thought, you know what, let's get to know him a little bit and
kind of get his background on things. So Ayush, I'm kind of curious.
I don't know exactly where to start. I like the idea of starting
how you got into Ruby, but you were doing other stuff before Ruby,
So maybe we start with how you got into programming and then kind of move
along from there. Yeah, for sure, I think it started the beginning.
I came through a fairly traditional route. I think I studied computer science
at university, although I'd like to say that course doesn't count because it was
quite shit. Date. Should you go to college to become a programmer,
Probably not, But as I grew up in India, moved to the UK
at London for university, and despite not learning maybe a whole lot about actual
practical industry, programming at university did give me the degree that I needed to
get a work visa. Hear, so it oppened that regard, but I
mean it was the course was just so like basic. They thought they just
start Java, and it was like I had no idea how to run code
outside of Eclipse, like when Eclipse was the more popular ID over Intelligence or
whatever. I honestly like, I didn't know how to write a unit test,
completely clueless about what to do if I didn't have Eclipse, and it
was Yeah. When I got my first job, I was like, Okay,
the real world's fairly different. So I have to ask, first of
all, because I did Java, and now when I talk to people who
are going to college, they're usually using Python. So how long ago was
this? Like? Are you an old guy like me? Are you just
got into an old guy program? I think a younger guy that got into
an old guy program. I was at university twenty eleven twenty fourteen, so
not that long ago, right, So you yeah, you were in because
I went. Now I'm really going to date myself. I started in nineteen
ninety nineteen ninety eight, and I went for a couple of semesters and I
went on a mission for my church for two years, and then when I
came back, I graduated in two thousand and six. I came back and
started back in school in two thousand and one, so not terribly too far
apart, but yeah, okay, yeah, I ended up getting a job
straight out of university, which was nothing short of a minor miracle, because
it's so hot to get a work viz I hear in the UK. Oh
really, but yeah, it's ridiculous. I just got super lucky. I
got a job at this company called Akqa, which is like an agency,
and they were just starting this graduate program. So that was the first Gohart,
just me and another girl that were the first ever graduates in this graduate
program. That allowed me to kind of do a lot of many different things
in the first year. So I kind of did android development, I did
DevOps, I did like software engineering and all that kind of stuff and ended
up in this like hybrid iOS and Android role because my final year project,
when dissertation project at university was an Android app. So I kind of ended
up in mobile just through that, and I was iPhone user Apple fan at
the time, and so obviously I didn't really want to do Android development.
Is just that I had to do at university. So I kind of branched
into iOS and ended up with this unique skill set where I could do both,
So the company put me to work at both, and yeah, I
worked there for a while. Then just obviously I gravitated towards iOS because a
bigger Apple fan than an Android fan. I still despise Android. It's just
so bad for my blood pressure every time I have to go and write any
Android good. So then I ended up getting another job at a company called
transfer Wise now known as Wise, and I was exclusively in an iOS developer
there. Managed to shake off my Android roots, thankfully. Yeah, I
was. I was doing objective cy for the first couple of years at Akqua
because I was working on some legacy apps and Swift was still pretty new,
and the interrupt between objectivecy and Swift was still liberty fee, so we as
a company didn't want to take a risk on it with with damn good reason.
I completely agreed with that decision. But when I moved over to transfer
Wise, they had just done like a significant overhaul of the app a few
months before I joined, and it was all Swift. So I got right
Swift for a couple of years in like a production setting there, which was
quite nice ish. Yeah, I remember when they made that switch. I
was co hosting the I Freak Show at the time, and so I was
talking about it. I wasn't actually writing anything in it, but it was
definitely an interesting time period to be working in that and seeing some of the
transitions that go on with some of that stuff. Yeah, it was.
I think it was a much needed overhaul. I am probably one of the
rare breed that actually liked objective cy I quite it was a bit of a
both sure, but it felt it had a lot of a similarly toss to
Ruby in terms of like meta programming and things like that. And I think
one of the reasons that I was kind of I moved away from mobile development
one of many reasons, but one of them was that Swift was becoming like
what I perceived to be the javaification of Swift, where I felt I just
felt that the team were kind of chasing like quote unquote academic perfection from the
language rather than building features that were actually useful and all, Like the dynamic,
advanced stuff that you got with objective Cy, They're kind of making an
effort to remove that from Swift, and I just wasn't a fan of that
direction at all. Interesting, So at what point did you find and move
over to Ruby, I'm curious. So it was just before the pandemic.
So I when I joined Transferises twenty seventeen, I actually knew that I would
leave in exactly two years, because you need five years on a work visa
in the UK to get residency, and while you're on a work visa,
you your visa is tied to your employer, so you can't quit without getting
kicked out of the country basically. So I was just waiting for that like
residency period to quind of qualify for residency, apply for it, and then
and then quit. Really, so it's summer twenty nineteen that I quit Transferise,
and I was like, I'm going to take a few months off here
because I'm burnt out as hell and any time off. So take a few
months off, and I'm like, you know, I just really don't fancy
mobile development anymore. As getting quite fair up a fit. I also kind
of get quite a lot of my motivation from product development. I don't get
it from like technical problems. I like, I like building products. I
don't really care for that. I don't care that much for like interesting technical
problems. And it's quite hard to build products when all you can do is
build a mobile app, Like if you have no service side skills at all,
there's not a lot you can do it just an app, right,
So I was finding that quite limiting in what I wanted to build or have
the skill set to build. So I was like, yeah, I think
I'm gonna I think I'm gonna move to web because in the web world,
if I can build it, I can deploy it and release it and sell
it. In the mobile world, I need Apple to let me sell it,
no matter how cheaper it might be. Like Apple might just say,
like I might invest months into something and then Apple could just turn around and
say, yeah, we're not going to prove that app. So I just
didn't like that kind of aspect of it either. So I'd kind of been
exposed to Ruby a fair amount just while working on OOS, because a lot
of the infrastructure around iOS was in Ruby. Like until Swift got its native
package manager, the most popular dependency in package manager in the iOS world was
called ocpods, which is written in Ruby. Yeah, it's written in Ruby,
which is yeah. Yeah, And there's a we had those guys on
I freaks and it was kind of funny because yeah, I was nerding out
about Ruby with them and yeah exactly. So like those like other bits,
like there's a c I tool called fast Lane which just makes it quite easy
to build like a CI pipeline for io s and stuff that didn't he No,
it's Felix Cross. Oh, Felix Okay, Yeah, at least it
was initially him fair Leish. I was initially him. It might be because
I think it was bought by Twitter and then Google and then it changed hands
a few times. I don't know where it ended mixed up with something else.
Yeah, so that that wasn't Ruby as well. So I'd kind of
done a bit of Ruby just because I had to deal with that stuff in
the iOS world, and I quite I quite like the language. I liked
like the raels ethos and stuff. So I just bought the reel s tutorial
by Michael Hartle and that that's basically a rite of passages in it. You're
allowed to be a reels developer if you haven't worked through that book. So
I've never gone through the book. How dare you? I'm kidding. I
remember when he wrote the book. I've been on that long fair enough,
So yeah, I just I worked through that book. I built a product.
I built a very simple blogging blogging app called Chapter twenty four, which
I recently decommissioned. Actually need to write about that, I think, because
a lot of people talk about the successes, but they don't really talk about
things that didn't quite work. So I want to write a blog about why
I built it and then why I decommissioned it. But yeah, I kind
of just on the back of that, I kind of got into freelancing because
somehow I ended up on the Bridgetown core team around that time as well.
So this is all through twenty twenty that I was retraining as a Ruby developer,
building Chapter twenty four and then a back half of twenty twenty, I
ended up on the Bridgetown Core team, which I think is probably best to
get into next week. And then just through sheer dumb luck, ended up
with freelancer. I knew I wanted to do. I knew I wanted to
freelance, but just through the sheer dumb luck of Twitter, ended up getting
a contract. And as you know with the like in the Ruby world or
any tech world like, the hardest thing with freelancing is getting the start.
So once I had that first contract, which I worked with those guys for
quite a while, I think it is over a year that I worked with
them, and then it then it just snowball from there. Really, I
wrote the book, took a few months off, wrote the book, and
then it's been For that I think changed the trajectory of my career fairly significantly
when Yeah, I released The Rails on hot Wire codex. Because now I
just tend to find work. It's become so much easier because I can just
point to this, the ridiculous brick of a book that I've written, and
then people are like, oh, would you like to work with us?
And that's a very privileged position to be and I'm incredibly grateful to be in
that position. But yeah, that kind of brings us to where we are
now. Nice. So are you finding work. I'm just curious and I'm
just going to ask whatever questions I want. A lot of times I'm kind
of steering the conversation a little bit, you know, because I think that
people are going to want to know a specific thing, or you know,
learn a specific thing, or I think it'll be helpful even if somebody doesn't
think to ask it. I'm just going to ask what I want because I'm
curious how much work comes in off of the rails and hot wire codex,
because it's sounds like you kind of at least implied that that brings you some
of the freelance work. Yeah, a fair amount. So like my previous
client I worked with for about fifteen months, and I had posted on a
number of forums at the time because as some work I had lined up fell
through and I was quite desperate for work at the time, and I posted
a number of forums saying I've written this book, and I've built this,
that and the other thing. And I signed that contract without ever having a
call with the client. They just saw my work and they're like, oh,
yeah, can you start Monday. Here's the contract. And I was
with them for like fifteen months or so. And then earlier this year,
in about March, I published an update to my book for Strata and Rael
seven point one, and I sent out a mailing blast to my mailing list
for the book and I said at the end, by the way, I'm
looking for some freelance work. My contract just ended. If you have anything,
to get in touch. And I got an email back from someone who
was working with this startup saying, Oh, we're looking for rails developers.
This is a company I'm working with. It you interested. I was like,
yeah, and I've been. I've been working with this startup since since
March, and that was just through a lead from someone who bought my book.
And since then, I've had two or three emails from other people who've
discovered me through my book asking if I was available, and I've had to
say no because I'm fully booked on this contract. So it's it's always nice
to kind of have leads that I kind of have to say no to at
this point, but hopefully I can work with in the future at some point.
Yeah, I've I've had similar experiences, not with the I did write
a book, but it was it was how to find a job. I've
had that with screencast series and with the podcast where yeah, I just you
know, I just mentioned on the show or have people come to me out
of the blue, and yeah, it's it's been really interesting to see how
that all works out. So yeah, I like, I like the idea
of writing a book and demonstrating your technical expertise and having people recognize that and
then you know, come along and say, oh, I'm I'm interested in
what you can do, and yeah, exactly, I think it's the best
way to kind of showcase your skills, to just build something. Then it's
all in the public domain and it kind of also acts as an asset.
So like, I mean, I don't I don't make a whole lot of
money of the book sales, but it's a nice like cream at the end
of the month that kind of adds on top of my freelance income. And
yeah, it's just a great way to generate leads and stuff. So like,
I always kind of planned that with my freelancing career, I would split
my time between client work and my own projects. And that's why I have
the reels and not why I could. That's why I have Scattergun dot Email,
which is another SaaS product that I that I run. It's temporarily on
pause. I really need to invest some time to bring it back. But
yeah, that's why I have those things because those are the things that kind
of I have complete control over. I don't need to make compromises to anyone,
and it's very fulfilling to have that kind of stuff as well. I'm
curious. I never knew you wrote a book. First of all. Awesome,
right, I love it. I have so many questions. Yeah,
go for it. Yeah, the book israelsonhot Wire Codex dot Com. Yeah,
it's really cool. So, like, what what got you to build
this specifically? Just like your mobile experience tran transitioning to rails, Like yeah,
kind of. So when I was working on my first contract as a
freelancer, I had a pretty steep learning of at the start because it was
the first production rails app that I was kind of working on, uh for
like for someone else. The only before that I'd only kind of worked on
my own projects. So I realized that that like I'd done the rail tutorial
by Michael Hartle and I found that it was a great Uh, it was
great for the basics, but like that book, you only create two models
by the end of the book. So it's like, because it focuses so
much on the basics, it's not representative of a production rails app. And
I found that next step was quite hard for me to take. So while
I was on that first contract, and the idea just kind of popped into
my head that there's loads of books that teach you how to make rails apps,
loads of books that teach you how to make native apps. I've kind
of got this unique blend of experience of all three where I've specialized in all
three at various points. Turbonative was kind of a fairly new thing because this
was mid mid twenty This was mid twenty twenty one, so Turbo Native was
only about six months old. I was. I was also aware of turbolinks
Native, which had been around for a while. It was on my radar
even when I was a mobile developer, and I had petitioned for its use
a number of times to my teams when I was a mobile developer and basically
been told to in no uncertain terms to shut up because it was hybrid,
and hybrid was a dirty word. So I thought, hang on, hang
on, because I have to chime in on this because there is a dirty
little secret, and that is is a lot of the apps that you use
out there that are native apps, they pull in WebUI all over the place
they do. And yeah, the other thing is that most of these fully
native apps are also completely useless offline. Like people kind of say offline access
is a big thing that kind of banned around for fullyen but I'm like,
yeah, you know, most apps have worked on useless offline, like they
won't do anything well or they build in So the thing that I'm thinking is
like the video apps, so like you're what Hulu or Netflix or whatever,
the only the only on offline functionality they really have is download this before you
get on the airplane and that way you can watch it on your phone.
Right, So it's very limited in scope on what it'll do. Yeah,
once you're offline, Yeah exactly. But yeah, I thought, I thought,
uh, yeah, here's a mad idea. I've only been working with
rails for less than a here, but let's write a book on it.
How hard could it be? Right? Yeah? How hard can it be?
It? Depends on and his is like nine hundred pages. So yeah,
I mean it was I love it. I love that premise, Like
building the neighborhood marketplace like Craigslist or something thing that can't be easy to do,
right, No, it's not easy, but I kind of like I
learned best by doing so. I definitely wanted to teach how to build a
product, and I needed a product that had scope for many things. And
I just thought a product marketplace I can just like any any kind of feature,
I can kind of bolt onto it in some way or another. So
it was just a very good kind of premise to cover all the features and
rails because covering all of the constituent frameworks like action, mailbox, active stories,
all that, that was a non negotiable for me. I had to
do all of them. So this was just a nice vehicle for that.
And I mean too, you know, rails is like pushing the you know,
build your next business right with rails? Yeah yeah right, And like
selling something is like what everybody wants to do, right, yeah, exactly,
So I think this is great, Like I love I'm curious, like,
uh, you know, what what kind of design decisions do you make
in the book for like the various things like do you choose to build your
own authentication authorization? Uh? You know, yeah, so I was it
is your own authentication authorization. I've kind of put that front and sent in
the marketing materials as well. And again, I just wanted to teach how
to build as much as possible. And I was only pulling in gems for
very specific, very difficult problems because I find a lot of tutorials they kind
of just skirt around the difficult problems. We're pulling in a gem and like
like authentic, just just just use device and then it becomes a tutorials.
That's what the heart of book does, is it pulls in device and then
just moves on. Now it doesn't it teaches you. It teaches you your
authentic, your own authentication. Yeah I need to be wrong about that.
But a lot of tutorials they they just say, oh, just pull in
this gem, pull in that gem for like device, pundit whatever, and
they don't teach like the concepts. And in freelancing, I've just found that
those because those concepts are not that widely thought, they're not applied very well,
and people don't think about do I actually need a gem for this,
and they just pull in a gem just because it's the thing that they always
do, even if it's a very simple authorization premise that the product has,
like oh it's authorization, we need pundit for that. So I was like,
no, let's just build everything from scrat So like the only things I've
used gems for, like things like paginations, I've got Paigey in there.
I've got Sidekick obviously for background jobs. So yeah, just like very specific
things. Actually, let me pull up the gem file right now. It's
like, can tell you which are the only third party gems that I've pulled
in here? Uh so credits doesn't count as third partys. Credits is now
in rails, So I've got premailer rails, which is to inline your styles
before action mailer blasts something out, so that kind of holds up styling on
all the different mail clans. Got something called io country codes, which just
makes it drop down easier for like a country drop down easier because it just
kind of maps like a user friendly country name to the io code. Uh
page for pagination s a w S s DK for S three, geocoder for
geocoding local time to just to show like your which is a JavaScript thing to
show local time based on where the user is browser to detect which browser it
is from, uh, the user agent and email reply pausa from which is
the GitHub gem to kind of you know, when you click reply on and
email clients will kind of just put a lot of gunk in at the bottom.
This kind of just makes it a bit easier to deal with which in
action mailbox I needed. And apart from the sidekick and sidekit grown, yeah,
that's it. Everything else is from scratch. So I have to ask
because I mean, I'm working for a client right now that uses I mean
you mentioned uh device pundit. I think they're using rollify right, and some
of these ideas like rollify right as far as just the fundamental adding and you
know, tracking if somebody has a role and if that role attaches to some
other entity in your system, right, that seems relatively simple, punt.
It seems like it does a whole bunch of stuff, And sometimes I feel
like it gets in my way, and sometimes I feel like it, you
know, it just kind of cleanly solves a problem. So how do you
decide if something is in or out? And how do you decide if something
is going to be worth the trouble of figuring out because some of these libraries
have a learning curve and yeah, yeah, anyway, I'm rambling. But
no, it's tricky. It's a hard question, and I don't have a
clear answer because the best thing I can say is just experience. So when
I was in my first job at a university, I had a really good
mentor, so the ACELA and iOS developer back then, and I had a
really good mentor and he kind of ingrained this deep dislike and disdain for dependencies
in my brain. So and that has stuck with me, and it's something
I'm actually I quite like. So I don't want to change it because I
like that fact about myself. So I will not pull in a gem until
I'm like really pushed against the wall and like I'm like, okay, now
I really can't do this myself. I really shouldn't do this myself. Then
I will pull in a dependency for it. Other than that, like I
mean, I'll just write it myself, Like I don't know, just think
some time. I mean, isn't it more effort and more trouble? It
is, but it's also a lot more customizable and reusable. So like,
so once I've done something like I do my own authentication, So once I
have my authentication system, that code is reusable, so I don't extract it
into the library. But in every project, I just copy paste out the
relevant stuff and then customize it and customize it as the project needs. And
yeah, I mean it may sound like like sacrilege, but it's it is
a different mindset when you're kind of wrapping up some code as a black box
library, because then it's kind of like its own entity and you need like
you need kind of ports to kind of interact with it. But if it's
just code that lives as part of your application, you don't need to package
it up in any way. You don't need to think about like, oh,
what if the user wants to customize this that or the other thing is
you just change the code right because it's within your application. So I'm a
big fan. Yeah, I'm a big fan of just writing reusable code in
that way, and I do it in like it helps my client work is
all. Very often I'll pull things out of my own projects and put them
into client project just because I've solved this problem, why do I need to
solve it again? So like now I have like an authorization system that I
built for the for the book, and I'll just build a similar system for
any other project. So like for me personally, I only need to build
it once and then I just need to tweak it to fit any other project.
And for me, that's a lot less risky than pulling in a dependency
that I don't control. Yeah, I'm I'm going to chime in on this
a little bit. So the the last one that I pulled in that I
kind of had this with was actually written by Dave Kimura's action Off jem and
right, I needed to tweak the layout, and I, you know,
I want to add a user profile, which I just did by adding another
model to my system. But as I got into that just a little bit
more here and there, what I found was that because I was thinking,
hey, I'm a little bit gun shy about Hey, this is a security
system on my app, right, and since I'm not a security expert,
I don't know if I necessarily want to be the one writing this and responsible
for it. But at the same time, you go look at action off
and it's relatively simple, right, and so it's definitely something that I could
build myself if I wanted to. It's just that he has a whole bunch
of other people looking at it and solving some of the problems that I might
cause myself, and he spent a lot more time looking into the issues that
are there. And so that's one reason why I'm sitting there going, maybe
I should, you know, use somebody else's system. The other thing though,
is that, yeah, then it's okay, I've got to tweak the
layouts. So I've got to tweak this, I've got to tweak that.
And so there's the learning curve of learning how to use the gem that for
my time might take up just as much time as writing it myself. And
I guess I don't actually know that, and I don't know how you know
that, But those are the trade offs that I'm looking at, Right,
is am I going to cause a problem if I write it myself? Or
am I going to leave something open that I shouldn't? And then the other
thing is is, yeah, you know, for my time, right,
if I drop pundit in or you know, rollify or something else, you
know, how do I do that. And then the last thing is is
sometimes I pull in these gems because I have a client that's using it and
I need to understand it and so I can go play with it over here
in my own little sandbox. Yeah, exactly, those those trade offs are
They're all really good questions to ask, and it's there's no like straightforward answer
to any of that. It just comes down to like judgment. So actually,
let me read out a quote that I've put in the in the coda
of my book. It's a quote from Nate Hopkins. So yeah, yeah,
he tweeted this a while ago. Now. He says every additional gem
dependency adds friction to upgrading rails. Be sure to apply a healthy dose of
scrutiny to all gems before including them in your projects. You also increase the
surface area of several risks unexpected changes to native behavior, conflicts between gems,
degraded performance, weekend security, and these risks. These risks compound as you
drift further from the latest framework release. So I thought that was just a
good way of looking at it. It just depends on, yes, like
the use case or what you're trading off against. And I just find that
very often you can accomplish quite a lot with just good object oriented programming,
like authorization is one of those things where with these gems like pundit and I
think can can, can and action policy and that the good gems, but
I just find that they go too far into like meta programming, when all
you need is good object oriented programming. And I think the absolute game changer
has been something quite simple, which is actors support current attributes. Just the
fact that you can get current dot user now from anywhere in the inner app.
Earlier it was you probably have a current underscore user method that's only available
in your controllers. If you're trying to do like authorization stuff in your model,
just getting hold of the current user might might be a little tricky,
which is why you had like metaprogramming techniques, which gems like pundit of kind
of popularized. But now that you can get you use a quite easily from
anywhere. It's a fairly simple thing. But I think it's also made a
huge difference to how how much you can simplify things like authorization. Yep.
So I guess the other question is do you then favor gems like so you
know, back to authorization or authentication for a minute, right, do you
favor things like maybe authentication zero, where instead of it using an engine like
device or action off, does you just do a rails generate and it drops
the code, right, It generates all the code into your thing, into
your app, right, And then I mean, if you pull the gem
out, it's still gonna work because it really all it did was just effectively
write that code for you. Yeah, exactly. So the client I'm working
with at the moment, we've used authentication zero. It was done before I
started, so I didn't have any influence on that, and it's the first
time I've used authentication zero actually, and I recommend it wholeheartedly to anyone.
It's an approach that I affletely love. Because the codes all in your app,
you can modify it as you choose to. Like, we've actually had
to modify the authentication system a little bit because one of the requirements were we
needed Google login, but we also like if someone had signed up using email
and password and then they tried to sign and with Google, we wanted them
to kind of get into the same account, Like we didn't want Google signing
to create a new account, and that was also some custom logic that we
had to do, but because all the code lived in our app, it
was fairly easy to do. We didn't need to jump through any hoops.
All I did was modify a controller and done like that. Like the amount
of times I try to wrangle device to do something I wanted slightly custom and
felt like hitting my head against the wall. I mean, this is much
preferable to me. Yeah, that's that. That in my experience, is
where I run into things. Yeah, it's like, oh, I'm deviating
from how device thinks about the world, and so you know, I feel
like I've got my arms stuck in the gears of this machine and I can't
quite pull it out in order to Yeah, what about stuff like so you
said the Google logins, you do you just reach for omniof for that or
yeah, right now omnioth Yeah, Like that's again, it's a it's it's
a difficult, small surface area problem. So that's the kind of thing where
I would reach for a gem, because yeah, like gems are kind of
cover quite a large surface area, and then your app kind of becomes heavily
dependent on the Let's see, like if you build an app with device.
You're never ever ripping device out of there. It's there for life. It's
like for the lifetime of the app. Right. I will only pull in
gems like that when I'm like absolutely one hundred percent show and I'm really really
thought it through and I'm like, this is the only way it's a worthy
risk, And then I'll pull in a gem that my app like literally will
fall apart without. Other than that, I like small service area gems.
Cool, Valentino, I hijacked your higher level question. I'm sorry, No,
it's all good. I mean, it's an important, important discussion to
make any time you're introducing the dependency because it is just like a snowball effect,
you know, if you ever want to remove it, it's a pain.
Yeah. Change, Well, the last couple of contracts I've worked,
we've worked on upgrading rails and that is always painful, and it's always the
dependency gems that you get, which was the other point that I usually made.
Yeah, it's it's it's tricky. It's one of those things I think
you get better at with experience. Like just my kind of take on it.
It's I'm not against dependencies. I'm definitely not one for like not invented
here syndrome or anything like that. But I'm also fairly skeptical of dependencies,
and I just think like two or three times before I pull anything. And
so it's not like I'm against I just give it a lot of thought before
I pull in a gem. Right, did you have any follow on to
this, Valentino? I did. I mean I'm often torn on like the
dependency like hell that people reference, Like there are a lot of like great
well built gems that like you can just throw in and trust that are going
to work long term, and so it's like it's hard to know what those
are if you're not familiar with them. Yeah, and so I think it's
a good rule of thumb to just like not introduce it if you don't have
to. But at the same time, it's like whatever you build, you're
going to have to maintain. So like whether you're not maintaining it or somebody
else isn't maintaining it, like, does it matter. Yeah, it's true.
And I think also if you're pulling in like a gem that's not like
super popular or something like that, I think it's also important to just have
a high level understanding of what the gem does. So, like if I'm
pulling in a GEM where I'm not completely clear about how it solves the problem
that I want to solve, and if it's not like super popular or anything
like that, I'll always dive into the source code and try to understand it,
and if I can understand and are happy with it, I'll pull it
in. Or otherwise I might just take inspiration from their approach and write it
myself. Like quite recently, for the client I'm working with, we we
needed to have like some kind of d bounds logic inside kick. So like
if you try to queue up the same job with the same arguments like two
or three times in quick succession, it should only it should only queue up
once. So like if you try to queue up a job like ten times
in the in two minutes, it only it only executes once. So I
went looking for a plug in for this, and I found one, but
I was I don't I firstly dove into the source code because it wasn't a
very popular jam, it was not something i'd heard before. It was it
didn't have a very high star account or anything like that, and I was
doing a bunch of stuff that I didn't quite understand it was running some a
LUA script on Reddish and things like that, and I'm like, yeah,
I'm not sure, not sure about this one. So I spent one day
and just kind of took a little bit of inspiration from their approach and built
out a super simple solution myself in like I don't three or four hours or
something. And now we own that solution, so we need to tweak it.
We can. It lives in the lip folder of our own app.
Other developers can just open that up, read it, understand it, and
that's it, rather than hiding away in a gem that nobody understands. Yeah,
there's a lot to be said there, right, Like, you know,
you can still package it locally, like it is a separate project.
Yeah, like use packwork or you know, something like that, just to
keep things separate in casey, you know, I feel like the most common
use cases are well, like you know, we want other people to be
able to contribute to it, right, and that's what the value of the
gem brings. But you know, it's not guaranteed to do that. But
I feel like if you just keep it abstract enough, like you know,
it solves most the cases in the long term. Yeah, but that's the
trade off too, right, is if it's too abstract, then it loses
utility, but if it's specific, it also loses utility. So you've kind
of got to find that sweet spot too. I think a good roos like
that's how are you going? I was gonna transition to something different? Guess
I'll just I'll just wrap up this kind of I think a good rule of
time is like, could I build this myself in four to six hours?
If you could, it's probably building it yourself. If it's gonna if it's
gonna take longer than then the gem probably makes a lot more sense. Yep,
that's a good rule of thumb. Uh. Yeah, I was gonna
transition like because you know, you tackle hot wire you know specifically here,
uh, and you dive deep into turbo natives and and that whole aspect of
you know, mobile application development if you want to call it that for real,
you know, how is your experience like setting that up? Like what
do you think of the turbo native framework as somebody who previously worked in the
you know, mobile on both sides realms? You know, how does the
developer experience like equate in in rails and interbo native hurt someone's feelings answering this,
No, I don't think so. Actually I quite enjoyed it, to
be honest. I think it's it's a great approach just because it's kind of
like, uh, a little bit in this world, a little bit in
that world. So like your navigation and stuff is fully native, so you're
not you're not fighting against the platform you're on. So you're still writing Swift,
you're still Writingcotland. There's there's no there's no escaping that. It's just
instead of writing the content of the screen using native views, you render some
HTM on CSS instead, and you kind of and both iOS and Android have
have native APIs to communicate to and from JavaScript, so that that's what Strata
does. It just kind of uses those native APIs, gives you an abstraction
layer to send messages back forth from your web app to the native code,
so you can like render fully native components around your web views. So it
kind of just upsto the fidelity a little bit. And let's say you have
like one screen while your app, where apps users spend most of the time,
you can always kind of build that one screen fully natively and then leave
the rest to be web views. So as an approach, I really like
it. The developer experience is obviously it's not without its challenges because you're kind
of working in JavaScript as well, so debugging JavaScript and mobile can be a
bit painful at times. So there is that, But then you're always going
to have some friction with this kind of approach. But on the whole,
I think the amount of time and money you save is huge. And I
gave a talk at some conferences last year called native apps are dead? Long
Live native apps? I think the friendly are we? Uh? I think
friendly RB have put a YouTube video out of this talk, and that was
the whole premise of the talk is that here's a really great way to build
hybrid apps without kind of fighting against the platform, still having access to all
the native features and just like uh, leaning on the web to reduce your
work. Really so I'm I'm curious, like what does a what does a
communication layer look like for the JavaScript to native like aspect of it? Like
let's say you wanted to, like, you know, render a native like
camera component or something like that, right, Like how does that like translate
to like the website. So that's where where strata comes in so you'll have
to write some native code to accomplish that. So like for the way Strata
works is it's a it's a subset of stimulus, so it's actually subclasses a
stimulus controller to another class called bridge component. So that's kind of like the
main centerpiece of Strata. So you would subclass bridge component on the web and
you'd kind of write some logic for whatever camera thing that you want to do,
and then when that component connects to the dorm, it will send a
message with whatever you've defined in that in that component to your native code.
And then you have to have like a counterpart components. If you have a
camera component on the web, you have to have a camera component in native
in the native apps as well, which is like a fully native Swift or
a Cottland class. So that class will receive the message that your web app
has sent and then that can do whatever native thing it needs to do to
make whatever you want happen. And then to go back to go backwards again,
like you would send a message to the web app to like kind of
click an element or or hid an element or something like that in the WebView.
So that that way you can have like a you can have like a
fully in native button that's just a proxy for like a web element, so
you can have like in your navigation bar, you can have like a login
button that's fully native, but all it's doing actually under the hood is clicking
a hidden log in link on your web view. I see, I mean
it sounds. It sounds very similar to React Native in the bridging way.
I don't know a whole lot about React Native, but I think it's just
a different philosophy. Where React Native you're writing JavaScript, but the views that
are rendered are all fully native views. With Devonative, you're rendering web content
for the most fun I say, yeah, it's a different bridge. It
does use the JavaScript core bridge on iOS. Yeah, but the way it
communicates with your app because it's a web app is different from how it communicates
with a turbative apps or not a terminator React native app because the React native
app of the logic is running on your phone using JavaScript and then interacting with
the native views, and so it is a little different. I can see
how that would make for a better experience to run native from a developer standpoint.
I don't know from a user standpoint, but dependent on the app.
Yeah, I think, I like, with any technology, can you can
build good apps so that you can build bad apps with this? I mean,
I've been using Hey for email pretty much ever since it came out,
and I'm perfectly happy with their app, and their app is probably one of
the flag bearers for termor native. But yeah, it's not. It's not
without its problems, and it can be a lot to deal with sometimes.
So like, actually, when I released the update to my book, I
announced as part of that update that the second edition, which will which I'll
probably start working on next year, so it's still a little ways away.
I'm going to remove all the native stuff from it. It's going to be
PWA's all the way, just because they run Yeah, yeah hopefully, but
no, the I like that very much, So okay, just making sure
yeah monopolease right, Well, just just to throw it in. Within the
next week or so, we have an episode coming out from Bruce Lawson and
he talks about the open Web initiatives and how a lot of the yeah PWA
stuff doesn't work on Apple and why and yeah, he he goes after pretty
hard. Anyway. Yeah, Apple's not been covering themselves in in glory recently,
so yeah, yeah, we'd love to see what happens there. But
yeah, my reasoning for it is for removing the native stuff is that I've
got both my feet and the web world. I haven't worked on a production
Android code based since twenty seventeen, and a production Alos code based in twenty
nine teen, and it's just getting too difficult for one person to maintain all
this stuff, especially in an educational resource where I kind of need to know
my shit a little bit. It's it's too stressful and too exhausting. And
PWA is when they work Big Asterisk there are pretty damn good, So I'm
just going to focus on those instead. Right now, RAILS eight is supposed
to be focused on making it work. It is. Yeah, They're supposed
to be a new sub framework called action Notifier as well in RAILS eight,
which is going to be like web based push notifications. So yeah, with
all that stuff, I just feel that I don't need to have a native
section anymore. And like anyone who buys the book at any point will always
have access to this first edition with the native stuff, so it will always
live on if anyone wants. Like, the basics are never going to change,
right, The basics of demnative and strata are never going to change.
That's all I cover in the book. So hopefully it will still have value
to people. But yeah, like it can be a bit much for one
person to try and do all three. So are you targeting Rails eight then
in the next edition? Yeah, I will, Yeah, it's it's it's
gonna be. It's gonna be a paid upgrade. For that reason, I
probably won't start working on it until after Rails eight is out. I haven't
really got any plans for it or anything at the moment, so all I
know is it'll target Rails eight, it'll target whatever new stuff comes out in
the framework. It'll be p w as, and it'll be a paid upgrade.
Cool. I just wanted to call it, I love your little written
by a human tag. You're not. You're not the first person to compliment.
I actually loved nice cheeky thing it was. Yeah, I enjoyed putting
that in there. That's funny. You have to specify these days. You
got to. I mean, how else are you gonna know? Yeah?
All right, well, anything else that we want to go after on this
or look at Chuck, you you've hat you've had some time with my book?
Do you have any I'm just blatantly asking for compliments, you have anything,
So, to be perfectly honest, I started reading it. I mean,
I have to say that this is like the busiest season of my life
ever with Mike. So my kids are finishing up school this week. I'm
the vice chair of the Utah County Republican Party and we're trying to push candidates
over the line. So I've been doing all of that and then I picked
up a contract and the contract is for forty hours a week, like just
to build forty hours a week, and so that's a ton of time.
So I haven't had a ton of time to get into it. I have
gotten through the first bit, I have to say, like the deployment section,
because you talked about deployment here and I just kind of skimmed it because
I deploy using camal To SoC But you know, the setup was fairly good,
and to be honest, some of this, some of this was stuff
that you know was like, oh, I think I kind of knew that,
right, and you kind of explicitly draw it out and point at it,
and so that was helpful as well. And so Yeah, so now
I'm just getting into Okay, I want to build the app that I want
to build. You know, I just barely started creating the iOS app part
of it because I do what I want is and just to kind of give
people an idea, what I'm doing is I'm walking through the book and I'm
building the next version of top end devs. And so because effectively what I
want to build is I keep telling people I want to build the Netflix of
programmers. Right. And it's a little different from kind of what Egghead or
plural Site or some of the others do, where you know, it's like,
hey, go pick up this course. What I want to do is
I want to have a number of series kind of like drifting Ruby or rails
casts or something like that, but for different technologies, right, And so
I would love to have an ongoing series on like hot Wire, have an
ongoing series on just JavaScript fundamentals, right, and so every week you get
a new video so that you can go pick up you know, basic DevOps
some of the other frameworks that we cover on the network, so React or
Angular, right, and so you kind of kind of get the idea where
I'm going. But then the other thing I'd like to do is create sort
of longer form content that's more I guess creative than technical. And so then
it's you know, we have documentaries or maybe an audio what do they call
them, like an audio drama right where you have anyway. I'd love to
have a podcast where people are actually acting right, and so you know,
you get some comedy out of how a team runs right, and you have
just that guy right, that's anyway. So those kinds of things I kind
of envision, and so you know, I want to build a platform that
looks more like Netflix and less like like plural site, if that makes sense.
And we still have the courses, right, so you could still go
through a course and watch Okay, here's the fifteen minute video on how to
set up, and here's the fifteen minute video on how to install, and
here's a fifteen minute video on how to use, like the basics that you
probably would recognize out of anything else that's similar. And then here here's you
know, we're going to show you how to get it all set up and
use it. But I really want to give people the full breadth of what
they can get right. And so if you are getting a bunch of programmers
together you can sit down and you know, watch the thing, right,
whether it's you know, a comedic take on a dev team or a documentary
on how a thing came about, or you know, a technical walkthrough on
how to use beat or something like that. So anyway, and this kind
of hits all of those places, right because you know, you kind of
have the slide out menus and the you know, the kinds of interactions that
you want from things, and I think you can get all of that out
of stimulus and how wire and I've been doing stimulus for a few years now.
But anyway, so I'm just walking through this. But yeah, so
the turbative stuff really appeals to me because yeah, I don't see a reason
why you can't. You know, Okay, you want to watch the videos,
so you pull up the app, you open the app, but the
app just you know, mostly loads in you know, the videos and stuff,
and then yeah, yeah, maybe I have to do some work on
it for some of the native stuff, so that yeah, if you want
to download it and watch it offline, yeah, the website doesn't really do
that. But honestly, I think if you're gonna do something like that,
even through Turbonative. I think the best way is probably just using service workers.
So you're going to be in the web world anyway, and your website
will end up supporting it anyway. Right, Because another analogy I kind of
make, and the talk I gave last year, is that turbonative app is
in a way is like showing your website through a custom web browser. So,
yeah, the app shell, all it is, in effect is is
a custom web browser. Right, the tabs and whatever is just you're like
a little bit of custom chrome around what is effectively still your website, right,
Yeah, And that's that's kind of the point is I can build it
once, I can put this wrapper around it, and then yeah, for
anything that I have to tweak because it's mobile or because your phone has a
different concern than the web does, right, then I can figure those pieces
out. The other piece that I want to figure out, and I don't
think it goes into it in your book, but I haven't seen any other
examples of it either, is I'd love to get turbo native to make my
app run on an Apple TV, right yep, and things like that,
and so you know, just figure those pieces out. But the promise of
the book so far is hey, I can have all those things and so
yeah, so some of the stuff I wind up muddling my way through because
I haven't gotten to that part of the book yet, and some of the
stuff, yeah, I'm just looking forward to it. But the thing is
is that, like I went and looked through some of the stimulus chapters,
you know, I didn't like deeply read or try and implement because I'm working
through the book as I read it, right, I'm not just reading it
for the you wiz knowing this stuff. And it's been really really easy to
follow along with anything that I've done out of the book, so that I
will definitely put forward. And it seems like you're offering up a lot of
the stuff that I want to pick up that I just don't know yet.
So when I go and look at the strata section or the stimulus section or
right, it's like it's like I've been doing stimulus for a long time,
but I didn't know I could do that. Okay, you know, I'm
curious, like if somebody's starting from like start to finish with the book,
like how long until they have something like usable of an app that they can
get a good feel for whether or not they like the framework or the direction
is going kind of thing. So I mean, I start start with a
bit an authentication system, so I think like chapter one is just setting up
the reapers. Chapter two is text only intro to Hotwire. Chapter three you
start actually building something you build like users and sign ups. In chapter four
is authentication, and then it kind of builds from there. So I think
those chapter three and four do give you a good feel of the framework.
But this book is not aim that people who don't know rails. So it's
like I've kind of positioned it as a spiritual sequel to the Rail Tutorial by
Michael Hartle usual disclaimers of no affiliation and all that stuff. But so if
you if you're starting my book, my understanding is you or you're already sold
on rails, you already have a basic understanding of it. So my aim
was never to kind of give people a quick feel of the framework, because
if they come to my book, they already like else was kind of like
my thinking behind it, and hot Wire is now kind of like a part
of Rails as well. So while it's kind of front and center because it's
a new thing that people want to learn about. You could get a feel
for it pretty quickly, because, like I said, chapter two is a
text only intro to what it is, to all the bits of it.
Yeah, I wanted to commit a chunk of time to it, like start
to finish, Like about how long am I looking to like make it through
the book and build an app kind of thing? Just you know, people
out there too are curious. Honestly, I honestly couldn't tell you because it's
an absolute beast of a book. And yeah, it depends on like what
your existing level of skill and knowledge is, because some things will take Like
if you already know certain things, you can go through those a lot faster,
and like you could just like copy paste go it out of the book
and just kind of skim through it if you already know it. But if
you're newer to the framework than those things will take longer. Given the fact
that I actually don't know, I haven't spoken to anyone who has done the
book cover to cover, I couldn't tell you how much time it could take
because I couldn't even estimate it, to be honest, I mean, it
just depends on the person. Yeah, that's exactly right. Because the book
is such a beast, It's so big and detailed. I don't think anyone
could just go into it and just do it cover to cover. I think
a lot of people are dipping in and out of it, which is actually
I think maybe a weakness of the book is that cover so much. But
I did want to build. I did want to write like a comprehensive manual.
So like another idea I'm kind of playing around with it in my head
is breaking the book down into you like a series of blog posts and then
paywalling those. So like you have things like goraels and drifting Ruby for screen
casts, but you don't have anything in the Ruby world for like text based
education, which is like bite size text based rather than like Goreels is like
bite size but video. Right, So I think maybe I could think about
that bite size but text based and then just have a subscription on that and
seed that by breaking the book down into individual blog posts so you can use
the new once product by DHH what's it called work book? Yeah, I
did see that. I did see that. It was another idea that it's
in the back of my mind. I will I'll definitely be downloading it when
they release it and I'll see see what's what. You'll have to download it
and post on the neighborhood marketplace. Yep. Anyway, I'll give you more
feedback as I get through it, but I guess I'm pretty constrained. Once
my kids are out of school, it should be better. Well, it's
good to hear the feedback you've got, and I hope you keep finding value
in it. Yeah. Well, I mean one of the other things that
I'm just going to point out that I'm excited about is, you know,
building your own authentication and stuff, because, to be perfectly honest, I've
never done that before. Oh okay, Yeah, I kind of got the
impression people are afraid of it, which is another reason why I wanted to
write about it, is because it can be daunting. But I don't think
it's something people should be afraid of necessarily. I think people are just afraid
of doing something that compromises there. Yeah, yeah, it can be a
bit nuanced, but I think, uh, with the feature that Rails gives
you out of the box of things like has secure password and stuff, you're
not gonna shoot yourself in the foot too badly. You might make an odd
mistake or something like a common mistake that people make is when you store like
a cookie by Valentino. So when you start a cookie that kind of authentic
is the user. The only thing you put in that cookie is the user
I D. And when it's just that, that cookie kind of forms a
permanent key player app. So if someone gets hold of that cookie, there
is nothing you can do to stop them. And the reel tutorial thought authentication
that way, and it is a very common way of teaching authentication in the
in raels was you just saw the you just stick the user iety in a
in a in an encrypted cookie. So like while a hacker could never see
or modify what the user iety was, they could in perpetuity log in as
that user because there's nothing like the useriety doesn't change, right, there's nothing
you can do to invalidate Thatalu, Yeah you can just yeah, so that's
why. Yeah, So that's why you need a second value. So you
need the useriety and you need like an authentication token, and then you authenticate
the user based on both those things. And if someone gets hold of that
cookie, all you need to do is invalidate that session token, and that
cookie is useless. So it's things like that where you'd end up shooting yourself
in the foot, But those things can be fixed. You won't make some
like an absolutely horrendous mistake if you use the tools that Rails gives you,
because things like has to get pass what it's pretty battle tested, it's been
out there for a while, so you won't make mistakes at the like a
cryptographic level necessarily. It'll probably just make more like product mistakes, which it's
much easier to educate against. Right, makes sense. Cool? Well,
it's it's been fun to kind of get to know your background a little bit.
Cheah. Well, I hope people didn't get too bored of me rambling
on, but it's fun to chat. I find it fascinating. So the
rest of you all, I hope you did too. Let's let's go ahead
and do some picks though and wrap this up. Do you have some picks?
Uh? Yeah, I've got a couple. I haven't been doing a
whole lot recently yet, but I did. I watched Inola Holmes two and
then realized I didn't remember anything about the first movie, so I went back
and watched the first movie as well. But yeah, I can wholeheartedly recommend
both those movies. It's about for any and it doesn't know. It's about
Shellock Holmes as little sister Inola Holmes, and it's very much she's the protagonist.
And the movies are very well made. So like, if you're a
fan of Shellock Holmes like I am, you'll probably enjoy it. And it's
very much like they kind of made the movie in a way that she is
the central character. Doesn't feel like like a bolt on into the show lot,
coms world or anything. It's very entertaining, very well done. So
yeah, those two movies. Other than that, I'm on the current rewatch
binge of Breaking Bad. I mean, I think, is there anyone who
hasn't seen Breaking Bad by this point? So, I mean, have we
not? I know I haven't, I will say. I mean it looks,
it looks fascinating. It's a brilliant show. It's like, I love
Breaking Bad, but I'm a bigger fan of the prequel, Better Call Saul,
which is my favorite TV show of all time. Okay, so yeah,
I rewatched Better CALLSL a couple of months ago, and I realized I
hadn't seen Breaking Bad since Better Calls all concluded, which was in two,
so I figured, why not binge it again? So that's what I'm doing.
So those are my epics in Nola Holmes, Want and Do and Breaking
Bad. Yeah, I know I watched the first and Nola Holmes, I
think I saw the second one. Yeah, so the TV rewatch Binge that
I'm on. I know, I know people are like, what about board
games? I'll get to that. The one that I've been watching is The
Walking Dead. So I watched the first four or five seasons way back when
they were coming out, and then I think I got caught caught up and
I quit watching it. And so now that there are like eleven seasons,
I'm kind of curious to see what I missed in the later video, the
later episode. So yeah, I've been watching that. I've been watching on
Netflix and uh yeah, maybe I'll pick up Breaking Bad next. Some of
these shows, though, they get a little too gritty for my wife.
Ah, okay, Breaking Bad might be something I watched by myself. Yeah,
it can. It can be a bit visial. Sometimes they don't really
it's it's it's not it's not like Game of Thrones. That's not where like
Gore is like a unique selling point of the show. But the right when
they want to make an impact, they don't shy away from it, right.
Well, and that's that's the thing with Walking Dead is because I try
to get my wife to watch it, and she just expressed no interest in
it. But I think the overall premise, the story, the characters,
I think she'd really get into it. But I when I started rewatching it,
I'm only like four episodes in at this point, But yeah, I
didn't realize how much gore there is in it with just you know, I
mean, they have to shoot the zombies in the head and so you see
just you know, they're blowing their brains out and stuff, and it,
yeah, it gets a little bit graphic. I think that's kind of the
impact that they wanted to make though on screen. Right. So anyway,
but yeah, as far as board games go, so I'm going to kind
of pick a couple of things. So lately I've been playing games on board
Game Arena, and that's an online system for playing board games, and they
actually have a developer toolkit for building games, so you can build card games
or board games or whatever, right, and you can put the assets in
right, So you have a scan of the board and you know, a
scan of all the cards and everything, and anyway, it's pretty awesome.
The games that I've been playing on there lately are Challengers, and I've picked
that before, and the other one that I've been playing is Lost Ruins of
Arnac. Challengers is very approachable, fun game is kind of a deck building
game and kind of a I don't know exactly how to describe it. It's
kind of like war, but it's not. Anyway, I really like it.
And then so effectively, every round you draw more cards out of the
pile and you choose which ones to keep in your deck, and then they
all have different values and different powers, and so you know, depending on
how how the play comes out, because you just pull the card off the
top of your deck, you don't know what it is, right you can.
You basically are just trying to beat the other person's last card. And
anyway, it's pretty fun. You can play it up to like eight players,
and so then what happens is you rotate who you're playing with every turn.
Lost Ruins Varnak is much more involved. Uh so you you have work
replacement, you have a tech tree, you have Exploration. It's got a
whole bunch of different elements, but it's it's probably one of my uh more
beloved games that I play these days. So I'm gonna I'm gonna pick both
of those. I'm not going to go look them up on Board game Geek.
I don't remember what their weights are, but Challengers is very approachable for
anybody, and Lost Ruins of Oarnac is more for the hardcore board game players.
And then on the technical side, so I've had a few things that
I've been picking up lately, either because I'm trying to, you know,
learn a technology that I haven't used or haven't used in a while. For
my contract. Right it's like, hey, they're using it, and so
I've I've got to figure out how to you know, model through it and
not make, you know, fundamental mistakes on how I use it. And
I get feedbacks on the prs that I put in, so it's not it's
not bad, it's just anyway. But one thing that I picked up that
I really really like is VAT. So there's a VAT Ruby and Veat rails
gems and we've we've had Massimo on the show. Before I think to talk
about it, but it gives me hot module reloading, which I wasn't really
getting for prop shaft or important maps. And the other thing is is sometimes
I felt like I had to fuss with stuff to get it to play nice
with the important maps and vat Ruby, it just works. So I've been
pretty happy with that. And yeah, now that I'm pulling in stimulus components
and starting to get into using turbo and turbo screens, yeah, that's been
so super nice. The other end of it that I've also been liking.
I never got into writing kind of the what is it feature or system level
tests for rails right. I always wrote my unit tests and then occasionally i'd
write tests for other things if it got complicated. But lately I've gotten into
copy Barra, and it's because my client uses them on their stuff right to
test their stuff that use copy Barra, and man, that's been super nice
once I kind of got the hang of writing those specs. It's nice because
it'll walk through the app and do the things, and you can enable the
JavaScript and it uses the Chrome driver and right, so it'll it'll test my
hot wire and everything because I'm not super keen on testing my front end JavaScript.
Sorry, I just I'm not. And for the most part, my
stimulus controllers are very very simple, right, It's, hey, make this
show up and use the animations that I put on it. I mean,
that's almost entirely what I've done so far. So the only tricky thing that
I've had to do is I've been I've had to figure out how to get
one controller to trigger the method on another controller. Right, So I have
a button that makes something show up, and it's not really in the thing
that makes it show up. So anyway, I've I've had to figure that
out. But are you using what you're using? The outlets API outlets API.
Yeah, that's a mechanism for one stimulus controller to communicate with another stimulus
controller. The the thing that I've been I'm looking at. I'm looking it
up now because no, I didn't even know this was the thing I was
looking at. So on the reference under the controllers it says you can use
an event to trigger the other method. But I'll have to look at this,
because yeah you can. And it's again, it just depends on your
use cases. Sometimes triggering an event is the right thing to do. But
again, if you just look at the reference and on the left you'll see
a section for outlets. Yeah, it might be that outlets, So what
you're looking for in this particular case, Yeah, I'll have to look at
that because yeah, yeah, anyway, I'll dive through it. But yeah,
it'd be nice because all I'm looking for is, like I have a
menu. I have two menus, one that slides in from the left and
the other that slides in from the right. And yeah, effectively, I'm
just looking for the one on the right. I have a button that's you
know, in the middle of my page, and so I don't want to
wrap the whole page in a stimulus component if I don't have to, or
a stimulus controller, and so yeah, I'm looking for Okay, if I
click this link, it's going to open this other thing over here and make
it slide in. So I don't know if outlets is the right thing for
that or yeah, it might be actually, yeah, just like without looking
at the code, it's hard to say, but I have a feeling it
would probably be the simplest way to do it. Okay, sounds good.
Yeah, because I've been I have to say the documentation on stimulus is not
always as comprehensive as I would like it. No, it isn't. Yeah,
and so what I run into is it's like, hey, you could
do this, and you could do this in this way, and it's like,
okay, but my situation is just different enough, or you're not telling
me which parts of this matter and so right, so I'm trying to figure
out, yeah, how to get the gears to mesh, and so I
have to fuss with it to get it to go. So anyway, yeah,
it can be a bit tricky just to yeah, yeah stuff, we'll
look at that. That's good. Yep, that's a good tip. But
anyway, so I am going to shout out beat Ruby that made my life
simpler. And yeah, I'm really looking forward to uh pulling some of these
gems out of this project myself. Anyway, we're pretty much out of time,
so I'm gonna wrap us up and we'll talk about Bridgetown next week.
Yeah sounds good. Another week of me rambling on what could go wrong?
Yeah all right, Well, well next time, folks, max out h