Boosting Developer Productivity with Q Developer: Hands on Insights from James Ward

In this episode, James Ward returns to dive deeper into the practical uses of AWS's Q Developer, offering real-world examples and hands-on demonstrations. If you're a developer looking to enhance your productivity and streamline your workflow, you won't want to miss this!

Episode Description:

In this follow-up episode, we welcome back James Ward, a seasoned software developer with extensive experience in cloud computing and AI. James shares his hands-on experiences with Q Developer, an AI assistant designed to integrate seamlessly with AWS services. This episode offers a practical look into using Q Developer to enhance coding productivity and streamline cloud management. James discusses various features, including code explanation, test generation, and advanced slash commands. Whether you're an advanced developer or just starting, James's insights provide valuable knowledge that can transform your development process.

Resources:

Chapters:

  1. [00:00:15] Introduction and Welcome
    • Simon Maple introduces James Ward and sets the context for the episode.
  2. [00:00:36] Overview of Q Developer
    • James provides a high-level understanding of Q Developer and its capabilities.
  3. [00:02:41] Integrating Q Developer with IDEs
    • Explanation of how Q Developer integrates with popular IDEs like IntelliJ and VS Code.
  4. [00:04:03] Code Explanation Feature
    • James demonstrates how Q Developer can help explain unfamiliar code blocks.
  5. [00:06:18] Generating Tests and Boilerplate Code
    • Discussion on using Q Developer to generate JUnit tests and other boilerplate code.
  6. [00:09:20] Advanced Features: Slash Commands
    • Introduction to advanced features like slash commands and workspace queries.
  7. [00:11:20] Conversational Use of Q Developer
    • James talks about using Q Developer in a conversational manner to learn new concepts and solve problems.
  8. [00:13:02] Real-time Demo and Insights
    • James provides a live demo of Q Developer within IntelliJ, showcasing various scenarios.
  9. [00:16:23] Getting Started with Q Developer
    • Steps for getting started with Q Developer, including plugin installation and usage tips.
  10. [00:17:51] Conclusion and Next Steps
    • Recap of key points and encouragement to experiment with Q Developer.

Full Script

[00:00:15] Simon Maple: Hello and welcome back. In this episode, we are going to be talking with James Ward, once again. Hi James!

[00:00:23] James Ward: Hello, thanks for having me.

[00:00:25] Simon Maple: Welcome back to the podcast. It's been seconds since we last chatted.And this is a follow on,episode, where we're going to get a little bit more hands on and we're going to, take a look at a tool from AWS called, Q Developer.

[00:00:36] Simon Maple: James, first of all, before we jump into it, dive straight into the screen share. tell us a little bit about Q Developer and some of the capabilities.

[00:00:44] James Ward: Yeah. And I should caveat this with I'm new to AWS, just getting into these tools. And so I'm not an expert on them. I'm learning.

[00:00:53] James Ward: And, it's been fun to, to learn these tools and start integrating them into how I write code. But here's the high level, as I understand it, is that Q Developer is an AI assistant. there is IDE plugins, so IntelliJ, VS Code, I don't know if there's other IDEs supported, and then there is, in the AWS console,

[00:01:15] James Ward: so if you're managing your cloud infrastructure in AWS, there's also a Q, console in there that you can chat with and ask questions like list my EC2 instances or something. So there's, it's integrated there, and then there's also a command line version of Q Developer. And so that's, that is my potentially wrong understanding of it.

[00:01:37] James Ward: I've seen that through all the details, but

[00:01:38] Simon Maple: I've seen that actually that's really interesting. the basically the CLI style, Q Developer. I have seen that and actually, yeah,I've heard a few people mention actually that Q Developer is particularly, great when you have a, you're already, using AWS services and you're coding against AWS APIs and things like that,

[00:01:56] Simon Maple: and it's very well finely tuned on those kind of APIs and integrations.

[00:02:01] James Ward: Yeah, I think so. And I've used it some for that, so I was working on a KotlinConf talk and was asking Q Developer, like, how do I do this with the AWS SDK for Kotlin? And the answers it was coming up with were pretty good and helpful.

[00:02:15] James Ward: And so I don't know the specifics. specifics on how it's trained, if it is more weighted on, on AWS specific things, but I'll go in and ask it like questions about regex and questions about I was just asking you about the pickle configuration language and it was, it has general knowledge as well, but I think it's not just about, it's not just for AWS.

[00:02:35] James Ward: You use it as a general purpose, developer tool. Absolutely.

[00:02:41] Simon Maple: Let's bring your screen up, James. There we go. And we can jump in and show us a little bit about,how you're using it here. And this is, this looks like, is this IntelliJ?

