🎙 Develpreneur Podcast Episode

Audio + transcript

AI, chat GPT, and its applications in coding

In this episode, we discuss the growing interest in using AI to solve problems in coding. We explore specific applications of AI, such as generating documentation for code and automating repetitive tasks.

2024-01-01 •AI, chat GPT, and its applications in coding •Podcast

Summary

In this episode, we discuss the growing interest in using AI to solve problems in coding. We explore specific applications of AI, such as generating documentation for code and automating repetitive tasks.

Detailed Notes

The use of AI in coding is becoming increasingly popular, with applications such as generating documentation for code and automating repetitive tasks. However, it's essential to remember that AI is not a replacement for human judgment and decision-making. In fact, AI can sometimes make decisions that are not in the best interest of the project. Therefore, it's crucial to carefully consider the use of AI in coding and ensure that it aligns with the project's goals and objectives. In this episode, we discuss the growing interest in using AI to solve problems in coding and explore specific applications of AI. We also examine the importance of human judgment in AI decision-making and provide examples of how AI can be used to improve efficiency and productivity in coding.

Highlights

  • Using AI to generate documentation for code
  • Chat GPT's ability to summarize code and provide precise results
  • AI-powered code review and debugging
  • The potential for AI to automate repetitive tasks in coding
  • The importance of human judgment in AI decision-making

Key Takeaways

  • AI has the potential to significantly improve efficiency and productivity in coding.
  • Human judgment and decision-making are essential in AI decision-making.
  • Careful consideration is required when using AI in coding to ensure it aligns with project goals and objectives.
  • AI can automate repetitive tasks and generate documentation for code.
  • AI-powered code review and debugging can improve code quality.

Practical Lessons

  • Use AI to generate documentation for code to improve code readability and maintainability.
  • Automate repetitive tasks in coding using AI to improve efficiency and productivity.
  • Use AI-powered code review and debugging to improve code quality.

Strong Lines

  • AI is not a replacement for human judgment and decision-making.
  • Careful consideration is required when using AI in coding to ensure it aligns with project goals and objectives.
  • The use of AI in coding has the potential to significantly improve efficiency and productivity.

Blog Post Angles

  • The potential for AI to revolutionize the coding industry.
  • The importance of human judgment and decision-making in AI decision-making.
  • The benefits of using AI to automate repetitive tasks and generate documentation for code.

Keywords

  • AI
  • chat GPT
  • coding
  • documentation generation
  • code review
  • debugging
