Rooftop Ruby Podcast

14: New York, Editors and AI

June 06, 2023 Collin Donnell Episode 14
Rooftop Ruby Podcast
14: New York, Editors and AI
Show Notes Transcript

We're back! This week we talk about Joel's trip to New York, code editors, and AI assisted coding.

Follow us on Mastodon:

Show art created by JD Davis.

Collin:

Hey Joel, how's it going?

Joel:

Hey, Colin? Yeah, going great. Um, I am stateside. So, uh, I've been traveling around kind of New York, Massachusetts, um, pronounce that terribly, uh, Rhode Island. Um, currently, uh, on the way back to Boston Airport, where we are flying out of to go back to London.

Collin:

So you, you came mostly, you were in New York though, right?

Joel:

Yeah, most. So, um, yeah, ma mainly mainly in New York, uh, New York City, which has been pretty cool. Uh, my first time. currently at the beach, um, and, uh, calling from a car, so, Um, yeah, it's been, it's been tricky. It's been a lot trickier than I thought to find places where there's a stable internet connection and it's quiet enough for me to do a podcast, um, which is why, uh, it's entirely my full week, completely missed, missed, um, our usual weekly date when we put the podcast out, but, um, hopefully it won't happen again.

Collin:

Yeah, it's all right. I mean, if anybody understands that it's difficult to find places to do this when you are in weird places. It, it's me. Um, although I like the idea that maybe our show for at least a couple of, uh, a few weeks is the one where one of them is always in a weird location.

Joel:

Right.

Collin:

I think that's kind of funny. so have you tell me about this trip. What have you seen, what have you done? Like, this is your only, you've been to United States like once before, I think you told me. Or like what, what, what's it been?

Joel:

Yeah. So I've only been to the United States once before and it was for a Rails comp, uh, and that was in Pittsburgh. So I was there for like three days. Other than that, I don't think I've ever been here before. Um, so this has been very different. This has been. Uh, wait, like, I think something like 10 days. Uh, we've got a car, so we've been driving around. We've seen, uh, let's see, we've been to New Hampshire. We've been to Massachusetts, uh, New York, uh, Connecticut, Rhode Island. Uh, and we, we are back in Massachusetts in, um, near Cape Cod at the moment, uh, kind of on our way back to Boston.

Collin:

that's cool. Uh, any, any highlights, any, any favorite spots? Uh,

Joel:

Oh, so many. I mean, um, yeah, it's like, it's just so different. Um, the culture's so different. Uh, one of the things I noticed immediately after kind of like getting out. Of the airport of Boston and, and kind of like, you just kind of notice that A, it's a lot brighter and seems happier here. Um, and the people seem happier. I dunno if that's just like an outward visa, but, um, people seem really happy here. Um, But yeah, I think, ah, I'm trying to remember. Like it's the, yeah, it's probably the freedom. There's, we've been like all over the place and, you know, seen some amazing things. Um, I don't know what my highlights are. I, I really enjoyed checking out, um, the location, like the set to one of my favorite TV shows, Mr. Robot. Um, so we went to, um, To Coney Island, and we actually found the building where they filmed, uh, you know, the, uh, I dunno if you've seen Mr. Robot, that, but there's this building where they do the hack from, and it says outside, it says F Society because it used to be fun society, but the, the u and the N fell off the building. Uh, anyway. And it's like this old, um, kind of like closed down arcade. Uh, And we actually, so we found the building and actually I thought like the building would just be completely different and there would be some different set that was the sold arcade, but it's actually the, it was the set. Um, and the manager led us in, like showed us around, told us there's stories about, you know, working with Rammy Mallek and Christian Slater. And, um, yeah, it was just, it was a really cool experience. Unfortunately, the, um, the Coney Island, like Coney Island itself was closed the day we went. It was opening literally the very next day, which kind of sucked. So I didn't get to go on any of the rides, but, um,

Collin:

I've never been to Coney Island. I've been to New York, I've been to the East Coast a little bit. The the funniest part of this story for me is that you're, like, people in Boston were just seemed happier cuz like, I do not feel like that is the stereotype of people from Boston, but,

Joel:

No, maybe it's cuz it was Friday as well when we arrived.

Collin:

That's true.

Joel:

