Rooftop Ruby Podcast
Two Ruby programmers (Collin Donnell and Joel Drapper) discuss Ruby, web and native software development, technology, and more.
Rooftop Ruby Podcast
15: Apple Keynote, Literal, and Service Objects
We’re both recording from inside our homes for the first time in weeks! We discuss the Apple Keynote, Joel’s progress on his Literal gem, and Collin’s assertion that service objects sometimes just don’t pass the vibe check.
Follow us on Mastodon:
Show art created by JD Davis.
Hey Joel, how, how is it to be back home?
Joel:Hey Colin. Uh, yeah, it's great. Um God, i feel like I'm kind of getting over the jet lag now, so, uh, feeling pretty good. How are you?
Collin:I'm, i'm good. Is it nice and gray there, the way that you left it. Oh, my goodness.
Joel:Yeah, when the the day that I got back, uh, i I took this picture of the sky because I was just like this is so um, what's the word I'm looking for? Like just so typical that the sky was just completely gray. You couldn't see a cloud, because it was all cloud, um and yeah. But the last few days, though, have been pretty nice. They've been, uh, they've been, they've been pretty good.
Collin:I bet you would find the Pacific Northwest to be uh very familiar to you in that way. I think it's uh yeah, i'm looking outside and it is also literally just completely over just one color in the sky.
Joel:And it's like it's not white, It's like sort of gray.
Collin:Yeah, i don't mind it. Um, i, i mean, i really like the Pacific Northwest, um, and I think it is known to like have very similar weather to the UK. Um, it rains a lot here also, uh, and, but when it is sunny, it's incredibly beautiful here, because it rains all the time and it's pretty gray, but then when the sun comes out, everything is beautiful in green. So it's like it's like you're, it's like you're seeing in 4k all of a sudden.
Joel:Yeah, yeah, cause it's, cause it's so well watered. Yeah Right, i don't.
Collin:I don't, i don't know if it's like that where you are, but uh, but I I can get past it being sort of sad and gloomy half the year because the summers are so great, um, so I wanted to share with you. So last week I was fairly effusive about uh co-pilot and co-pilot chat cause I'd been playing with it and I was like pretty excited and I'm still using it. I'm still excited. Uh, my current editor setup right now is actually that I have uh, ruby, mine and VS code just basically open all the time together.
Collin:And if I want to do something that uses co-pilot chat, i go into VS code, and if I want to do something where it's like more comfortable in Ruby, mine I do. That It's not ideal, but it's it's what I'm doing. I will say I don't know if you've had this experience a lot. I have chilled off a little bit on my excitement for AI assisted coding. After about three times today and yesterday I have asked it how do you do this using this? You know, kind of give it the prompt and then it just invents syntax or says that methods are in libraries that just aren't and it doesn't work at all. And then I will say I will say to it Hey, actually factory bot doesn't do that Thing that you just said it did And it's like of course it doesn't. Why would you think that? Are you stupid?
Joel:And I'm like you told me, it did Yeah.
Collin:It's, i'm being, i'm being gas lit by a large language model Uh, right, so, uh. I don't know if you've had that experience at all, but I think that I think that what I'm realizing is a lot of the benefit I get from it is basically two things. One is, um, a lot of times, things finding documentation for things or understanding what the deal with something is is a little, can be a little time consuming, and it's basically like auto generated documentation on the fly, which is pretty cool, except when it invents methods and then it's not cool at all. Um, then it's actually, then it's actually worse than nothing, um, but when it does do that, it's very good. And I think the other benefit is actually just that I know you're really into pairing Um, and I haven't done as much of it, although I should.
Collin:But basically just giving myself permission to be talking to something, like speaking it aloud, sort of uh, and getting like some kind of a response, even if it isn't necessarily the right response every time, i think is a lot of it. It helps me get kind of unstuck where I'm like I'm not quite sure how to move forward. I'll like talk it through with the uh, you know, with the chat bot and then kind of figure out like all right. So I don't end up in a situation where I sort of stop and I'm not sure what to do And then, like I don't know, i'm like maybe I should get a coffee, and then I don't really get back to what I was doing or we get distracted. It really helps keep me kind of on task and productive, i think.
Joel:So it's kind of like uh, so called rubber ducking, where you chat to a rubber duck, try to explain your problem, except that rubber duck might actually give you some, even if it's not the right answer. it might trigger a thought about the right answer or like lead you down a path to finding the right answer. Yeah, or at least get you moving right.
Collin:Yeah, that's. that's pretty much what I think is like for me just to. for me, just like keeping forward momentum in any way is really critical, yeah, and I do think it helps me a lot with just maintaining momentum, and so I do still like it. but I will admit that he will say something and it will just like. it seems like these things never want to say I have no idea, i just don't know, It seems like I don't know isn't really an option for them.
Joel:They will just start making things up if they don't know, And that makes sense because they probably don't see many examples of like questions being asked and the answer just being I don't know right In their training data. That's probably I don't like. If you imagine, if you're browsing, if you're reading the whole internet, like how often do you see people saying I don't know anything about this topic? But like it kind of makes sense to me that they wouldn't be able to say that That's fair.
Collin:I also think like there's obviously some like inference of that it knows about a couple of things and it's trying to kind of put it together. So, like in the example of it making up methods, is because I was it knows about factory bought, it knows what that is, so I was asking it how to do something, and I think it knew that, like active record has this other method, and then sort of inferred that it would also work with factory bought. But I'm like, but factory bought does not have that method, and so it did not work. You know it'll. It's. Yeah, it's both scary and interesting to see how it's going. It'll be really wild to see where this is at in a couple of years.
Collin:Yeah, i am definitely less scared of it than I once was, though, and I would say because I had the realization of this was that whenever something has come along that is supposed to like make programming easier, right, or like lower the bar, the answer has never been that it means we need less programmers. It seems like it is usually that it creates jobs, because what it does is it raises the bar of like sort of like the conceptual floor of what it's supposed to have been, what it's supposed to be and what it's supposed to be. And then it's like well, i think that's the best example of what programmers operate at.
Collin:And so, like Ruby, on rails is a really good example of this right. Like it made doing these kind of crud apps like easier than they had ever been, it did actually created loads of jobs. It created loads of jobs, and so I think that having any tool that can sort of make the productivity and usually actually ends up as a good thing for the industry and for the people And maybe this will be the time it isn't I don't know, i'm just a dipshit from Portland. However, it would seem to me that like object oriented programming and like Ruby on rails and like interpreted languages that have memory safety and stuff in them, all of those things, or like C, what I mean or just like structured programming, all of those things like grew the industry, yeah.
Joel:And I don't you could. You could try to argue that every abstraction we've written on top of zeros and ones is like cheapening the developer pool and like making it like so that there are fewer developer jobs, but it's not true at all. What it's doing is making it so that developers can be productive and create things that people want to buy Yeah, and then people buy them, and so there are then more jobs for developers.
Collin:Yeah, exactly.
Joel:I think it's a really interesting point and obviously there might be a limit somewhere, and maybe this will be the one time.
Collin:Yeah, As I said, yeah, it makes sense. Yeah, it makes sense. This could be the time that I'm wrong and we're all out of a job. However, it does kind of seem like historically, that has never been the case. It seems like it has always been the case that it just actually makes things better, although I mean right now is weird for a lot of reasons, but you know like in the next several years it'll be, i don't know. We'll check back in three years and see where it's at.
Joel:Yeah, I do think it will be a better tool, like more useful, if we can just give it the right embeddings, like, if it was, if it had access to the factory bot documentation when trying to answer your question. right, you could probably have I don't know what the size limit is on GPT4, but, like, imagine if you had copied the entire readme for factory bot and pasted it in above, above where you asked your question. I wonder if it would have been able to do a better job of finding the right method, or at least knowing that that method doesn't exist because it's got like the specific thing to look at. I don't know.
Collin:Yeah, you were saying that last week and I think that's true. That makes sense to me that, like you know, eventually maybe like co-pilot can see all my files, they know they should be able to know what all of my gems are or whatever language I'm working and what all my libraries are. Theoretically like it should be able to provide all of that context. I don't think it is now, i don't think it's providing very much context at all but theoretically, eventually I totally think you're right And that would make I mean, if you think about how far co-pilot's come into like two years or whatever it's existed like, it's not hard to imagine that in another two years it'll be doing that.
Joel:Right, yeah definitely.
Collin:Did you watch the Apple Keynote? I did. Yes, i don't think I messaged you, but I was in a meeting, you know, doing non-IOS stuff, and I was like man, you know, when you're not working with, like Apple developers because they schedule meetings that might overlap with the Keynote, like when you're working in an iOS or Mac stuff, like they don't do that right, they know. But yeah, i don't. What did you think? What were your favorite parts?
Joel:Oh, i don't know. I think there's a lot to think about from that. I think I'm very impressed with the new Macs. To start with, i am very tempted by the Mac Studio, though I don't know. I think I am gonna stick to a laptop. I like being able to just unplug my laptop and take it anywhere, but the Mac Studio does look incredibly impressive.
Collin:It's a really nice machine.
Collin:Yeah, i had a. I still have it, but I was working with. Well, the reason is because when the M1s first came out we're about the time I knew I was gonna leave Apple and so you get a really good employee discount when you work there. And so I bought like everything I got new AirPods, maxes, i got a Mac Mini, i got a MacBook Air, i got a bunch of stuff because I knew it was gonna get 30% or whatever more expensive as soon as I left, and so I was working with the MacBook Air and the Mac Mini for a while. And it's fine having two computers things sync pretty well but I definitely prefer the simplicity of just having all my stuff on my computer. Like there's just a whole category of stuff you don't think about.
Collin:So I did move to a MacBook Pro at some point. I do agree that the. I do agree that the that the Mac Studio looks really cool though It's a really nice machine. It's like two or three Mac Mini stacked on each other. I think the MacBook Air looks really nice. I would be, i think, if they would have had 24 is still a little bit low on RAM. If they had a 32 option, i might have stuck with an air and not gone to a pro. I was really tired of like bumping up against the 16 gigabytes I had gigabytes I had And that's why I went to like. So I got a 64 gigabyte MacBook Pro, which I use like less than 32 of, so apparently I could have saved a little money. But it looks really nice though 15 inches of really nice size.
Joel:Yeah, I wouldn't get the air personally only because at a certain point it starts throttling the performance. Yeah, because there's no fans, because there are no fans And I sometimes do a lot of photo editing It's quite heavy or even just importing photos from my camera and Lightroom has to process them. all Right, that can take even on an M1, it takes a good 20 minutes or something And that's easily enough time to get the fans to kick in.
Collin:Yeah, this does remind me, though, because you know I have all these cores and stuff in my. I think it's a Max. Is the Max the highest one you can get in the laptops? That's the one I have, it's below the Ultra. I have all these cores and I put the little iStat menu icon in my menu bar So you can see all your cores. I'm like I'm gonna see what these do, but the thing is, everything in Ruby tends to be single threaded, so it was kind of depressing, cause I would just see one or two cores light up and then I'd have like eight other little bars that are just doing nothing. So I turned it off. Maybe when I use Xcode the next time I'll put it back in there, cause it's exciting. You'll like it to see them all going, like Xcode really uses it when you are LLVM anyway, really uses it when you do compiles, cause I think that's highly paralyzed. Yeah, so the MacBook Air, the Mac Studio what do you think of the Mac Pro? I have opinions on this. Do you have opinions on this?
Joel:I mean, it's not really my industry. I don't think So. I like it's definitely not targeted for people like me. Even doing really like, like there is nothing that the Mac Pro does for me, Even thinking about like photo editing, video editing, that kind of thing that I couldn't get from a Mac Studio or even a MacBook Pro. So it's, you know, it's not that impressive to me, but I understand that there are people who like, for which the extensions, the PCI extensions, would be really useful, I guess, but I don't know if that's even a very large I think you are much more positive about it than I am, and I'll tell you Yeah, okay, here's why I think they did it.
Collin:I think they're like we said we're gonna do it. We spent all this money on this stupid case. It's like it's a really cool case, right. And then they're like what is the minimum version of this to like?
Joel:say, we did it Yeah.
Collin:And it's like easy to bump. We can bump it when we bump the Mac Studio, because it's basically a Mac Studio Cause, like I don't know if you listen to other podcasts and you've heard this, but like I thought the main reason people use expansion was for, like graphics cards And that's the thing you can't put in the expansion. So like I don't know, And it's like three grand more than a Mac Studio in like any configuration. It I was thinking, like my understanding is that for high-end video people, right, They aren't running Macs, they have like commodity, like Linux boxes that are doing that kind of rendering for them.
Collin:And so they would never be like I'm running 24 streams of whatever, like maybe somebody will, and for high-end audio people, that's all thunderbolt. Now, like Avid is a big one who makes an app called Pro Tools. They also do some video stuff that I'm less familiar with, but Pro Tools used to be one where you had to put PCI cards like back in, like the two. You know the Nauties, as the Zoomers call it. You know that's what they call the zeros, they don't call it the odds, they call it the Nauties.
Joel:Right, yeah.
Collin:You used to have to do that, but, like even that, they just have a thunderbolt enclosure you can get now to put their DSP cards in, Right, I yeah, I seems. I don't know I wasn't gonna buy one anyway, I just like man, it's kind of.
Joel:I can't see many people picking the Mac Pro over the Mac Studio.
Collin:Yeah, i don't. I guess I don't get it, but maybe their plan was they're like listen, we're gonna like, we have this like sort of minimal effort version this year and then next year it will be, you know, cooler in some way.
Joel:Right. That's the only thing I can think like logical reason why they might have to actually done this is they wanna keep this line alive and existing because they have plans for some either like their own graphics extensions or like something.
Collin:Or the quad chip, right, right, yeah, cause the Ultra is the. I don't know, it's like each maybe people who aren't deep in the Apple world are not as familiar with this but each M series chip is. You know where. You have like M1 or M2, and then you have the Pro and the Macs, and then you have the Ultra. They're all just doubling, they're all just giving you more of the same SOC on the same board, or whatever is my understanding. And so I thought, yeah, maybe they're like, maybe we'll do that sometime, so we might as well put a stake in the ground so that, like people know it still exists, but I don't know this one doesn't. But what would it cost then? It already cost $3,000 more than the. It's clearly not a computer for us.
Joel:Yeah, also, who says they can't necessarily put a quad in a Mac studio. right, if they do come out with a quad, it might fit. I don't know.
Collin:Honestly, i don't know, and maybe it'd definitely fit in a Mac Pro, though That case is looks incredibly empty.
Joel:It looks very capacious.
Collin:It's a little comical. I was listening to ATP and John Syracuse was like they have these fans in the front and they're blowing air from the front to the back. They threw nothing. They're just nothing in the middle. What are they cooling? It's very funny, but it is a very cool case. I understand why they would want to reuse it. I don't know if you've ever seen one in person, but they're you. Can you know? they have them at the Apple store and stuff. It's a. The machining in it is very neat.
Joel:I wonder how many of these they've made Like? how many do they expect to sell?
Collin:Like four Yeah.
Joel:They're like yeah.
Collin:Yeah, it's difficult for me to picture the person who would get this over a Mac studio just cause I. But you know, maybe there's something, i don't know. Yeah, and then so, yeah, and then they had that iOS. I think this looks like a really good iOS update, personally, yeah, no, no, no Ruby stuff in the iOS. So that's, you know, disappointing. Maybe next year they'll you know, they'll put a, they'll put a Ruby interpreter there. But I thought it looked really good. I watched the iOS part and then, when they got to the iPad part, there's a coffee shop. I live next to a park and there's a good coffee shop on the air side And I was like, all right, ipad, i have time to go get a coffee. Cause I knew it was just going to be a repeat of, like, a bunch of stuff, any, any new iOS features that were exciting.
Joel:None that really stand out. I don't think like it's all pretty basic stuff at this point.
Collin:It looked like a lot of quality of life kind of stuff. But I, i I don't know. I appreciate it. I mean, they're going to. It looks like widgets got a pretty big upgrade. I don't know.
Joel:Air drop updates look good to me.
Joel:Yeah, that's a big one Like the fact that you can. now it looks like they just they just took airdrop and just made it a lot better, hopefully made a lot more reliable. I love the concept behind the airdrop, but it's often quite difficult to like. two people will have their phones out and they're trying to airdrop something to each other And like the process you have to go to through to get like to the point where you can see the other person on your phones. sometimes it's quite difficult Somehow, even if they're in your contacts like yeah for some reason it usually.
Joel:it often just doesn't work. So that's pretty cool And also like if you go out of wifi range then it falls back to doing the transfer of the internet. I think that's pretty pretty awesome.
Collin:That is pretty cool, yeah, i used airdrop a decent amount just going between my phone and my computer. So macOS for me that's the big one because they named it. It is macOS Sonoma, which you know because I told you right before this but I grew up in Sonoma County And so I'm really hoping it's a good one. I don't want the one named after where I grew up to be a bad one, but I think it looks good It. I'm gonna bring it up right now, but yeah, sort of more like quality of life stuff. Macos, sonoma what did they add in this? I wanna like. I think the widgets thing looks cool. I don't know if I'll use it, but it does look cool.
Joel:I kind of wish that they would bring the dashboard back.
Joel:It feels like they feel like they need to present a bunch of new features for the Mac. Yeah, when what I really want them to say is basically there aren't any new like flashy features, like macOS is kind of gonna stay the same. But here's what we've done in terms of like, refining everything like, and they've just like refined finder to make finder just like the most epic file manager Or like I don't know, worked on some of the underlying like I don't know, like reimagined some of the technology that's in macOS, or like just updated things. For example, it'd be awesome if mail supported JMap and contacts. It'd be awesome if you know you could do like DNS over HTTPS and that kind of thing like natively on the Mac.
Joel:I don't know, i can't think of specific examples, but the Mac just feels. I feel like it does everything I want it to do. I just want it to do that really reliably And like I don't know, adding widgets to my Mac is just not interesting to me personally.
Collin:Yeah, I don't know if I want them to be on my desktop. That's honestly why I was like bring back dashboard, because I kind of liked it as its own little area And if you could have like the new style widgets. it's actually really cool to me that they invented SwiftUI and they're like you gotta make widgets using SwiftUI And now they can do this cool thing where they're like you can show widgets from apps on your phone, on your Mac, because they're all written in SwiftUI. I feel like it's yeah, that's pretty cool.
Collin:There's a lot of things that are easy for them to do. It's very cool. Here's my favorite feature, because I worked on reminders, so I'm reading what's new in reminders Grocery lists automatically sort items into categories to make shopping easier.
Joel:Oh, that's so, Yeah, yeah.
Collin:It's actually a pretty good feature. It was sort of a funny thing when I worked on reminders because we were like adding advanced features to like redo the app And I also sort of feel like there's kind of an acknowledgement and people knowing that, like most people just use this for groceries, like you can add a lot of advanced features to it And like I don't know what. It'd be interesting to me to know what percentage of people ever do anything more advanced than like have a single groceries list.
Joel:But I just wanted to call it out because you know some of my friends work on it, that's exactly what I use reminders for is to have a single groceries list, because I use things by culture code as my like to-do list app. I use that for everything, but it doesn't have collaboration. So if I want to share a groceries list with Jill, we use reminders And also, like it's easy to just ask Siri if Siri will listen to us Like sometimes Siri doesn't listen to us to like, add something to the reminders list or something. The integration. that's pretty good when it works. But yeah, like sometimes, sometimes you find the most crazy thing added to in your shopping list. You're like what is this? It must be something that I asked Siri to add. I'm trying to figure it out.
Collin:It's like a riddle. That was speaking of Siri misinterpreting things. I So I used to use the dictation feature on my phone a lot because I just feel like it's faster than typing it on the little thing with their thumbs. But I did turn it off, and I'm gonna tell you why, because I told What was it. I was like Telling somebody in a text I'm like I'm gonna go, i'm gonna go Get some kale juice like it, like the juice place or whatever, right, mm-hmm, and you might be able to guess this if you're.
Joel:But is that gonna kill you?
Collin:No, it's no worse, worse Actually, i think it should have a special case to not say the thing that it said. Oh no, i think it should be something where, if you actually tried to say a thing it said, it should say kale juice instead. Right, because it said I'm going to go kill juice and I'm like oh god. So I just turned off the feature. I'm like I can't use dictation anymore. Oh, god. That is too big.
Joel:That's awful. I you just can't predict that kind of thing happening in your area. And they're like your, your machine learning models.
Collin:What are you special case? that, though, yeah, be like if somebody really wants to say those.
Joel:Oh, you should definitely special case it. but, like just say, kale juice, how do you know? How do you know ahead of time what all the special cases are?
Collin:There's a couple I think you could guess and I think that's yeah, yeah, um, for sure. Yeah, that's really funny. Um, sir, you're gonna get a vision pro. I feel like at $3,500 you can't afford not to right, uh.
Joel:Yeah, i'm. This is a product that I am. I don't know I might. My thoughts are unrefined. I think I'm pretty excited that they have started making them, because now, if, as long as they continue making them, they're gonna get better every year or so, and That's exciting. Um, i Think that the thing for me would be. I think the thing that got me the most excited about it is this idea of being able to Basically just bring a laptop somewhere and then put this thing on and use your laptop, but with like a giant display. I think that's that's pretty awesome.
Joel:Or like imagine it like if you're cramped on an airplane and you can put it on and feel like you've got loads of space and Like see something on a really big display that's further away than the chair in front of you, or it looks like it is. Yeah, i don't know.
Collin:I think what is cool about it is well, there's a lot of things. One is the technology of it looks nuts. Yeah, i was telling you before that there was a conversation Going on over here about like You know, how does it compare to like you know, like the psvr or like the Oculus Quest or whatever, and my answer Which I thought was a pretty good comparison was that You can't really compare this thing because it has a real operating system with like apps and like a real You know it's. It's so different that it's trying to say like should I get a Nintendo switch or an iPad? It's like yeah, they're both like tablets, but they're Not like. You can't compare that, even if the hardware is like Theoretically similar, it's just like they're not the same thing.
Collin:It's very costly. I I actually did just get a psvr been playing a lot of beat saber and getting pretty good. It's a real workout, it's pretty fun, but I Don't know if I will get one of these In the first version. But I do agree with you. I think they had to put a stake in the ground and be like hey, you know, they couldn't like, they couldn't work on it for 20 years and then release it right.
Collin:So I think that's pretty cool. I think they're like this is a version that does enough useful things that we can put it out and Yes, some people will buy it, i think.
Joel:Yeah probably enough people will buy it at that price that it's worth them carrying on making it, which is great.
Collin:Well, here's here's my thought about it. I don't think I've heard anybody else say, although I'm sure somebody else has said it which is if they ever wanted an Alternative platform to the Mac that could actually like do what a Mac does, kind of, could like have that kind of power, you know, in like 10, 15, 20 years, you know whenever they wanted to pull that lever. This is the first thing that has a like Computing paradigm that I feel like could potentially accommodate doing those same kinds of things.
Joel:Mm-hmm.
Collin:Does that make sense?
Joel:Like you could have windows around you could you know, I mean like it's not like an iPad.
Collin:You know where it's like. Very. I feel like it is limited in a way to where I Have trouble seeing it like fulfilling the same roles.
Joel:I think it's good out of an iPad technically, like if you have an iPad with a keyboard and a mouse, then, like I, i Feel like you should be able to run Mac OS on it, on a 13 inch iPad.
Collin:I mean I, i, but I from from your lips to God's ears, but I Agree, however, just to me. I look at this and I think like this looks like something where, like the things I do on a computer, mm-hmm, it feels like it could get there eventually like it could.
Collin:You know, like just screen real estate is an issue just being able to do the things. It feels like something that could come After something else. It doesn't mean it will, you know, like there's been a lot of flops in VR And who knows if this will be different, but I don't. I don't actually think they're that worried about selling very many of this First one. I think this is really just to get it out there to like developers and start seeing, like what you know, what people can do with it you know what I mean.
Joel:Yeah, i'm less excited about the AR stuff as I am about the VR stuff, though, like I guess I Guess you couldn't really, i'm just thinking, like, the things that are actually interesting about it to me is not how the stuff, like the, the virtual stuff, interacts with the real stuff. It's more like just the virtual stuff, like just sitting down and like putting this thing on and being fully engulfed in This virtual reality. But I can imagine actually, like, if you're trying to use it in a scenario where, like, there could be other people who might want to talk to you or whatever, being able to see someone approaching or whatever it might be, might be absolutely necessary. I do think that eyes are a bit weird, though, and I think that was a mistake, but luckily they can just push a software update to remove that feature.
Collin:I don't think they're gonna remove it, but I think it's less creepy over time. Hmm, i, i, i, i got 10 million subscribers, yeah.
Joel:I think that's insane. I don't think we've done that.
Collin:It's a little silly. I think the one that's silly for me isn't that it's the like virtual avatar for video calls. I don't know why they did that at all. It seems very silly because one So I mean this is something I appreciate about Apple is when they show you something. I mean there's obviously a lot of edited video in there, because you can't show something like this otherwise. But I think the virtual avatar that basically looked like shit to me looked pretty bad. Like he was smiling like this, like like it looked really weird.
Joel:Yeah, they don't have very good sensors on your face. Well, it looks like like not as good as they like me. What is it where you do that on On FaceTime you can, you can like pretend to be an emoji or something.
Collin:Oh, yeah, and it scans your face.
Joel:It uses the face ID thing. It's not as good as that Because it's like it can't. I guess it can't quite see every part of your face, like part of it is covering part of your face. It's got to just guess what's happening there.
Collin:Well, i guess for me, the thing that's weird It's not just so, i was gonna say is I appreciate that when they do show you something, it is usually the real thing. Like they did not show you, like the version they created in a lab like magic leap, i think, was the one who was kind of famous for they just created it all in video and then people actually got it. We're like this is not the same thing at all. Maybe it wasn't magically, maybe it was something else, one of these AR startup kind of things, but I do, i do appreciate that about them. But basically my feeling was this If it's not actually my face, if I'm not actually seeing real people, right, you could actually just show me like the Memoji or whatever, because what is the difference then? like there's no reason to do a video call if it's not actually, if it's still just an avatar That's meant to kind of look like them. I actually don't know what the point of that is, mm-hmm, but I think it looks really cool though.
Joel:I'm excited.
Collin:I've just had regular vision up until this point, so I'm excited to go pro with it, you know. Anyway, i don't know, is there anything else with the? I mean, i know we're, we're, we are Extensively a Ruby podcast.
Joel:It's not very Ruby related. Talk about Ruby stuff.
Collin:But is there any any Ruby stuff you've been thinking about?
Joel:I Mean, i'm not sure I've been. I've been working away on my new library, on My, on my literal Ruby gem. Mm-hmm, it's a literal gem, it is, it is a literal gem.
Collin:I still can't believe you got that name, which is such it's just no me neither.
Joel:I can't believe it was available. It is so good, not only because I can say that I have a literal gem.
Collin:Like you literally have a generally I literally.
Joel:I literally, yeah, but also just because of the, the kind of like. You know how we call, we call things literals when they're like I don't know how do you string literal?
Joel:Yeah, like a string literal right. So it's like, like, like, like it has like literal enums and literal monads and and that kind of thing, and I just think all of that naming works really well. It's also really great for SEO, because if you search Ruby literal, like it's the, it's on the first page. I think it will eventually be on the first result, that's just pretty awesome.
Collin:So so what were you saying? what it? what have you been doing with it?
Joel:Yeah, so I'm trying to get it to the point where I could start using parts of it in production, but I've also been adding a few, a few new features. So one of the one of the things that I really like about typed languages is the ability to define an interface like an abstract interface, either either in Ruby words, like a module or a class, where you could say The contract is, if you subclass this class or if you include this module, then you must define these methods. Right, that's, that's part of the contract. Yes, and we.
Joel:We use this pattern in Ruby a lot and typically people will just define a method that That raises and not implemented error, which is technically the wrong error to raise. It should raise a no method error, but but the technique is essentially the same. Right, we're just defining a method that raises this error, which means you have to exercise the like calling that method on the subclass Before that error is raised, before you can find it. So I wanted to make a way to Have it so that you could say in the in the abstract class, like I, i want all subclasses to define this abstract method Or these abstract methods and then the minute that they subclass like inherit from that class, it's enforced.
Joel:This obviously kind of doesn't entirely work in Ruby because obviously there are ways that you can patch objects So you could define a method later. So the contract is really basically saying, like the first definition of a class that subclasses this class must implement these methods, which I think from the majority of cases is totally reasonable. So I implemented this and it it works by listening for. So there's basically In in Ruby.
Joel:There's this thing called trace point that allows you to listen for specific events and It listens for the class or module end event, which allows you basically to to hook into. Essentially straight after a class has Has been defined for the first time, you can hook in and ask questions about that class. So basically it's just compares like does this class implement the method that is meant to be abstract And is it a different one to the one that was on that abstract class? So I think that that, in combination with the other like type checking stuff, is really powerful because You have more guarantees that, like if you say I expect it to be this abstract type or like a subclass of this abstract type, then you know that you can call those other methods, or at least you have more confidence that you can call those other methods because there's something enforcing them to be implemented.
Joel:So that's that's kind of what I've been working on, and also A way to disable that so that you can, because the idea is that you, you, you have this stuff running In development and in the test environment, but then you'd want to disable in production. It's kind of useless, pointless. It's just gonna make like, in the worst case scenario, it's gonna make your application raise more in production In the. In the best case scenario it's just gonna be really slow Compared to not using it.
Joel:So Any features to kind of like completely disable this, this stuff, do you?
Collin:know, what I really like about all of your gems is that You care a lot about the interface being like Not disgusting, um, and so I look at it and like, oh, i understand this and like it. It looks like Ruby, it makes sense, and I don't, i don't know. It feels very predictable, it feels like, uh, it's a it. It pleases me aesthetically usually and I like that about this as well as, uh, you know, some of your other gems, um, where, like, for example, our spec does not please me aesthetically, i find it very Unpleasing aesthetically.
Collin:Uh, i was in this meeting the other day, uh, where you know, we're talking about something with our spec and it's like, oh, isn't this a synonym for this And this is synonym for this, and did that like four or five, three or four times And it's like, how many things are there in this library that are the same thing? um, i, i do not like That. That does not make me happy, but I, but this doesn't make me happy. So I, uh, you know, good job, thanks. So, yeah, i don't know. Is there anything else we want to talk about? Um, we, we have on our list to talk about. Uh, well, i've been doing a little bit more javascript this week, which is also not ruby. Maybe we could talk about that a different time. But also, uh, something about service objects. Maybe we could use that as a way to get to the end of the day. Objects maybe we could speak about briefly or we could Stop here and then, yeah, we come back to that.
Collin:We can get into service objects.
Joel:Yes, you made some tweets, but before we get into service objects we should probably explain what we mean or define what we mean. To me It means An object that is modeling a single action, like it's essentially a method that has its own ability to have its own private methods. So it is a class that you can instantiate with all of the arguments that you would send to that method And then you can call it and it executes. So essentially it has an initializer that sets up some attributes about that operation or that service or whatever you want to call it, and then it's callable. So you would say such and such, dot new, you pass in the parameters and then you say dot call And call typically doesn't take any arguments and it just kind of composes together a bunch of private methods that do various things based on the data that is stored in that operation or service class. Is that a good description?
Collin:That is exactly how I would describe it as well, but I'm glad you did, because I wouldn't have done it as well. Yeah, so the example I tutored about was I said, yeah, you could have like thingdoernewabcall or whatever, and I guess that. So I'm not saying that. I mean I will create whatever objects I need to do what I need to do. But this pattern in particular and we're talking about things pleasing me in an aesthetic way does not please me aesthetically.
Collin:So I guess the deal with this is that in most cases I think so I'm taking this piece of code and now I have this other small little class that does kind of this one thing, and that makes sense that you would do that in certain cases.
Collin:But I also think, like if I had, say, model object or something, i don't understand the benefit of this If the interface being separate from the kind of thing it's operating on. So a more kind of appealing way for me is to use concerns or something and be able to say all right, instead of having thingdoer or whatever that then takes my model object and does some things with it or whatever, i would have a concern that then encapsulates all of this and I can name space it under that And then also, if I had multiple concerns or modules or whatever, i can name space them under different kinds of model objects and then call them as though they are the same thing. I think that's really cool, that kind of overloading feature you get, and I guess I don't understand why this would be a default you would go with and not that, because this feels very I don't know. This feels like a way to end up with a lot of files that are somewhat disconnected from the thing they're actually operating on.
Joel:Right, Yeah, that makes a lot of sense. I think that people can definitely overuse the service object pattern, like if you have a bunch of service objects that have just one public call method and no private implementation details because this is so complex, which is why we extracted it into a service object like private methods, then you are probably not using that pattern correctly, because why did it need to be extracted into a separate thing? The concern thing it's true that you can have like nicely namespaced concerns that you can include into an object with the data and then you can have methods that relate to specific things in concern, but the methods that you put in that concern are not themselves namespaced or scoped. Once you include it into your class, those methods are callable from that class. So you could definitely run into collisions.
Joel:I think that where a service object is appropriate is when you've got a class that's doing something and it's kind of like passing around, like you have one method that's calling lots of other methods and maybe it's even passing data to them.
Joel:It's not operating on the data that's stored in the class, the instance variables, it's actually passing data around. That, to me, is a sign that you probably need to extract some other object, and oftentimes the object that you extract is just a smaller model that models some smaller part of the data, and then you can just put methods on that. But sometimes the thing that you want to model is an operation. Sending an email is the thing that you want to model, and to me that's where a service object becomes useful, because essentially a service object to me is a model. It's just modeling an event or an operation or whatever you want to call it, and so it's the thing that has the information about that event And you're able to break down and kind of separate all the process of doing that event without having to kind of have too much on some related class, if that makes sense.
Collin:Yeah. So I mean, obviously I'm not against creating new classes, as you need them that do specific things. I guess what I mean is this specific pattern, this aesthetic way of doing it, where you say whatevernewcall. I don't know, That doesn't. I'm not exactly sure why I would go that way exactly versus like yeah, I would have an object that encapsulates some kind of logic. I think another case is that just because it's in a concern doesn't mean that I couldn't have taken the actual complex like code and encapsulated that in an object and still getting called through there Does that make sense.
Collin:So the interface of it is exposed through my model object or whatever, but there is still another class in there if the complexity justifies that. So I guess my thing is as a default, this doesn't. It seems strange to me to have this as a default. This is how you always would do things, as like a blanket way, because it feels like it is. I don't know. I feel like it's making your code feel less understandable to me from an interface perspective. If I looked at your controller or whatever and tried to read it, this feels like it makes it less readable to me.
Joel:Right. Yeah, i think that can definitely be the case with service objects And with all patterns. You can have a good pattern but then use it too much or in the wrong context And it's then not a good pattern in that context. Yeah, i do think that there is definitely places where service objects make a ton of sense. Another example is like and this kind of breaks the rule that I mentioned a second ago, i'm realizing is not really a rule, it's more of like a smell or a potential smell, and that is like if you have something that is just very distinctly different, like a different concern, and actually the best example I can think of of the top of my head is flex. So every flex component is a service object. That's literally what it is right.
Joel:You have a class that defines essentially one method, the template method. It has defined on it automatically the call method that gets used behind the scenes. But you define the template method, you can call private methods, your class gets initialized with everything that's relevant to be rendered into that thing And then when it gets called, it produces HTML. Now you could implement that by saying, instead of having like my articles component and giving it an article, we could just go to the article model and we could add a method to HTML right, and that method would then be responsible for returning the article component stuff.
Joel:I think that that is mixing concerns and that there's a so something about that where I think it's very reasonable to say this is a very distinct thing. That happens with a distinct like set of tools that need to be available to the context of building a view, and that's another example where I think kind of service objects can be useful. And this is like a pattern that I see like all the time is like a class that has essentially one main function And all it's doing is like taking some data and then producing that result.
Collin:Yeah, and that does make sense to me, like in the case of flex or whatever. Like that does make sense to me. I think the thing there is no. I mean there probably are things that are like just generally not something I like. I would say in general, though, i'm just very resistant towards things. Or I don't like when you take like something that is like a capital, a architecture, and you try and like transplant it onto your thing And so it's not about like this makes sense to encapsulate in this kind of service thing that we're going to call from our controller, or this makes sense to put them in concern and then like the interfaces on the model or whatever, to just be like we do it this way, so this is what it is, and then like it has that.
Joel:I do not like that, that does not make me happy as a program to be like okay, so we're going to make this a service object, because we make service objects at this company as opposed to. I think there should be a service object because it's got so much complexity and it just makes sense to model that operation as a thing. That's when you should make that call.
Collin:Yeah. So to me the idea of being like saying like we need to dry this out or whatever, so let's like make it a service object or something right? Maybe I'm getting my terminology mixed up, but to say that feels to be like let me see how to say this. If I looked at my stuff, if I looked at my code and I said I think there is another object in here, like I think there's an abstraction I could make and maybe that is this kind of service thing, that is one thing. If you were to say this is the way we do it, you know, so we do it, because we do it this way, that does not feel like a path to happiness to me.
Collin:Yeah, that feels like a path towards having a lot of very small things that are hard to understand and will make your code base a nightmare.
Joel:Yeah, yeah, i think that is like the art of noticing other, like smaller objects that can be extracted is very important, like being able to do that well, and sometimes it's operations, sometimes it is just other objects, and I do. I definitely see the service object pattern as being, you know, just a subclass of that. right, it's just extracting an object. It just happens that the object you extracted is an operation rather than some other, like modeling, some data. The best way that I know how to do this, aside from just looking at your object, looking at your instance variables or like the attributes that object is concerned with, and trying to kind of make groups of them, you can often find groups instead of trying to make groups. So definitely it's worth looking at them, but a lot of the times you can just find them. You can often find them because if you have methods that are being called with multiple arguments, then that set of arguments might be an object. right, you could potentially just have an object that has attributes for all of those arguments and then pass that one object around. So that's a good place to find them. Another good place to kind of spot them is if you notice that a few methods are passing the same argument or arguments around to each other, then maybe those methods should be moved into an object that has that argument as an attribute, instead of like methods that aren't working on instance variables, so they're just working on whatever arguments are given to them.
Joel:But yeah, i think what's great about Ruby and kind of the object oriented programming that we have in Ruby is you can start. I love that you can start by extracting like a variable, and then you can like go up a level and make that thing an instance method, and then you can kind of go up a level again and make that thing a module and you can go up a level again and extract it as a class or like. there's just there's so many options and I think it's it's important not to skip too many, like skip too far ahead, like oh, straight away. I think like we have to go to the service object, because that's just what we do as opposed to well, maybe we just extract method here or maybe we just like put it in a separate module.
Collin:Yeah, i agree, and I also think that those are really good tips about trying to find where there's sort of classes hiding inside of your other classes. And in my mind I guess I don't want to import a pattern that I'm like now this is the pattern that we use, like this To me the fun of programming is figuring out like where those embedded things are and how they communicate, like that's kind of the whole game to me. So I don't know, but otherwise I don't know.
Joel:I think that's a pretty good place to wrap up to me.
Collin:Yeah, okay, cool. Well, thanks for listening. If you enjoy the show, you know, please tell your dog and your dog's friends about it and get a. give it a review on on dog podcasts And we will see you next week.