Transcript Text
Welcome to Building Better Developers, the Developer Nord podcast, where we work on getting better step by step, professionally and personally. Let's get started. Well, hello and welcome back. We are driving right through the season. We are getting close to the end. We've had a couple of really interesting conversations, which gets us to our special topic this episode. We're going to look a little bit or really just throw some ideas out related to AI, chat GPT and things like that, because we're starting to see a... explosion is probably a little overstated, but we're definitely starting to see a growth in interest in using AI to solve problems. There's some things out there that just in talking with a few people, working with some customers and that, that are some areas that are pretty cool, that are some neat uses that I think if you haven't already dove, you know, gotten into it and taken a look at it, a couple areas where it may be very valuable for you to start digging it, like, I don't know, scratching the surface of it at least. See what's out there, see how it works for you. Of course with most of these, just like, for example, if you use any of the content driven AI stuff, Grammarly has it, there's also a lot of little tools out there, Word and word processing tools have been playing around with this for a while. So they do have these make it sound like X, you know, make it more persuasive, the kind of AI filters that you can run stuff through or make it sound friendly or make it sound scholarly or things like that. Make it sound like it comes from a pirate, you know, whatever it is. Those as I think if you've played around with them all, you know that those are, they're a start, but there's always going to be, it's going to require you to, a human to take a look at it and sort of know what they're trying to communicate, how they're trying to communicate and where they want to go with it. You know, the AI just gives you, it's almost like an outline or a start and then you can work with it. And in some of these other things we're going to talk about, it's that same kind of, hey, it's not going to solve your problem completely, but it is going to get you in a situation where you can get there faster. Sort of like a, almost like the Pareto principle, you know, it's that 80-20 rule is that if it gets you 80% of the way there, then at least you've got a good start and it may not save you a ton of time, but if it's something that takes an hour and it saves you 15 minutes, then hey, that's 15 minutes saved. And so I want to talk about a couple specific areas that have come up that I just want to throw out there as just maybe some suggestions, some places where you can get started making use of this stuff and see if you can maybe make yourself, you know, in this case a more productive or better developer by simply being faster at the job that you do. The first use I want to talk about is actually a very interesting one and it is in documentation. This isn't writing, you know, a blog post. This is throwing source code at chat GPT or something like that and having it summarize what it does. I have had a couple people now, originally I didn't think it was something that was going to be that useful. I was like, ah, it's probably not going to work real well, but I've had a couple people that I've talked to that have done that and I've only seen the finished product after they took a look at it and they cleaned it up, but they said that it did give them a pretty good start and an interesting thing there is it would be also a way for you to do sort of a code review, you know, do something to say, does my code make sense? Is it logical? Because if you've got an AI engine that you can put that code in and say, tell me what this does and it gives you back something that is very precise, is very useful that a user, particularly, you know, maybe a technical user would be able to look at that and say, okay, cool, I get it. I know how to like dive in and start working with this. It does say something about the quality of your code itself. That means that you've done something that makes sense, that is clear from the code, you know, that whole self-documenting code idea. It's clear from the code what it does. So that means that you have done a good job in that case. The bonus here is it's just another way for us to potentially have a, you know, like a code documentation tool and probably run into stuff in the past, whether it was Java or Python or PHP or, you know, any of those that, at least my original thought of it was that I always referred to it as a, you know, a Java doc kind of thing. And I think there were things before that for C and C++. I just didn't use them that much. But you think about something like that where you just run a, you know, an app or a script or something like that against your code. And of course, it's going to extract comments because that means you've tagged it up appropriately. You get that with Swagger and some of these other things where it's, there's some, there is tag ability, I guess, that you can do in your code. And then that gives some keys for the engine that comes in there and generates a code afterwards. Chat GPT, if you use an AI, now you're doing something a little different. And it may be something that we get to a point where maybe with a couple of those same, like tags or programming standards, they will allow you to actually write code that then you can just toss it into the AI engine and it kicks out documentation that's maybe good enough or, you know, at least gets you a good start on getting that documentation out of the way. And maybe there's a way for us to actually start writing code that gets documented instead of it always being some technical debt that we're like, yeah, we'll get back to that at some point. Because even if it gets you part of the way there, as long as it's not wrong, at least, you know, it may not be readable or it may, you know, some things like that could be clunky, but at least it's a start and at least it gets you moving forward. Now, another thing that I have seen a lot that's an interesting one is when we deal with the idea of like scraping data. Now, this is just one example, but there are, you know, there's certain problems we solve that are fragile, that we write code and if something changes in the environment or with the data we're working with, then it can break the whole thing. So scraping is a very common one because, you know, next thing you know, somebody's changed the way the layout of the web page and now you can't find the field that you were grabbing. But also we see this in a lot of our import type things. For example, what if you're reading in, whether it's a, let's say, XML document or something nicely formatted, but even something not so much so, like maybe it's an Excel spreadsheet or comma separated values, you know, CSV, text files, something like that. It is not uncommon for there to be maybe some new fields that pop up that you would want to be able to handle or field names change. APIs are a good example of this or maybe there's like, you know, it's a new version, old version, data types change, things like that, where we could actually use an API to take a look at, I'm sorry, an AI to take a look at what it is we're working with and have it maybe do a little, you think about it like self-healing of your code. So something where it says, hey, I can't find this here, but this is what I'm looking for, pass it out to an AI, see if it comes back. Now that's a much more complicated use case and that much more complicated way to go about using AI as part of your coding, because now it's not you evaluating something after the fact, now it's you essentially evaluating it on the fly and finding ways to make some adjustments. Or at the very least, maybe some recommendations. Maybe you use it, for example, in some of your logging or your exception and error handling, is that maybe you've got something there where you can pass it on. If it's something critical, maybe it's something where you can pass that error on to an AI and instead of getting the generic file not found or something like that, is maybe it comes back and gives you something much more useful that says, this file you're looking for isn't here, but it is in this other place, or here's a name that's pretty close, or something like that. Now we've done these things in the past. I think a lot of us have had situations where we've sort of guessed our way or recommended potential solutions to a problem. And we do this all the time. We sort of look at stuff and we can guess, then we say, hey, well, a file's missing. So we may, instead of just saying file not found or worse exception, we may say something like, this file's not found. Have you moved it? And maybe, as you've probably seen in some applications, it will go look and see if maybe that file is found further down the directory tree or maybe a level up. There's some things like that that we can do, but now if we start finding ways to mix AI into that, then that can be, it's the kind of things that can be a game changer. Think about it on a, I don't know how many use a compiler, but something like that or an interpreter that says, hey, this code doesn't work and I think this is why. You could also use it for static analysis of your code that's going to look at it beforehand and say, hey, looking at this, this is a step beyond that documentation idea where it's basically saying, hey, looking at this code, I don't think you're doing this right. Or, you know, this is not terribly efficient or this is going to, in some cases, end up in some sort of like null object reference or something like that, that you can probably fix fairly easy, but if you start, if it's an actual bug, it may be very complicated, very challenging to figure out where that occurred. Because I think we've all been in that situation where we expect a value and the value is not there and then we have to go sort of back up the tree to figure out where did it break so that I don't have this value that I should have here and then correct accordingly. And AI is something that may be able to like, you know, iterate through that kind of stuff, look at, for example, other code out there that does the same thing wherever it can find, you know, code samples and it may be able to say, hey, this is, this is not something I want to do or better yet, it may be something that says, hey, you know, you're doing this, but now you're in a new version of whatever it is your language is and now they have a recommended way to do it. Or this thing that you're doing is deprecated and this is the recommended fix. Those kinds of things, I bet, are the kinds of things that AI will be able to find out there on the internet because that's what we do. If we've got something that's deprecated, a lot of us, probably all of us maybe, are going to say, all right, I'm going to go search, I'm going to go look for that. Why is that deprecated? What is the replacement or what is the new approach or the new standard for dealing with the problem that we now have a deprecated solution to? And then we can either look at it and say, all right, I don't want to deal with that right now or, okay, I'm going to go ahead and change the function call or change the parameters or things like that. Those are the kinds of things, those repetitive searching sort of easy, straightforward kinds of solutions or the kinds of things I think we're going to find that AI is really good at because it's just going to take a large amount of data, it's going to look at it, it's going to find a trend or it's going to find a pattern and it's basically going to take that and then pop up that pattern to us and say, hey, you've got this deprecated warning, here's 15 examples of it I found on the internet and in each case, this is essentially the approach they took. They changed this code here to do this thing and maybe that's the best way for you. And this suddenly gets you instead of going out and doing the searching and the things that we do that now we, funny enough, that we do it and say, wow, I can't believe how hard it was to write code 20 years ago, 30 years ago when they didn't have tons and tons of stuff out there on the internet to find examples and all kinds of explanations of these problems and these solutions. Well, maybe this is where AI is going to take us to that next step where now we don't have to search, where now it's getting ahead of us and it's looking at things and saying, hey, it's sort of like having somebody in your back pocket or somebody who's a navigator as you're writing your code to go in there and say, hey, this is not the best way or this is not the most accepted way. This is something that's a little different. This is something that's outdated. All of those things that we run into when we write code that are not necessarily, sometimes not necessarily going to jump up. We may not see those pop up in running the application. It may be that it works fine. However, we're not being better developers. We're doing something because that's just the way we've always done it or that's the way it was done in the old version and we're not taking advantage of, in particular, features that are now in this new release that we could use that would maybe make our code faster, smaller, easier to maintain. All of those kinds of positives that are not only a better developer, but a better application, a better solution. And while there are some big solutions or big things that people will talk about that AI is going to bring or potentially can bring to us, these little things are the ones that I think are going to be where you're going to find the biggest bang for your buck, the greatest value. Because it's going to be these little things that you do maybe every day and it saves you, you know, even if it saves you five or 10 minutes a day, that's almost an hour, you know, 10 minutes a day. That's like an hour a week that you're saving. Even five minutes, that's half an hour a week. And then you add that up over time and suddenly you have a lot of save time, a lot of time that you can go do something better. And particularly in this case where it's the kind of stuff that there are certain things that we just, you know, human being has to do it. You can't really automate it or you can't automate it well. And if AI can take away some of the things we do that could be automated, that could be simplified, that doesn't require that human touch, then that allows us to really focus on the things that matter, the things that we really need to do, that we need to be a part of as opposed to, you know, the equivalent almost of like busy work or things like that where it's the kind of stuff we do that something else, if it was like, if I had the right app or if I had sometimes just almost a monkey could do this, then why should I be wasting my time doing it? And if the AI is going to be at least as good as a monkey or better, then maybe this is where we're going to find that next phase of improvements and becoming better developers by using tools better, whether it's a new tool like AI or using AI to point us to maybe older tools that we haven't been using right or the tools we have that we're not using quite correctly. That's just a couple of things that I wanted to throw out in this little special episode, special topic episode, because we've talked about AI, but there's some really cool things that are out there that we've discussed in some of our, you know, our recent interviews. But here's, it's just a couple of these applications that have started to, it started to sit around in my head a little bit and say, you know what, I think we are going to be able to see some areas where this stuff will help us improve, will be useful, and we'll probably see more of it in the, you know, the years, months and years ahead as people build out proof of concepts and then those work and then they refine those and everything. As always, it gets a little better, a little better, a little better. And the next thing you know, everybody's using it and we're off and running and wondering how we lived without it. So I think that's what's maybe around the corner. And that's going to wrap this one up. And to let you get back to it, I don't want to go too long today because AI is everywhere. You hear all this kind of stuff. I just want to get a couple of things bouncing around your head, maybe some thoughts as you go through your day that you can look at stuff and say, huh, I wonder if this is something that maybe, you know, AI would have an application for because you never know that might be your flagship product a year from now. And you're going, wow, that is great. I can't believe I thought of that. I can't believe that it has gone as big as it is. And you're, you know, a success riding off in the sunset because you had these ideas bounce around your head for a little bit. I hope that several of us have that kind of stuff happen because, you know, as everybody, that just helps everybody get better. We find better ways to be a better developer, share that, and then everybody lifts that lowest end or whatever. That being said, let me let you get back to your day. So go out there, have yourself a great day, a great week, and we will talk to you next time. Thank you for listening to Building Better Developers, the Develop-a-Noor Podcast. You can subscribe on Apple Podcasts, Stitcher, Amazon, anywhere that you can find podcasts. We are there. And remember, just a little bit of effort every day ends up adding into great momentum and great success. Please check out school.develop-a-noor.com. That is where we are starting to pour a lot of our content. We've taken the lessons, the things that we've learned, all of the things that make you a better developer, and we're putting it there. We have a range of courses from free short courses up to full paid boot camps. All of these include a number of things to help you get better, including templates, quick references, and other things that make us all better developers.