[00:02:49] James Ward: This is IntelliJ idea. Yep. And, with some Java code. And Maybe this is some background for this project that I'm in.

[00:02:56] James Ward: This is, has been one place where I have used, Q Developer because I've been writing some code, which is going into a space of things that I do not understand, which is how do I use Java with Loom, with a structured task scope and do structured concurrency in Java? And so I was able to write this code and it, and Q Developer did help me on some of the aspects of this.

[00:03:19] James Ward: But I want to walk through some of the kind of things that I've used it for. And again, I'm not an expert on Q Developer. I'm still new to it and learning, but one of the things

[00:03:30] Simon Maple: I should say as well, for those who are only listening to the podcast, wondering what they should be looking at,we're on YouTube, so These episodes are best viewed on YouTube, but of course, absolutely continue listening as well.

[00:03:42] Simon Maple: And you'll be able to, you'll be able to hopefully understand what we're doing on the, in the IDE, but you'll have to use your imagination or go to YouTube for the full experience. Sorry, James.

[00:03:51] James Ward: Yeah, no, good, thing to highlight. you want to be able to see this.Okay, there's a few things that I've used Q Developer for that, that have actually helped me be more productive.

[00:04:03] James Ward: And so the first one is that there are times that I pull up a piece of code and, maybe even I wrote the code, but, but I don't actually understand the code. This happens for me a lot with Rust and Python languages that I'm not as familiar with, where I can look at the code and I can tilt my head and be like, I might be able to understand what's going on there, but here's what I do a lot with code that I'm not familiar with, especially in unfamiliar programming languages is I just highlight a block of code and then I go to explain code.

[00:04:33] James Ward: And so now this will, look at my code, that I just highlighted and be like, okay, here's all the things that are happening, and here's the like tri rith resources and why that's happening, and then, but the, usually the summary is one of the more useful pieces is that, what this code actually is doing, which isn't totally clear in the Java version of this one.

[00:04:53] James Ward: It's more clear in some of the other versions I've written of this code is that it's doing what we call a race where it's taking, it's making two concurrent HTTP requests to the same URL, and then it's returning the response from the first result that it completes successfully. And I don't know, for me, like pretty impressive that it was able to look at this code, which, which is using these forks and a join, and then understand actually the, what was the goal of this particular piece of code.

[00:05:20] James Ward: And yeah, the explain functionality is certainly useful. And then of course you can come in and ask follow up questions and all that kind of stuff, so I think that helping me understand a code base is, helpful.

[00:05:32] Simon Maple: And this is super useful even for whether you're an advanced developer or an inexperienced developer, just reading someone else's code is hard. If, me reading my own code from about two months ago is hard enough. But, but also, code reviews. This is super useful from a code review point of view as well, right? Because, particularly if it's a larger block of code, you don't need to go through it line by line.

[00:05:51] Simon Maple: You just want to understand the gist and then identify the key places. Yep, exactly.

[00:05:58] James Ward: Yeah, so I think that, understanding a codebase is super helpful. you can also feed in error messages and be like, explain this error message, and so there's just a lot of places that, that I'm like, okay, I need to increase my understanding on this, and using then the chat console to explore that,has been useful.

[00:06:18] James Ward: So that's one of the areas you'll, you may have seen. And when I right clicked on this block of code, that there was also some other things in here, I can do a refactor fix, which hopefully there's nothing to fix in my code, cause it's always perfect, but I haven't used that one a whole lot, optimize code and then send a prompt.

[00:06:35] James Ward: So send a prompt is just, like you want to ask whatever about that block of code. And so one of the things that we can do is say, write a test for this. And we can see how it does with that. I haven't actually tested this before, but, and like we talked about in the previous episode, I don't have the LLM write my tests usually, but some people, may want that.

[00:06:56] James Ward: And yeah, so great. We're getting a JUnit 5 Mockito test for that, and I have no idea if that code works, but we could go over, flip over to our test file and insert that test in. And

[00:07:06] Simon Maple: Yeah.

[00:07:06] James Ward: Actually see if it does what we expect it to.

[00:07:08] Simon Maple: Yeah, and this is an area, as well as documentation, other things where developers don't necessarily spend a lot of their time like adding those necessary tests at the end.

[00:07:18] Simon Maple: I think this is a key area that actually will make projects more complete from an AI point of view. By providing us these, I think we had, we talked about any other in the last episode as well, the tedium parts of a developer's role that they actually don't want to focus too much time on because they want to stay doing things that they find interesting or creative.

[00:07:37] Simon Maple: So like we were saying,

