Tom Lee-Gough



Thoughts on Generative AI for coding

I'll start by saying that I don't think AI is very useful. Let alone any environmental and ethical concerns that one might have over the tools. That being said, I wanted to do some research to see how I might use it in my day job.

I write some code in my day job. Specifically, I write Suitescript which is an Oracle version of Javascript. We have a complex codebase, which was largely written over about five years by an outsourced overseas team. The code iteself is poorly written with lots of inconsistencies, hardcoded values, and logic that doesn't execute. I think a fair summary of what happened was that new code was added, but the old code was never reassessed.

We are now at a point where we need to make some substantive changes to the codebase in order to implement some projects. The major constraint is that the team does not have enough coding ability to deliver some projects. The AI hype machine tells me that I should be able to use Generative AI to solve all of my coding problems. So I did some research.

Before looking into the possibilities, I had some concerns:

  • Is there enough training data on Suitescript for it to be useful?
  • How does a coding agent optimise old code?
  • Is the coding agent "aware" of all the interractions of different files?
  • How does one verify the output?

I think that my main concern about using AI is that it I am not an experience Suitescript developer, let's say that AI can rewrite the code - great. How do I know that it got the business logic right? How does it "know" that it kept the right logic? I suppose outsourcing my thinking to a machine doesn't really help me understand what was happening.

Anyway, I took to research. Skipping to the punch line, it was not useful. I don't think that a coding agent would really help me deal with tech debt. It might help write brand new code, but then I wouldn't learn anything. Most of the articles I read, were detail light. Which I suppose is the perfect analogy for using AI. The articles went something like this:

I AI'd this article to tell you how I AI'd a codebase. AI changed my life because I now get to AI all the time. Now, I know your skeptical, but I asked another AI to check the AIs work, and they said it was cool or not. You should use AI, too, and be like me.

One thing I found kind of interesting was one blog where the blogger, a respected Netsuite developer, was discussing creating a prompt to create a financial analyst to assist a controller at year end. The scope of work was a pre-audit review. Now, the funny bit was the prompt was 3200 words long. The result was essentially a pass/fail checklist (which had been encoded in the prompt) which any good controller should have anyway. The checks were things that could be produced using saved searches or SuiteQL in Netsuite on a much more reliable way that "asking" AI.

I think that the main issue that I face is as follows. The organisation used an outsource partner to support Netsuite. Within the package of support was Suitescript development at effectively zero marginal cost. The code that has been written is very hard to follow and is not of high quality. To me that arrangement was not dissimilar to using a coding assistant. I don't think that using a coding assistant will really help me understand the underlying business logic, and because a coding assistant doesn't really understand it either, I don't think it would be useful.

The underlying problem is an understanding problem, which isn't going to be resolved by just chucking more code at it.

For now, I think I'll just continue coding by hand.