Transcription
So, I've been programming with AI for a while now. I've been enjoying the AI sloppy topy it's been giving me. I've let AI teach me some concepts. I've let it autocomplete some code and I've even let it write all the code for me while I just read it and say that looks good to me. And let me tell you, this is the most fun I've ever had programming.
Now, I know some of you boomers might be saying, "Why not just learn to code properly and actually understand what you're doing and write some good code?" And that's u that's actually a good idea. But no, but if you do want to get better at programming, you should check out my newsletter, Sloth Bites.
Oh, you don't know what Sloth Bites is? Sloth Bites is my weekly newsletter where I share bite-siz programming information to make you a better programmer. And the best part, it's free. All you have to do is give me your email. I won't spam you. I promise.
Now, I understand a lot of people have some issues with AI. They're pretty skeptical, which is pretty fair because the performance can be pretty hit or miss. I won't lie. Especially for longrunning tasks, AI is just not there yet. I do think it's reached the point where it can handle some small projects or small task. It's like when you're trying to help your parent to do something and they just yell at you instead, where we're the parents and AI is the child. [laughter] This is a terrible comparison, but I feel like it can do something.
Now, to me, when it can do these tasks, it makes programming way more fun. You're able to speed up things that are very, very boring. Let me show you how much fun programming is with AI. And I'm going to be showing you this with today's sponsor, Augment Code.
>> We got a sellout over here. Sell out. This is my leak code torture project. I made this a year ago. Wa wa wa. Stop right there. Big deal, sloth. Look at this project. Any AI can handle your little script kitty of a project. You think we're beginners or something? Come on. Talk to me when it works on a real project.
Well, fine. This is the code base for VS Code. Yeah, you heard me. The IDE that a lot of people use, this is the code for it. Engineers for Microsoft work on this. I'm basically a software engineer at Microsoft without the pay. Huh, I'm putting that on my LinkedIn and I'm going to onboard myself a little bit using AI just to prove to you that AI works pretty decently even for code bases as large as this.
So, first I need a task and would you look at that? A list of tasks that people can work on. Want to contribute to Microsoft/V Code? You bet I do. If you're ready to tackle some open source issues, we've collected some good first issues for you. Perfect. All right, let's see what issues we can do. Terminal icon picker. weird placement. This sounds easy. This should be good. The terminal icon picker is positioned at the far top of the window. This looks a bit weird as the top order of the window is not visible. Oh, that's crazy.
Anyways, we have our task for the day. We have our code base set up. We're ready to roleplay as a software engineer. Oh, and for all you open source people, don't worry. I forked the repo and I created the branch. I'm not here to mess anything up. Well, I'll try not to.
So, what's our first step? Well, unfortunately, it's pretty boring. In fact, we've entered our first boring situation. Boring situation number one, learning new code bases. This is pretty boring because nobody wants to read code. They want to write code. They want to contribute. And for big projects like this, it's terrible. There's a lot of code you have to read, a lot of files, a lot of folders. You have to look through the codebase and find where each part is. And when you have a task like I do, you have to look through all the code that corresponds to the task. And even then, that's just a small part of the codebase. If I get another task in a different area, I have to do the whole process of learning it again because I'm probably only going to know the terminal area. But at least with AI, it makes it a little bit more bearable and fun because instead of embarrassing myself by asking some other person how things work, I can just ask AI without feeling judged.
So, let's do it with this task. Now, our task is basically to change the placement of the terminal icon picker. Right now, it always shows up here at the top. But even then, it's too high up. It's blocking that search bar right there. So, we have to move it down a little bit. But we also need to add a brand new functionality. We need to change the position based on how this terminal icon picker is triggered. If it's triggered through the command pallet, it'll show up where it is currently. But if it's triggered through the terminal tabs, so when you rightclick this terminal icon and select change icon, we want it to show up next to it, not in the top middle like it is now. That makes this issue a little bit more complicated. It goes from a simple oneline change to probably a few more lines of code.
The first thing we have to do is find the code that corresponds to the task. Now, we're actually pretty lucky because inside the issue itself, they showed us where that code is. So, shout out to Daniel. He's actually been working on VS Code for almost 10 years. Yeah, he's been fixing our skill issues for a long time. Give him a round of applause. Anyways, we know what part of the code we have to work on. What's the problem now? I don't know how this works. [laughter]
So, in this case, we can ask AI to guide us through this, to give us an overview of how this terminal works. Because the more context we have about this problem, the easier it'll be to fix. Because what if in order to create a solution for this, it's in multiple files, not just this one? You never know. And this is where AI comes in and [music] makes things fun. You're basically always pair programming with someone. You can ask AI as much questions as you want. You can think out loud and give it your thought process. And one of the best parts is I don't have to socialize with somebody. And I specifically like Augment Code for big code bases because it's literally built for it. It has this thing called its deep context engine which allows it to handle code bases of up to 100 million lines of code. They say they can handle monor repos of up to a 100,000 files, too. So, if I'm ever in a big codebase like VS Code, you best believe I'm going to use augment code.
And after asking AI a bunch of questions, I have a pretty good idea of what I need to do. So, a lot of the functionality in VS Code works through these action files. And since we're working with the terminal, we have to use the terminal action file. And inside this file, there's an action called change icon. And what's nice about this is that these actions can actually tell how something was triggered. if it was triggered through the command pallet or through right-clicking the terminal and selecting change icon. And they also have a way to detect when there's multiple terminals, which is an edge case that I did not even think about. I have some console logs to test this out. So, if my logic works correctly, we can actually detect how some things are triggered. And as you can see, I'm on to something because it looks like my logic is correct.
So, knowing this, now we can modify the change icon function to accept a trigger parameter. This will tell change icon if the terminal action was done through the command pallet or through the terminal itself which in this case we're going to call it inline tab to match the names inside the codebase. It's called inline tab because inside the terminal you see this whole row right here that's an inline tab to them. Now I could also make this a boolean and it would do the exact same thing. But I feel like doing it this way it's a little easier to read and it's a bit more flexible because in the future if they ever want more trigger options they can just add more to it. Maybe that's just me. I'm not the best programmer. If it works it works. So, we're going to add that to the change icon. And then we're going to add a console log to see if this trigger is working properly. And if we go and check VS Code, I'm on a roll and I'm a certified Microsoft engineer because it's working.
All we have to do now is modify how it's positioned. And funny enough, if it was the original issue where it was just in a weird placement, this would have been a oneline fix. But now that it's more complicated, we have to think of how to position it based on command pallet and by the terminal. We already have the positioning logic for the command pallet. So, we just have to generate a new positioning logic for the terminal. Isn't that cool, though? In just 1 hour of asking AI and messing around with the codebase, I can start contributing a solution. And I didn't even have to talk to anybody.
All right, so I added some new code for the positioning logic. It works pretty decently. I still need to figure out how to position it properly for the terminal, but we're close. I'm like 90% there. Now, even though this fix isn't perfect, I'm still going to submit a PR in my own version of VS Code. Look, I just don't want to ruin the actual version of VS Code with my terrible code. Okay, leave me alone.
Boring situation number two, writing PR summaries. So, in order to write a PR, I have to summarize the changes I just made. But the code is right there. Just read it. It's literally self-documenting. It is probably what a lot of people are thinking when they submit these PRs. Because let's be honest, not every programmer is a good writer. I know I'm not. How am I supposed to explain this in some concise, professional way that makes sense to other people? Oh, wait. I know how. [screaming]
>> Perfect.
>> No, we can't do that. You have to make sure your descriptions are detailed and explain the what, why, and how.
>> Yeah, yeah, yeah, they're important. I get it. But I don't want to do that. Why can't I just get someone to do it for me? Someone who writes better than me. Oh, wait. We can just use AI to do [music] it.
I mean, it definitely writes better than me. It uses EM dashes and I don't. And it's easy to do. All I have to do is enable the GitHub integration and augment. And after I do that, tell AI create a PR for these changes. And would you look at that? It does it all for me. The person who gets to review this gets a proper PR summary. They get to know what I changed, why I changed it, and it explains it in an easy to understand way. They're going to have a great time. I wonder who's the sucker that has to review my terrible code. [laughter]
Oh, wait. Boring situation number three, code reviews. Not a lot of people like to do code reviews because you have to read someone else's sloppy code. If you like doing code reviews, good for you, actually. You're rare. You're unique, and I like that, but not me. So, I can just have AI help out with the code review process. All we have to do is add it to a git workflow and every time we submit a PR, Augment is going to review our code and we'll get feedback right away. So, if something went wrong, we can work on it right away instead of waiting a few hours for someone to manually review it.
Now, a quick disclaimer here. We do not want only AI to review the code. We still want a person to do it, whether that's you or another person working on the project. Now, I already hear you complaining, "Oh, I have to still review code." Yeah, yeah, yeah, suck it up. We can't automate it just yet, but AI still helps a lot because they'll probably catch all the major issues or even issues we didn't even think about. So, we get an extra pair of eyes looking at the code. I think AI code reviews are awesome. They're not perfect, but they're pretty useful.
Anyways, let's move on to a boring situation that everybody has gone through. Boring situation number four, boring tasks. This one's pretty obvious. Not every task you want to do is fun. Why should we dirty our hands with disgusting tasks like this when we can let AI do it for us? Hey, and don't judge me. Microsoft themselves are doing it inside of VS Code. Look at this. I'm not weird. They're letting AI handle tasks. So why can't we do it? And why should we limit ourselves to one task when AI can handle multiple tasks?
Augment has this feature called remote agent. And these remote agents can work by themselves. They create a new branch, they make the changes, and then they create a pull request. So we can just tell these agents the task [music] and the requirements, and it can handle it for us. And if you don't want to use your IDE, you can still do this with Augment Code's new CLI tool, Auggie. [music] You can create these agents inside your terminal and still take advantage of that amazing context engine. This is called efficiency and they're all working on boring tasks. It's amazing. It's beautiful. It's peak.
Anyways, um let me be completely honest here. I've spent this entire video showing you how AI makes programming fun and solves all these boring problems. But it's not perfect. You have to be careful using it. You can't just blindly trust everything it spits out and call it a day. There are real trade-offs here with using AI. The pros, faster development, less time on boring tasks, better code explanations, you get instant help with unfamiliar languages or frameworks, and then there's the cons. Potential over reliance, forgetting syntax, dealing with hallucinations, and sometimes it just gets things wrong. AI is not magic. It's a tool, a really good tool. It keeps improving, but in the end, it's still just a tool.
Now, if you do want to try using AI for programming, and you want one that actually works well with big code bases and enterprise projects, you should try out Augment Code. I've been using it throughout this whole video. If you want to try it, there's a link in the description for a 7-day free trial. No commitment. Just see if it fits in your workflow. But, um, yeah, AI has made programming more fun to me. Let me know what you think. But, I'll see you all in the next video, whenever that is. Yeah.