[00:07:38] James Ward: I tend to do a little bit more of a TDD style approach to how I write code. but for those that don't, probably the reason why you want to write a test for something is maybe you're still iterating on it, figuring it out, and you just want to like, get some boilerplate test stuff there, but probably the more valuable thing there is that you haven't written your test, but you figure that,

[00:07:58] James Ward: I might as well have the test to prevent regressions in the future. And so that could definitely be a viable thing. You've got some existing functionality. Let's get a test set up. Let's make sure it passes. And then that will help ensure that I'm not going to regress on anything.

[00:08:13] Simon Maple: Absolutely. And I think the human aspects of this is very good as well.

[00:08:16] Simon Maple: Cause I think, there's a number of places that kind of create test suites and things like that. But it's a very broad,attack on a code base. Whereas with this, let's say this scenario one method is one that we understand is a very key and important golden path area that like, like you said previously as well, may get hundreds of thousands or millions of

[00:08:35] Simon Maple: pass throughs through various transactions or something. And we need this to be bulletproof. We can like select various pieces and say, look, these are the areas that I want you to generate tests for me or what will help me, assist me in, in, in building tests for this code. So I think this is still a very nice piece of human interaction, human assistant,with AI.

[00:08:54] James Ward: Yeah. Yeah. Yeah. So that's the, the kind of highlight and explain or, pop over into chat and do that for. The other one that I think is probably the most common use of these AI assistants is just generating, blocks of code for me. And so this is a fun one where I've got all these different scenarios here, and let's say that I want to now start writing my 11th scenario.

[00:09:20] James Ward: We'll see if this works, but usually, as I'm starting to write, let's see if it. And sometimes it's Hey, do you, Oh, there we go. Okay. so it did, I had to start getting a little further in. but it's okay, now, I'm underneath scenario 10 and it's already guessed Hey, What you want next is scenario 11,

[00:09:43] James Ward: so it like figured out what's, and then what's weird is if I start typing this, like after scenario one, then the code hint from Q Developer is 1a. And so it's wild that it like understands where I am in this code and starts like giving me this like multi line completion.

[00:09:59] Simon Maple: That's really interesting. Cause a lot, depending on understanding the position you are and understanding what comes before and what comes after is not something that every assistant does. And I think it's really important, particularly if you're in a method or something like that as well,

[00:10:13] Simon Maple: but that context is really, it's really good to see.

[00:10:17] James Ward: Yeah. And so I've, I think that my kind of acceptance rate on these is generally pretty low. Like oftentimes the code that I'm writing, like I've already got the code in my head that I want to write. And so it's not very hard to actually just mash out the characters, but,

[00:10:33] James Ward: there have been times where the code, the hints that come up in here, I'm totally shocked by. I'm like, how did it know that was exactly what I wanted to write? Yeah. And so yeah, I've found definitely some value in the code hinting stuff, especially when I'm in like boilerplate, code land, but I tend to write a lot of code in Scala and Kotlin where there's not a lot of boilerplate.

[00:10:56] James Ward: So I don't know for me, the like multi line completion sometimes is really helpful and provides a lot of value. And other times it just is a little bit of a distraction from me just like mashing out the code that's already in my head. Yeah.

[00:11:11] Simon Maple: Yeah. Amazing. Yeah. This looks,

[00:11:14] James Ward: Obviously, it does have that functionality, which is I think common across most of the AI systems.

[00:11:20] James Ward: Yeah, so there's that, there's a couple of features in here for these slash commands. So I've not used these that much, but slash dev plan and implement new functionality across multiple files. I don't know what. I'm sure that's useful. I haven't dove into that yet.

[00:11:37] James Ward: There's slash transform. If I have a project, that I want to upgrade the Java version of, and I've heard people using that and that being helpful. And then there's a new one, which, which,I just filed a bug yesterday cause it doesn't actually work yet. And for my setup and it's probably because I'm like on NixOS, which is a weird version of Linux and I don't have a GPU,

[00:11:58] James Ward: but anyways, what this at workspace does is it's supposed to allow me to ask questions about the whole entire project. And so I should be able to say, summarize what this project does, and then it's supposed to have actually built a like local vector database of my whole entire project.

[00:12:17] James Ward: And, yeah, it's I'm still indexing. So this is, I just filed a bug on this yesterday. Cause it's I'm still indexing the project. so I don't know why it's not succeeding indexing on my weird, weird NixOS Linux machine, but I think once that actually works for me, that'll be something that'll be interesting to be able to ask questions about my project specifically.

[00:12:38] Simon Maple: With a much greater, a much greater scope of context, which will provide you with a more accurate eyes to look at a small, just at a single file or something.

