Resources

Generative AI In Code Generation

Generative AI In Code Generation
SUMMARY

Generative AI for coding is seeing an uptick because of advancements in NLP

Generative AI for code does not use templates, nor libraries of components

Even though code produced by genAI and LLM technologies is becoming more accurate, it can still contain flaws and should be reviewed

Inc42 Daily Brief

Stay Ahead With Daily News & Analysis on India’s Tech & Startup Economy

Anyone, literally anyone, can code in just about any language today – be it Python scripts, Java classes, COBOL assembler or RPG – The only support one needs is in the form of a Generative AI assistant. 

It can help create new applications, but Generative AI can also help modernise legacy code or translate code from one programming language to another, test the code, and complete the code – it can help perform any task in the software development lifecycle, useful to developers at all levels.

How Is It Made Possible, Now?

Generative AI for coding is seeing an uptick because of advancements in NLP, i.e., natural language processing, deep learning algorithms, and the latest sensation, large language models or LLMs. 

The LLMs are trained on a vast dataset of existing source code (the more diverse the source code, the better), taken from publicly available code, such as those produced by open-source projects, like Github. If needed, we can further fine-tune LLMs with proprietary code data sets.

How Do Programmers Invoke AI Assistance?

In principle, it’s as simple as typing a text to an interface to generate code / intended output.

Programmers Enter Text “PROMPTS” Into The LLM

(A PROMPT describes what they want the code to do. For eg., a prompt could read “sort this row of data” or “create a submit button”, etc.)

Then add how they want the generative AI system to process that text.  (This could be in the form of a number of different things – a form of code snippets, full functions of actual code). 

Generative AI can do the rest and produce a usable output. If one can build a nice prompt library, it can streamline the coding process by handling repetitive tasks that a human programmer is more than happy to offload.

For e.g., Looking at error reporting to log files; and translating code from one language to another are methods that are particularly useful in modernization projects such as updating legacy applications by transforming COBOL to Java. It can also serve as a very efficient way of testing and it’s a great way to perform debugging.  

It’s An Assistant, NOT A Replacement

The generative AI-driven coding works best as an assistant rather than a complete replacement for human programmers. Even though code produced by generative AI and LLM technologies is becoming more accurate, it can still contain flaws and should be reviewed, edited and refined by real-life people. 

So one can think of generative AI as enabling developers to generate code faster, reducing the work of manually writing lines of code, and freeing developers to focus on higher-value work.

How Is It Different From Low/No Code?

Another way to generate code quickly and well-known in the industry is the “Low and no code tools”.  

These are built on a series of templates that provide input, and they also use a series of libraries of components. People without coding skills can use a visual interface to do things like drag and drop components to create applications quickly. The code an LCNC platform creates is hidden in the background from the user.

Generative AI for code, on the other hand, does not use templates, nor libraries of components. The software reads the developer’s plain language prompts and suggests code snippets from scratch that will produce the desired results. 

Thus, while low-code and no-code tools generally target non-developers and business users, both pro developers and other users can use AI code-generation software.

Two Different Ways Of Using Generative AI For Code

There are two categories of generative AI code generation that happens widely today.

General Purpose

  • Driven by generative AI applications like OpenAI’s ChatGPT, Google Bard etc.
  • Typically, free-standing and not plugged into development environments

Code Generation Tools

  • Driven by ‘Copilots’ like Github, Microsoft etc.
  • Pre-trained AI model for code completion in many languages JavaScript, Go, Perl, Ruby, Swift etc.
  • Typically uses machine learning to suggest code, based on the context & analyse vulnerabilities.
  • Available as extensions to various IDEs like Visual Studio, Eclipse

Ultimately, with an accelerated ability to automate code development, find bugs, generate test cases, and optimise, generative AI for code is driving a tectonic shift to the paradigm of software development– that is poised to change course of coding history permanently and usher in a new era of innovation and efficiency.

Note: We at Inc42 take our ethics very seriously. More information about it can be found here.

Inc42 Daily Brief

Stay Ahead With Daily News & Analysis on India’s Tech & Startup Economy

Recommended Stories for You