Using AI for Coding

Using AI for Coding

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!

要查看或添加评论,请登录

Curtis Poe的更多文章

  • The Career-Changing Lesson I Wish I'd Learned Earlier

    The Career-Changing Lesson I Wish I'd Learned Earlier

    You may have heard me mention this before, whether it's during another keynote at a conference, or in my various posts…

    1 条评论
  • No AI Strategy? You Need a Lawyer.

    No AI Strategy? You Need a Lawyer.

    Just a reminder that if your company doesn't have an AI strategy, your employees are creating an ad-hoc…

    3 条评论
  • AI and Structural Unemployment

    AI and Structural Unemployment

    An amazing post on Twitter sums up one venture capitalist's concerns about AI. He covers a lot of ground and all of…

    4 条评论
  • Is AI Safety Dead?

    Is AI Safety Dead?

    Recently there's been discussion that the AI safety movement is dying. Why is this and what does it mean? OpenAI…

  • An Honest AI Resume Scanner

    An Honest AI Resume Scanner

    Introduction This is a long article, but if you want to hire great candidates, it's worth the time to understand the…

    6 条评论
  • Avoid The AI Collapse

    Avoid The AI Collapse

    There's going to be a collapse of many companies heavily investing in AI and there's a simple way for most of us to…

  • AI Can Improve Your Business

    AI Can Improve Your Business

    Want happier customers, happier employers, less staff turnover, and greater productivity? Read on. You know what…

  • Migrating from Oracle To PostgreSQL

    Migrating from Oracle To PostgreSQL

    Note: this is a cross-post from my main technical blog. Why Leave Oracle? Oracle is the fast, beastly sports car that…

    5 条评论
  • Bringing Simplicity Back to Agile

    Bringing Simplicity Back to Agile

    If your company is not agile but considering going that route, stop! If your company has adopted agile and is…

  • Don't Pay Candidates for Interviews

    Don't Pay Candidates for Interviews

    If you ask applicants to write a small application as part of your interview process, it's become de rigueur to pay…

    2 条评论

社区洞察

其他会员也浏览了