[00:12:47] James Ward: Yeah. Yeah, and the place where I use Q Chat, a lot and people use Copilot and,ChatGPT or Claude models for this is, it's just like trying to, understand a concept that I'm not familiar with.

[00:13:02] James Ward: And so I'm going to try something, which I haven't tried, which will be interesting to see, see how this does. But, what this project is doing is it's doing these races of these HTTP calls. And so I'm just totally curious if I say, write a Java method,that races two HTTP requests, and only returns the first, first successful result.

[00:13:34] James Ward: I'm just totally curious if it's going to come up with anything like what I have here.But this is exactly like when I'm venturing into new territory, concepts I don't understand, I just have a full on conversation with Q now. And, okay. So it didn't use the, no, it hasn't used the same code that you did.

[00:13:53] James Ward: It didn't use the new structured test scope, which this is like a brand new Java thing, so probably the, this is trained on, the training data set is much more heavy on completable future than on the structured task scope. So let me ask a follow up, can you do that using the, structured task scope?

[00:14:17] James Ward: And we'll see if it, so StructureCastScope is the new structured concurrency stuff in Java, which I think is still experimental. So I'm venturing into some pretty uncharted territory. Oh, and there we go, with code that looks pretty similar to mine. So yeah, I had to give it a little bit of nudging to use the new APIs instead of the old APIs.

[00:14:37] Simon Maple: But what I like at the bottom of that as well, it, actually, if you scroll down a touch, not only did it provide, The answer, plus a description as to why it works. Keep scrolling. I think it provided.

[00:14:49] James Ward: Oh, a difference on the differences between the completable future and the structure.

[00:14:54] Simon Maple: Actually, what I was looking for was, I think the previous one had a reference over to Stack Overflow, interestingly.

[00:14:59] Simon Maple: So it's it's nice to almost give you references of, yeah, of others, similar questions that have been put up. Cause then you get, again, it's almost like that human involvement, or if you don't, if you want to talk to someone that, that has, has had that problem and understanding their opinion on Stack Overflow versus.

[00:15:20] Simon Maple: General, LLM,

[00:15:22] James Ward: In my experience with Stack Overflow, a lot of times it is the accepted answer. And then there's the like highest upvoted answer. And so it's I do like that I can then go open up the Stack Overflow and see is it what it's telling me the accepted answer or the, the most upvoted or, some, somewhere in between, or, so yeah, it is nice to have those references.

[00:15:46] Simon Maple: And that's where we are with LLMs as well. And a lot of the time, if it has a lot of training data on a, in a specific way, chances are, it's going to provide you that way versus something which is potentially better, unless there's some fine tuning or altered data sets that it trains from.

[00:16:02] James Ward: Yeah, exactly. Yeah. And so that's the ways that I've been using Q Developer, at least in, in the IDE. When I'm in the AWS console, I'm asking it about how I set up my cloud formation things and, asking it questions about my resources. And so that's a bit different. but this is where I'm using Q Developer most is within my IntelliJ IDE writing.

[00:16:23] James Ward: Java, Kotlin, Scala, mostly sometimes Rust or Python, something else. And yeah, it definitely has been helpful, in, in, especially as I am moving into areas that I am unfamiliar with. That's when it seems to have had the most value for me.

[00:16:38] Simon Maple: Yeah, amazing. James,this has been great to, great to chat and actually get to, get to see some, get to see some real world, Q Developer, in, in, in some live demos.

[00:16:47] Simon Maple: Thank you. Thank you very much for that. if people wanted to learn more, go and try it out. what's their best route to do that?

[00:16:54] James Ward: There is a web page on the AWS site that's like Q Developer and here's how to get started with IntelliJ or VS Code or whatever. And but, or you can just like an IntelliJ, go to, your plugins and go install it,and then.

[00:17:08] James Ward: Yeah. Once you install the plugin and IntelliJ and then start asking questions, there's like a slash help menu. I don't know. You can, I wonder if we can also ask it like, like what should I use Q Developer for? It's like conversationally learn how to use it.

[00:17:27] James Ward: It's, this is the future, right? We just like, like experiment with, with this, AI assistant and see what it comes up with. yeah.And oh, I should mention that, Q Developer is free for developers. I, there's like a free edition and that's the one I'm using. so yeah, I think that, I think I'm using it for free.

[00:17:47] James Ward: So I think you just need an AWS account or something. yeah.

[00:17:51] Simon Maple: Amazing. Thank you very much, James. And, I appreciate your insights into Q Developer. And,thanks for the double session that you gave.

[00:17:57] James Ward: Yeah. Yeah. Thanks for having me.

Podcast theme music by Transistor.fm. Learn how to start a podcast here.