Main image of article Will A.I. Doom Human Programmers?

The debate over machine learning and artificial intelligence (A.I.) has heated up in recent weeks with the rollout of the ChatGPT chatbot on Microsoft’s Bing search engine, along with Google announcing a rival (Bard). These chatbots not only provide search-engine users with a clear answer to their queries; they’re also capable of writing code.

Based on a Large Language Model (LLM) GPT-3 that has been around since 2020, ChatGPT can generate clear, relatively concise text on nearly every subject, though it's not what you'd call great writing. I had it write an article on A.I. and programming, and the text quickly became repetitive and disjointed. A.I. models don't actually understand what you’re asking; they use statistical patterns picked up from the training data. The quality of the training data makes a great difference to the generated output quality.

On the A.I. coding front, I’ve tooled around with Microsoft's experimental A.I. Intellicode in Visual Studio and Visual Studio Code. It's available for C#, C++, Java, SQL, and XAML languages. Here's a recent example of how it helped me: I had created a C# class to hold property summary details (Property as in a physical building):

    class Property

    {

        public string Reference { get; set; }

        public string KnownAs { get; set; }

        public string Postcode { get; set; }

        public string Type { get; set; }

        public string Tenure { get; set; }

        public string Status { get; set; }

        public string Surveyor { get; set; }

        public Property(string line)

        {

That method Property(string line) is a constructor that passes in a string line from a CSV file holding all the summary details for one property. Intellicode suggested the following code; all I had to do was tab to the end of each line to accept it. It saved me a few minutes’ typing.  The gray text below is the suggestion it added as I typed ‘var split =’:

The full text it came up with is below:

var split = line.Split(',');

            Reference = split[0];

            KnownAs = split[1];

            Postcode = split[2];

            Type = split[3];

            Tenure = split[4];

            Status = split[5];

            Surveyor = split[6];

        }

It’s exactly right. In other words, A.I. is pretty good if you need boilerplate code, especially as the system can pull from thousands of open-source projects (with 100 stars or more) on GitHub in addition to my local code.

But A.I. isn’t a threat to my job; in this context, at least, it’s a useful assistant helping me write code faster. Also, it doesn't connect to a remote server but generates suggestions locally; the language model is installed when you install Visual Studio.

GitHub CoPilot operates in a similar manner to Intellicode and has been trained on billions of lines of code; for most people, it will cost $10 per month. Unlike Intellicode, it works for all languages used in public GitHub repositories. Some caution is advised; according to OpenAI’s paper on Codex, it only gives the correct answer 29 percent of the time. This is because of how language models work—it's all about recognising patterns, not determining whether the output is “wrong.”

Buggy A.I. Code

Generative A.I. produces new things (images, text and code) by taking existing material and blending it into the output. There's no notion of truth; in its search-engine iteration, for example, ChatGPT spews out fake facts. Some have nicknamed this technology “Stochastic Parrots” (See this paper on archive.org). It’s a similar situation for code, despite promises that A.I. chatbots will soon have more robust debugging features; if you decide to use ChatGPT for programming, make sure to always double-check the output.

Sidebar: ANI and AGI

All current A.I. is Artificial Narrow Intelligence (ANI) with a clearly defined functionality. That’s in sharp contrast to Artificial General Intelligence (AGI), which is the type of A.I. you see in movies and television shows—for example, Data in “Star Trek” reasoning and creating, or HAL in “2001” trying to kill people. We’re a long way away from AGI, if ever.

Conclusion

There's a lot more to programming than just bashing out lines of code; for example, preparing tests, creating and cleaning data, debugging, and developing UX. ANI can’t replicate these functions (at least not yet) and lacks creativity; as a result, programmers need not worry about their jobs being replaced in the near term.

In the immediate future, we’ll see more and better A.I. assisting software development. In addition to writing code, A.I. could also help explain tools and programming concepts; for instance, explaining cyclomatic complexity statistics. A.I. could make programming faster and easier—but human engineers and developers should always double-check the machine’s work.