Like Friday evening.

Collin:

I also don't know what people are like in England. So, um, it, it's, you know, it's a comparison thing. I, I really like Massachusetts. Um, I also, I also like Pittsburgh. Cuz you, you said you were there before and my feeling is that P Cities in the United States. Yeah, I think P Cities, Portland, Pittsburgh, Philadelphia. I think they all, uh, they're all underrated. I think P cities are the way to go.

Joel:

Right. Yeah.

Collin:

Uh, I think that's all very cool. It's very exciting.

Joel:

Driving here has been an experience, so yeah, like I, it's not just driving on the wrong side of the road that, that's weird. Everything is quite different, but also somewhat the same. So like, um, Driving an automatic is also really weird to me. Um, I was not able to rent like a manual transmission car, so I've been driving this automatic and it's so weird. I just can't get the hang of it. Um, but yeah, like the roads are so big and yet the speed limits are so confusing. They're like, And hard, hard to spot because like, like in the uk, you can spot the speed limits because they all have this really distinct round sign with the red ring around the outside. And then here, like all the signs are the same. Uh, it's just like all caps, black text on a white background. Um, but yeah, it's, it's kind of strange, I guess maybe because it's so remote, like it's difficult to get to places. I don't know, things are just a bit like. I don't know. Confusing?

Collin:

I can't believe that you can fly to a different country where they drive on the opposite side of the road and be like, I'd like to rent a car, and they're like, sure.

Joel:

Mm-hmm. Mm-hmm.

Collin:

Like, it seems like you shouldn't be allowed to do that.

Joel:

Yeah, it's, it's not that crazy. I, I did get to a, a red light once and I was like, I think you can turn right in the u in, in, in the US on a red. But I don't know. I was like a bit concerned. Um, and I made sure I looked it up immediately afterwards, but like, I was like, I'm just gonna be sat here and people behind me are gonna be getting so angry because I'm not turning right on the red. Um, but I also don't know for sure if I can, um,

Collin:

Yeah.

Joel:

looked it up and apparently you can.

Collin:

Yeah. Yeah, you can definitely turn right on a red. Um, I think it's, it's probably our main cultural advantage. Uh, but I'm, I'm, well, I'm glad you didn't die in a car accident because, uh, that I wouldn't have anybody record the podcast with. That'd be very sad for me. Um,

Joel:

yeah, it's been, it's been great that I've, I've really enjoyed being here and having a car and being able to just move around all over the place. Um, I feel like I've seen America a lot, like better than I did when I was just in one city kind of trapped, walking around on foot. Um, I don't know.

Collin:

Yeah, for sure. I mean, cuz you're gonna see a lot more kind of weird stuff like just stopping in places, right? Like it's not as centralized. That'll that, that makes sense to me. Um, we need to get you to the West Coast for sure. So you can compare, I think you can skip over most in most of the things in the middle. Um, but I think you should come to the West

Joel:

I'm gonna come out there in the winter sometime, I think, and try and do some skiing.

Collin:

That's awesome. Yeah. We have great skiing in Oregon. We have, uh, you should look at Mount Hood. Um, Apparently it's a, it's a, it's a big skiing thing. Uh, and obviously there's lots of other places, but we have very tall mountains on this part

Joel:

Yeah, exactly. Yeah.

Collin:

before on the show.

Joel:

We should get into some Ruby related things.

Collin:

yeah, so speaking of things other than travel, uh, I, I can't stop switching editors. I think it's, it's become a real problem for me. Uh, so. I know you're pretty married to Zed. I feel like Zed is like your heart editor, right? It it, it seems like it really speaks to you.

Joel:

Yeah, it, it is now for, I had a period of time between like basically giving, so I held onto Atom for as long as I could. Uh, but. After a while of it just not getting any updates at all, I realized I had to switch and I had a period of time where I was switching between. Like sublime text, text mate, uh, vs. Code N. And then I tried Nova when, when the new version of Nova came out and I quite liked that. And then I would like switch back to Atom and be like, Atom's still the best, but it's also kind of slow compared to these other things. Uh, and I couldn't find one I was happy with, but I have, I have now settled on set, I think. Yeah.

Collin:

so I, I mean, yeah, I've used all of those editors as well. Um, the ones that I've kind of been jumping between are, uh, Nova, which is by panic, and you mentioned it. The reason I like Nova is because I. It feels the most Mac like to me, which is something I appreciate, but also that, I don't know, Mac like to me isn't just like, it's not just aesthetic, it's also kind of the way it works. Like for example, uh, if I wanna set up like a build system, it doesn't send me to like, Some JSON file or if I want to edit my preferences, I don't get sent to editing json. It has a proper Mac, uh, you know, UI for doing those things, which is kind of what I think of as like the Mac like way to do it. You have a UI and that's good. Um, the issues I've had with Nova have been that the quality of the extensions are pretty hit or miss.

Joel:

Mm-hmm.

Collin:

And so, you know, cause it's a smaller, uh, ecosystem, right? Cause it's, it's a, it's a smaller, uh, group of people who use Nova, I think. And so a lot of times, like, you know, maybe there's like a couple of extensions for doing something with Ruby and like neither of them really works that well and they haven't been updated in several months.

Joel:

Mm-hmm.

Collin:

Um, and so, you know, that's an issue for me. And then I looked at Zed. Zed seems cool. It has a lot of the same benefits as Nova to me of that it's kind of fast. Uh, you know, the UI is very fluid. It's not as native feeling to me as Nova, but you know, more akin to something like Sublime Text or something like that. Um, and I, I, I like it, but it also doesn't have all the features I want. I really wanted something with a debugger in it, like a debugging ui.

Joel:

Right.

Collin:

That led me to RubyMine, which is like a full ide and I like that. Um, I think you can be very productive in a heavier sort of system like that. The nice thing about something like RubyMine is things like auto completion and other code intelligence kind of tools. Just like work out of the box. Um, you don't have to do anything to set them up and that, uh, you know, it's got a debugger built in that works out of the box. Um, and I've been using RubyMine, but it, um, you know, it's like this Java app. It's very big and heavy. I don't think that the, I don't, not, it's not an aesthetic problem for me with the ui. I mean, it's not like an attractive app to look at.

Joel:

Mm-hmm.

Collin:

But I think that the issue I have with RubyMine, um, design wise, is more that their information hierarchy is what I would describe as batshit.

Joel:

Oh

Collin:

does not make sense to me, like I. There's a certain way, if you've used a lot of apps that you think like, okay, I kind of know how things are laid out in a Mac app, that like, this is probably where it would be. And that is not how RubyMine is just its own thing.

Joel:

Mm-hmm. It's probably consistent with other like IntelliJ editors. Right. But it's not consistent with. You know, being a Native Mac app or something like that, I find it's incredibly difficult if you're like, oh, I want to change this preference. Like I tried using RubyMine on, on my, uh, on some of my open source projects and in all of my open source projects I use tabs instead of spaces cuz I think it's better for accessibility.

Collin:

Correct.

Joel:

I was like, okay, well RubyMine will obviously respect the editor config. It didn't. So I was like, I wonder if there's a way to change RubyMine to use hard tabs instead of spaces. And I spent like 10 minutes searching through the preferences to try to find that option. Couldn't find it, gave up, like just couldn't find it. I still to this day, dunno how to do it.

Collin:

There's definitely a way, but I would agree that in particular in RubyMine, the. The way the settings are laid out is just like, it's got like project settings and global settings, and they're kind of mixed together in a weird way sometimes. And it's, it's, very, it's very confusing in that way. And they, you know, they have a new UI they're coming out with, but it's very like skin deep. It doesn't really address any of those problems.

Joel:

Right? Like information, architecture problems. It's more like a visual skin, but not actually changing where things appear in the. In the interface.

Collin:

Yeah. So I would say the way I would think of it kind of is everything that Nova is great at as far as like being a app with a really good information architecture and like having things where you might expect them and having good UIs for things, uh, RubyMine is terrible at, and sort of vice versa a little bit because. All the like, code intelligence stuff just works out of the box. You don't even need extensions in RubyMine, which Nova does not have that advantage. Uh, and so, you know, if you could put'em together somehow,

Joel:

Yeah.

Collin:

would be pretty amazing.

Joel:

Yeah, like RubyMine has really great code, like intelligence support and stuff like that. Like I think they have kind of essentially Solargraph built in, but I don't think it is solo graph. I'm not sure exactly how they do it, but they seem to do it even better than, uh, like existing tools

Collin:

Yeah, it's way better than Solargraph.

Joel:

They must have their own language server for Ruby somehow. Um, that is the best one right now, and it's only available within RubyMine. Like they haven't made it so that you can use the same language server in Zed or, or anything else.

Collin:

I don't even think it actually is a language server because, uh, inte j's code intelligence tools predate language servers like the protocol. So it's kind of just their own thing. But yeah, it's a lot more powerful than what you get with Solar Graph for any of the, uh, other options. And you can, you can get solar graph to work better if you like, configure it correctly, but it's, it's never as good as what RubyMine has. I don't

Joel:

Sure.

Collin:

be. But it can, it can be pretty close. Um, so then the last one on the list, uh, is, is is one that I think you've actually unintentionally pushed me towards, which is, uh, visual Studio Code, which

Joel:

right.

Collin:

not an app. Yeah, not an app that sparks a lot of joy for me. I, I, I don't really love anything about it. I don't. Hate it necessarily. It's just kind of there, if you know what I mean. Uh, but you had told me, cause I had mentioned to you that I had been, uh, using ChatGPT for like, kind of, uh, you know, sort of as a pair programmer to be like, I'll paste in some code and I'll be like, Hey, did I do this right? And it'll be like, yeah, blah, blah, blah. And it'll like, gimme information about it or, um, I can be like, you know, given that if I had these models and I was doing this, What is the thing that I'm trying to, you know, like I know what I want to do, but I may not know the exact, uh, mechanism for it. And I will ask and it will usually give a pretty good answer. And you had, uh, told me that if you get on the beta of uh, vs code and they're like insiders thing for, uh, co-pilot. That now they basically have that built in to the editor, which I did get, and I'm trying, and I think it's probably going to keep me in vs code at least until that is available in other editors because co-pilot is available in other editors. And, uh, but this, I think, you know, the, like beta features are not right.

Joel:

Right. Yeah. I expect that basically once they've be like beta tested, these extra features for co, for co-pilot, they will want to have them. Available in all of the other editors that support co-pilots. So I expect that will change soon-ish. Uh, I've actually not used these features, but I can imagine they're incredibly powerful. Like being able to just select some code and then write a question about it or some, I think is the kind of thing that you can do now in vs code. Um, that sounds like a really great way to integrate ai.

Collin:

An example of that is you can, uh, select your code or you can just have code in an open, an editor and then say, write tests for this, and it will examine all of the code paths or whatever that could happen in based on, you know, your code and then give you tests for it, which

Joel:

Yeah. That's great. Yeah, you can kind of coax co-pilot into doing that for you. Like if you begin to write a test for something or you name a test, um, like you can say, specify and then type the name of the test and, and it does a pretty good job of auto completing the implementation of that test, especially if you have, I've noticed if you have a tab open, Where the code that you're testing is, then I think co-pilot kind of prompt, like includes that buffer in the prompt somehow. Um, and they do a pretty good job of that, but I can imagine it's even better with, uh, like this direct like chat interface, uh, in, in VS code. I think that's a really interesting reason to, to wanna use VS code over, over other things, at least for now. Um, I would say like, The reason I'm happy with Zed is it does have pretty decent Ruby support in that. Like they have first party support for solo graph, like built into the editor and it does just work really, really well. Um, they also have co-pilot, uh, which is great, although it is just the basic like standard co-pilot auto complete at the moment. Um, and. I know that they're really interested in pushing the editor further in terms of like language service support and um, like AI and co-pilot, that kind of thing. So, for example, I imagine they're gonna be pretty early to adopt this new co-pilot interface. I also know that if someone else comes out with, or I'm pretty confident that if someone else comes out with a better ruby language server, like for example, um, I know Shopify's working on Ruby lsp. I expect that once Ruby LSP is better than Sonograph, uh, that Zed will switch to using that as their default Ruby thing. or they'll integrate the, give you an option, maybe integrate the two of them. Like I know right now Ruby LSP doesn't support, um, like IntelliSense kind of auto complete anything like that because it doesn't. Uh, it doesn't do any kind of type inference, I'd think. But, um, yeah, I think for, for me, that's like that combined with the fact that this editor is just so clean in terms of its interface doesn't really get in the way and so fast. Uh, like, it's just, it's great for me. The oth. The other thing I use in, in z uh, which I haven't really ever configured in anything else, I wonder if you could get it working in other things, is I've configured Z so that when I save a file it will run the rubik cop auto com auto corrects on that file and save those, uh, which I think is pretty neat if you're using, um, Rubik Cop kind of as a formatter. It's really nice that you kind of get that immediate feedback from, from Rubik Cop rather than having to wait until you've, like, maybe you've committed a change and you push it up to GitHub and then the CI comes back and says, Hey, is a problem. You have, you've, you know, you've broken this rule or whatever. Um, that's like a really like unpleasant experience as opposed to, Uh, like you, I just saved the file and it automatically formats it the way that it's compliant.

