AI-Assisted Coding Advice

General advice for software developers looking to get the most out of AI-Assisted coding tools.

AI-assisted coding refers to the use of artificial intelligence tools to streamline and enhance the software development process by automating repetitive tasks, suggesting code, and providing real-time assistance. Popular tools like GitHub Copilot, Cursor, and Claude Code are helping developers write code faster and more efficiently by offering intelligent code suggestions and solutions. I was an early adopter of this technology and here are some tips and tricks that I help you get the most out of these tools. Since this is a fairly broad topic and I have a lot to say on the subject I will likely make this a series of blog posts.

HandyMKV

Your Time is Valuable

The biggest benefit of incorporating AI-assisted software development is boosting your productivity. If you find yourself caught up in tedious, repetitive tasks, consider how generative AI tools could help. Unit tests are a perfect example. Writing them manually can be time-consuming, and while they're important, they don't directly contribute to user-facing features. That said, they are valuable — but the time-to-value ratio could be better. Generating unit tests with AI saves significant time and effort, allowing you to focus on building features that actually impact users. After all, maximizing productivity is the name of the game, and the only way to do that is by respecting your own time.

Trust but Verify

If you're entering the world of AI-assisted programming with the mindset that you can't trust anything the AI generates, you're in for a rough ride. A baseline level of trust is necessary. This doesn't mean you should blindly accept AI-generated code, but having zero trust is just counterproductive.

I get it. You've been a Software Engineer for a long time, and you know what you're doing. But the reality is, you'll need those skills now more than ever. However, it's time to let go of the idea that typing every line of code yourself is the only way to ensure it's done right. Remember — your time is valuable! AI-assisted development allows you to be more productive than ever before. Once you embrace that, you'll start to see how much more you can accomplish.

That being said, you're still the one in the driver's seat. It's your head on the chopping block if something goes wrong in production, and customers are angry. No one's going to fire the AI that generated buggy code — they'll fire you. You're the one held accountable. So, when you use code generation tools, apply your years of experience and better judgment. Just because the AI suggests something doesn't mean you have to take it as gospel. It's your expertise that will set you apart from others. Continue using tried-and-true practices like human code reviews and sensible test coverage to protect yourself.

Good Prompts, Good Context

Like anything in life, the more you do something, the better you get at it. When I first started using AI-assisted tools, I had to come to terms with the fact that I wasn't great at explaining what I wanted. This often led to poor AI-generated responses, which was frustrating. I didn't realize that taking just five or ten minutes to craft a good prompt could save me hours of work. Plus, I was less familiar with providing proper context (and the tooling around it wasn't as sophisticated back then).

Over time, I learned how to formulate my prompts and provide the right amount of context to maximize the chances of getting valuable results. I also learned to understand what kind of prompt the situation called for. For example, sometimes you need to accomplish something very specific in your code. In those cases, it's crucial to be very explicit about what you want and how you want it to work.

Here is an example:

Prompt: Create unit tests for ReverseString()

vs

Prompt: Create unit tests for ReverseString(). Use the NUnit testing framework. Reference unit tests in DoSomeOtherFunctionTests.cs as an example for how to structure the tests. Test the following scenarios:

  1. When ReverseString() is called with a null argument, it should throw an ArgumentNullException.
  2. When ReverseString() is called with an empty string, it should return an empty string.
  3. When ReverseString() is called with a valid string, it should return the string reversed.

This isn't to say that all open-ended prompts are bad. It really depends on the situation. After receiving tests from my more specific prompt, I might ask a follow-up like, “What scenarios are not being accounted for in these tests?” At that point, you've built enough context so the AI has a better chance of providing you with a more valuable response.

There's so much more to say about prompting — I could go on all day. But I recommend doing your own research on the subject. Learn Prompting is a great place to start.

Written by Daniel Marshall

Published on February 25th 2025