Using AI for Coding
Curtis Poe
Innovative software architect, prompt engineer, and GenAI enthusiast. I balance business needs with technical excellence for optimal solutions.
I'll be training a company's development team on effective use of AI and am faced with the common question: "does the new AI really help in software development?"
Yes! Even if you have a huge codebase with custom DSLs using uncommon libraries, and you can't risk your code getting leaked via training, you can leverage code generation LLMs to make your team more productive. There are many ways to gain that productivity.
Bad AI
Before using AI, many developers claim that all they do is spit out broken code. When I ask details, it's almost always the free version of ChatGPT or Gemini. Not only are the free versions weak models, They usually don't have the context of the rest of the code. Copilot, StarCoder, or similar tools are your friends here. Using a known-weak model and not giving it context are a great way to reinforce your opinion that AI won't help.
But even when using models dedicated to writing code, you don't have them spit out a bunch of code and hope it works. They're a junior dev. A lightning fast, dirt-cheap junior dev, but still a junior dev. You need to review their code, sometimes correct it, and sometimes give feedback. If the code throws an error, immediately (so it still has context) tell the AI about the error. It will often fix it immediately.
So you take small chunks of code, review them, test them, and iterate. Just like you would if you were writing your own code.
And yes, you have to stay on top of it and see—even if the code works—when the design is flawed. AI struggles there and your expertise is still needed.
More Than Writing Code
AI isn't just for writing an almost working API endpoint. Ask it to explain a library, method by method. AI is fantastic at understanding code immediately, giving you a quick rundown of the basics, even for undocumented code. Hours of reading through code is now reduced to minutes.
Or when I'm working on something, I often start some documentation, pause, and wait for the AI to autocomplete the docs for me, often only requiring minor corrections. I've had many times where writing docs has been "tab, pause, tab, pause, tab, pause" and it's perfect. This is a huge time saver.
领英推荐
Comments are important, too! Start a comment, pause, and wait for the AI to complete it. My turning point moment in appreciating the power of modern AI was when it inserted a comment in some complicated code I was in the process of writing and I laughed, because the comment was wrong.
Then I read my code again. And I read the comment again. I had introduced a very subtle, hard-to-detect bug that my tests had missed and might not even have been spotted right away in production, leading to unknown consequences for clients. The AI "understood" my code better than I did. That was a very humbling moment.
What else can the AI do? It can help you write tests. It can help you debug code. It can look for bugs that you might not be aware of. It can help you brainstorm different approaches to a problem. AI is more than just spitting out trivial functions to sum a list of integers.
The Takeaway
AI can help developers in many ways. Currently AI helps junior developers more than senior developers, but even the senior developers benefit.
If you don't want your code to be used to train AI and possibly be leaked to the outside world, you can usually configure the settings to tell the provider not to use your code for training.
If you don't trust them, you can use an open source model and host it yourself. If it's still not good enough, you can even rent GPU time and fine-tune a model on your code base.
Current estimates are that code generation LLMs, when used effectively, give productivity boosts of anywhere from 20% to 40%. Just think about that cumulative productivity boost over time and what it could mean for your customers.
AI developers never get tired. They never get annoyed. And despite their occasional quality issues, they're literally orders of magnitude cheaper than a junior developer. But you must be disciplined and stay on top of their work. When you learn to work with them effectively, you'll be amazed at how productive you can be.
If you want to learn more and hire me for AI productivity training, drop me a line!