Collin:

Yeah, I think, I think you can usually get that working in most editors, but it depends a lot on like the extension and the support and like whatever. Um, yeah. It's funny because I'm actually, I. Sort of in my heart conflicted about the AI tools. Like, it makes me feel a little bit uncomfortable to be, to use them at all because I'm like, uh, it's not that it feels like cheating, it's just like, um, I don't know. It's, you know, things are changing very quickly and who knows where it'll be in a couple more years. At the same time, me feeling uncomfortable with it doesn't change the fact that it, I think, will continue to be a thing that exists. And because of that, it feels like the sort of thing that if I don't adopt it, it's like a new technology. And I think the history of people who did not get on the new technology and take advantage of it when it was available, uh, thing it. It has not been good for those people who chose to ignore it.

Joel:

Not just when it's available, but when it's good. Like, it's already really good. Um, it, you know, it makes mistakes. It can, it can like make up APIs. I found it, it can do that. But, um, you know, if you're writing tests and you're, you know, or, or even just manually testing your stuff, like you're gonna make sure that those APIs actually work. Um, and, you know, it's, it's not, I don't know. I, I can, I can see why people could be concerned that, you know, it could introduce a bug or whatever, but I don't think that it's like, Significantly more likely to introduce a bug than a human. Especially when it's monitored by a human, know? Um,

Collin:

bugs all the time. So I

Joel:

yeah, exactly. Yeah, exactly. And, and like, I don't know, the bit, the bits of copilot that I've used, it's just so good. And I just always read what it writes very carefully as if I had written it myself. Um, Like I, I sh I sent you a screenshot the other day of how I use it to like do refactoring. So like, you have one way of doing things, uh, like you might be, um, I don't know, you're assigning, assigning a bunch of variables to a hash or something, uh, and you want to, uh, change it. So instead of like that, you're gonna pass them to an argument or, or something like that. You can kind of like copy and paste the old way of doing it. And then comment that out and start writing it the new way. And it's just so good at being like, oh, you're, I can see that you're trying to refactor these lines into these lines where it's a slightly different interface. Let me do that for you. And every single line, it can just predict basically perfectly well, like I've had like 99% accuracy on, on that kind of refactoring.

Collin:

Yeah, when it works, it's pretty amazing.

Joel:

Yeah. Yeah.

Collin:

Yeah. No, I, I feel like it is a thing, which is, it's pretty good. It's going to continue to get better. And if I tried to ignore it, then in a couple of years I'm going to be, you know, I don't know if competing is the right word, but, you know, they're, uh, new programmers are coming out every day. Right. And

Joel:

right.

Collin:

if they're all using this thing, that helps them and I'm not like, I don't know. I feels like I should be using every tool at my disposal

Joel:

Right. Yeah.

Collin:

the way I'm interested when you do, uh, Try the chat interface. What you think, cuz that's actually the thing that I use more, uh, than, yeah, than like the co-pilot suggestions in the editor. Um, and I think the reason I use it more is because a lot of times what it helps me do is I am like, I, I know what I want to do, but I'm not exactly sure what the best way to do it. Or like, You know, to figure that out and being able to sort of have a conversation with something and get that answer is very useful for me.

Joel:

I am gonna have to try that out. That sounds great. I kind of used like ChatGPT directly for that. Um, but yeah, I think, I think it would be awesome to have that built into the editor. I'm really interested in how far GitHub can push co-pilot in terms of having. A chat that knows the language and the frameworks that you're working with as well. Like, I don't know how much of this they're doing, but um, they could definitely prompt G P T cause I know they're using GPT 3.5 or four behind the scenes for this stuff. Um, Like that was trained at a certain date and it knows, you know, it knows, I don't know, Ruby, up to two seven maybe, or maybe three. Oh. Um, but how does it know the latest Ruby api? It probably doesn't. Um, how does it know, you know, the latest Rails API for the beta version that you're testing that was released a couple of weeks ago? You know, almost definitely doesn't, um, but. What GitHub can do, uh, with co-pilot, I think is they can help. Like they, they get to design the prompts that go out to G P T. So, um, I think that they can do things like, um, like find relevant API documentation to reprompt it with, or like use the L S P to figure out what kind of object you're working with, and then send the relevant a p i documentation for that object. So that co-pilot has even more context to be able to give accurate answers. It doesn't end up like having to guess the API for something because you know it's just been sent the API documentation for that object that your LSP said you were using, if that makes sense. I think there's loads they can do in terms of that or like scan your gem file, figure out what gems you're using, and then, um, find, uh, Unlike Ruby Dock, all of the GEM documentation for those gems and include that, uh, in the, the, um, what is it they call it? Um, is it bindings? I can't remember what, what they call it now. But basically where you have a database of, of local information that is indexed by G P T, um, and then you can search. A vector database to find the relevant, um, the relevant information. And you can include that with the prompts to G P T so that it's got that kind of like, relevant context. Um, I just think there's so much more that GitHub could do around, around that without even G P T getting better. Right. Just with the existing technology, uh, and the existing like training sets, it can, they can make it better just by improving the prompts.

Collin:

Mm-hmm. Yeah, I was act, yeah. I was also, uh, thinking about that earlier today, you know, cuz when you talk to chat g p t it will say like, you know, as of 2021, whatever, when I was trained, Um, so I was also thinking about like what they could do and that, that all makes a lot of sense, what you said. I think there probably is a lot they can do,

Joel:

The, the word I was looking for is embeddings, and, and that's where you can. You can just like pre-ex this database of information, uh, and you get the open AI vectors for the information. Then you can query it using a vector, uh, and, and then it will give you the information to prompt, uh, to prompt. The ne like the, the ai, like the Q p T four question, um, with, if that makes sense. So, so you are asking this bot that was trained a couple of years ago, um, you're saying, Hey, can you answer this question, but also here's some relevant information that might help you answer it. Right. And, and it's able to just do that on the fly. I think. I think that's basically, that's the way that we can kinda advance this technology, uh, and, and. Definitely like being able to hook in and use the language server that's already there, um, and index the, the stuff that's already there is, is is the way to go for that.

Collin:

Yeah, for sure. That makes a lot of sense. Alternatively, it, uh, it's, it's made me think I need to, I need to get into management or something the next couple years before this, uh, before this replaces all of us. Um,

Joel:

Yeah.

Collin:

but, um, so, yeah, so for now I'm using VS. Code I. Yeah, I think it's really interesting. It's, um, it's scary to think that this is early days. Do you know what I mean? Like, it's scary to think that this is the, like iPhone zero version of this, this is like the, the simplest babiest version it's ever gonna be like, it's a little scary to think of, like, what will this look like in like, You know, a year or five years or 10 years, it's, I think it's going to change things a lot. I don't think, I think we're pretty far from, you know, uh, not needing programmers, but I think that being a programmer without using this stuff is going to be difficult over time. I think it's gonna become a pretty essential tool.

Joel:

Definitely. Yep.

Collin:

Um, anyway, uh, we had some other stuff about service objects, domain op, et cetera. Um, do you wanna talk about that or do you wanna save it? We could, uh, for the next episode and just keep this one short.

Joel:

Um, let's keep this one short. Let's wrap up here.

Collin:

I think keeping it short this time, cuz you're recording from a car at a beach and you should probably be enjoying the beach ideally, uh, is a good idea. So, uh, let's just wrap up. Um, if, uh, you know, if you like the show as always, please tell your friends, subscribe, all of that, uh, and otherwise we will see you next week.

Podcasts we love