In 1966, the world met ELIZA. She wasn’t a particularly charming celebrity, a revolutionary politician, or even a groundbreaking scientist. In fact, she wasn’t a person at all.
Created by Joseph Weizenbaum at MIT, ELIZA was one of the earliest examples of a natural language processing (NLP) program. It was designed to simulate a conversation between a human and a computer program by using simple pattern-matching techniques.
Sixty years after ELIZA, OpenAI’s GPT (Generative Pre-trained Transformer) model pushes the boundaries of NLP even further. In its latest iteration, GPT can engage in eerily convincing conversations, crank out news articles, and most impressively, write and debug code.
As AI (artificial intelligence) continues to evolve, we’re reaching the point where programming, a sacred land once immune to automation, is in danger of being taken over by evil robots. 🦾
Ok, that may be a bit far-fetched (at least for now). Instead, let’s focus on the positives and see how AI is being used to write code. Here’s everything you need to know!
⚡️ Benefits of AI in Writing Code
Increased Speed and Efficiency in Writing Code
To be efficient or creative… 🤔
Even the self-proclaimed programming gods who craft code akin to Michaelangelo’s masterful sculptures and paintings are only humans. The tedious hours spent on testing and debugging code can drain creativity even from the most ambitious projects.
So why not let artificial intelligence take over the mundane?
When GitHub hub released its CoPilot coding assistant back in 2021, it was a godsend. Gone were the days of Googling StackOverflow to borrow erm, learn from public code snippets.
With the ability to understand context and offer code suggestions, CoPilot and other AI-based tools are playing a key role in shaping the software development landscape.
According to a recent GitHub survey, using CoPilot cuts the total coding time by 9.3%.(1) But it’s not just about speed — 97% of respondents say coding has become more enjoyable. The adoption is rising too, with 44% DevSecOps pros using AI tools, up from 36% in 2021.(2)
The Investment firm Ark Invest forecasts a tenfold boost in productivity for software developers, all thanks to smarter AI coding assistants coming our way.(3) Not too shabby, huh?
Advanced Debugging Capabilities
“There’s nothing like a good bug hunt in the morning,” said no one ever. 🐛
A 2019 study by Microsoft analyzed data from 597 developers who worked on 82 software projects. The results were dismal, at least from the productivity standpoint.(4)
On average, the participants would spend 27% of their time on code debugging, reviews, and testing. While this may not seem like much, 25% of the remaining time was burned on meetings and emails. Only 15% was left for deep, focused coding work.
Debugging tends to sap resources that can be spent on more creative work. And this is another area where LLMs (large language models) like ChatGPT can one day make a significant impact.
Studies have found that humans can effectively review code at a rate of 200 – 400 LOC (lines of code) per hour. Anything beyond that point is counterproductive and ineffective.(5)
AI-based coding tools can accurately point to problematic fragments of code, even if the (digital) finger-pointing still requires oversight from a flesh-and-bone programmer.
With the increased output of auto-generated code, AI may soon become a spellcheck on steroids for software development, and one that will know how to clean up its own mess.
Democratization of Programming
Shortly after ChatGPT launched in November last year, Ammaar Reshi, a Bay Area designer, used OpenAI’s chatbot to “write” and publish two children’s books in 72 hours. When GPT-4 hit the stage last month, Reshi created two video games from scratch despite a lack of coding skills.(6)
Code quality and complexity aside, Reshi’s ingenuity isn’t an isolated case. If anything, it marks a dawn of a new era where non-techies can (finally) tap into the arcane of coding.
AI is leveling the playing field for people who are interested in learning how to code but feel overwhelmed by the sheer volume of knowledge required to get their foot in the door.
Of course, we can argue that Reshi’s games are nothing more than a bad clone of Snake and a 90s screensaver with cringy music. But the case goes beyond the intellectual value and shows that AI can democratize coding, a feat the low-code/no-code movements attempted before it.
Better Pair Programming?
The concept of pair programming—a practice where two programmers work together on one computer to write code, test, and debug—has a long and murky history.
In the early 1980s, software engineer Larry Constantine coined the term “dynamic duos” to describe pairs of programmers sharing terminals at Whitesmiths Inc. At that time, the idea that software developers should work together to improve code was not universally acknowledged.
But as the demand for software development grew and the complexity of software increased, pair programming became canon with Ken Beck’s Extreme programming (XP) in the 1990s.
Fast forward to 2023, LLMs are driving a level of productivity that far outstrips the human capacity to inspect source code at a reasonable pace. AI can fill in the gaps and work side-by-side with software developers to identify errors and optimize code.
Can artificial intelligence replace a grumpy but positively hilarious coding buddy? Probably not, but it can be a valuable resource for debugging, troubleshooting, and automating tasks.
Who else is going to appreciate your obscure references to 90s sitcoms? 🤷♂️
🛠️ Examples of AI in Action
A recently released map of the MAD (Machine Learning, Artificial Intelligence and Data) landscape by Matt Turck at FIRSTMARK counts over 1,400 companies active in the space, with several dozens focusing solely on using AI in software development.(7)
At this point, It’s safe to say that AI and machine learning are the new cool kids on the coding block. So let’s take a look at a few prodigies that are making the headlines.
AI-Based Coding Tools
GitHub Copilot
GitHub’s Copilot needs no introduction. Launched in 2021, the tool is an AI coding assistant that seamlessly integrates with popular IDEs (integrated development environments).
Built on OpenAI’s GPT language model, CoPilot offers developers code suggestions and autocompletion that help streamline the coding process. While not infallible, GitHub’s flagship tool is an excellent addition to any coding workflow, both for new and seasoned programmers.
ChatGPT
While OpenAI’s ChatGPT is a chatbot at heart, it fares surprisingly well in coding tasks. From ai-generated code to error detection, the GPT language model covers a surprisingly wide range of staple coding tasks, especially considering that it wasn’t designed to do so.
Last month, OpenAI dropped another bomb announcing ChatGPT plugins, including an experimental “code interpreter” that runs a sandboxed Python interpreter.
ChatGPT’s training data scraped from GitHub and StackOverflow, among others, is the cherry on top that makes it an apt coding companion and a valuable resource for newbies and pros.
Mintlify
A 2017 study found that programmers spend around 58% of their time on program comprehension activities. Poor or nonexistent documentation is one of the major culprits.(8)
Established in 2021, Mintlify fills that niche by automatically documenting code using machine learning and natural language comprehension. The tool can also scan for stale documentation and suggest improvements to existing docs.
Tabnine
Tabnine is another AI-powered coding assistant that helps programmers speed up the coding workflow, write more cohesive code, and avoid common errors. Like many other similar tools, Tabnine runs on OpenAI’s GPT model to provide context-aware suggestions.
What’s interesting about Tabnine is that the tool has been trained on open-source code with permissive licenses. That means the output code is safe from potential IP infringements (more on that in a bit). There’s also an Enterprise plan that enables training on your own code.
Successful AI Implementations
Ubisoft’s Commit Assistant
In 2019, Ubisoft partnered with Mozilla to develop Clever-Commit, an AI-based coding assistant designed to speed up the coding workflow at the company.(9)
The Clever-Commit’s role is to check code for bugs before it’s even submitted. To achieve that, Ubisoft trained it using internal data that included the source codes of its games.
During the 2019 DICE Summit, Ubisoft’s executive director of production studios services Yves Jacquier said the tool had achieved a 70% success rate for predicting bugs in submitted code.
Goldman Sachs
The banking industry has made an odd entrance into the AI space. In late February, a group of banking giants led by Bank of America Corp., Citigroup Inc., and Deutsche Bank AG banned “unauthorized” use of ChatGPT by its employees, citing security concerns.(10)
A month later, Goldman Sachs, one of the largest investment banks in the world, backtracked on the decision and admitted its developers are using AI tech to improve coding workflows.
In an interview with CNBC, the company’s CIO Marco Argenti said the initiative is still a “proof of concept,” but the company is already noting a 40% increase in code output.(11)
Facebook/Meta
The pivot to the metaverse ended in a major hiccup for Meta. But Mark Zuckerberg’s platform is hell-bent on its goal to take over virtual real estate while it’s still up for grabs.
The company is also actively working to revamp its internal processes, and it recruits from the ranks of AI to do the heavy lifting. Internal AI tools have helped Meta improve code review workflow, with a 44% increase in AI-assisted review actions compared to regular reviews.(12)
Meta’s tools can send chat reminders to reviewers and cherry-pick the most suitable person for each “diff” (set of changes made to the codebase) to significantly speed up reviews.
🙈 Ethical Considerations of AI in Coding
Concerns Over AI Replacing Human Programmers
A few years ago, software development seemed like one of the few future-proof careers with an unsatiated thirst for new talent and a negligible risk of rivalry from AI that writes code.
But while ChatGPT and Co’s coding attempts are still somewhat clumsy, they herald a new age where coding (and most knowledge work) may become a relic of the past.
Of course, we can still cling to the argument that code written by LLMs needs to be reviewed. The question is, how long will human programmers stay relevant?
In a 2019 survey by Evans Data Corp. 1 in 3 developers (29%) said they consider AI a threat to their profession.(13) Recently, the sentiment seems to be shifting to uncertainty, with 67% of developers staying neutral toward AI assistants according to Stack Overflow.(14)
One thing is certain, AI-driven no-code and low-code platforms will grow, which means design thinking and problem-solving skills may overcome pure technical prowess sooner than later.
👨⚖️ Ownership of Intellectual Property Generated by AI Systems
A thing that often eludes the public debate on AI is the fact that content generated by AI isn’t created in a vacuum. It’s based on human-generated data fed to neural networks in “training.”
The question is, who owns the IP produced in the process?
A few weeks before ChatGPT launch, OpenAI and its partners including GitHub and Microsoft had been sued for IP infringement. Programmer and lawyer Matthew Butterick alleged that GitHub’s CoPilot used parts of his and other developers’ code available in public repositories.(15)
The intellectual property conundrum is a thorn in the side of all LLMs. Earlier this year, Midjourney, Inc. creators of the AI image generator Midjourney, were hit by a civil lawsuit filed by three artists who accused the company of using their works in Midjourney’s training data.(16)
Unfortunately, the solutions to the problem are few and far between.
There is still no legislation to address IP concerns, and the only alternatives for AI that writes code and other LLMs are to either trim training data or use open-source code. Neither of those approaches seems a viable option with AI investors’ pressure to scale.
💣 Accountability for the Outcomes of AI-Drive Decisions
In the 1980s, a computer-controlled radiation therapy machine developed by Atomic Energy of Canada Limited (AECL) led to a series of fatal accidents. At least three people died from radiation overdose caused by software bugs and a lack of due diligence.(17)
Humans make mistakes and (usually) get the heat for it. But who takes the heat for the AI? The developer of the AI or the “handler” who didn’t keep a rein on a possibly lethal piece of code?
As AI becomes more prevalent in software development, developers need to take responsibility for the code they create. This means ensuring that the neural networks are trained on accurate data, thoroughly tested, and monitored closely for any potential issues.
But at this point, AI is still like Schrödinger’s cat in an unassuming wrapping.
According to Peter Relan, a co-founder and chairman of Got It AI, a developer of generative AI chatbots, the rate of hallucination of ChatGPT (when the model makes stuff up) is around 20%. Regardless if that’s a result of using biased or incomplete training data, the problem remains.(18)
CNET recently learned this the hard way when the outlet published a series of AI-generated articles that contained factual errors and inaccuracies.(19)
Janky financial advice can do a fair share of damage, but the stakes are much higher when it comes to expanding AI’s role in more critical tasks. Operating medical devices or giving medical diagnoses is a whole different game, and we’re yet to see if we’re ready to go all in on this one.
🤖 Future of AI in Writing Code
Will AI put programmers out of work? Or will it become a trusty sidekick that will take over mundane and repetitive tasks like code reviews, bug fixes, and syntax corrections?
Well, we’re optimistic enough to predict AI becoming the ultimate wingman for programmers, one that’s available 24/7, doesn’t need bathroom breaks, and won’t complain about long hours.
And in the long run? At this point, nobody really knows.
As Stephen Hawking once said: “The rise of powerful AI will be either the best, or the worst thing, ever to happen to humanity. We do not yet know which.” We’re likely learn that soon enough.
💡 Before you go… Want to make the most of AI? Try Taskade! 🐑
Taskade is a powerful project management and team collaboration tool that will help you keep your software projects on track. Write documentation, share code snippets, discuss progress with your team, and chat or jump on a call in the same window, in the same app.
You can use Taskade’s AI tools powered by OpenAI’s GPT-4 Turbo to brainstorm ideas, structure your work, and even generate code snippets right inside the project chat box.
🪄 Custom AI Agents: Imagine having a team of AI assistants automating routine tasks. Custom AI Agents will streamline your workflow and let you focus on the work that matters.
✏️ Workflow Generator: Say goodbye to tedious planning. The Workflow Generator will create an outline for any project based on your natural-language prompts.
💬 AI Assistant: The AI Assistant is your productivity sidekick that lives inside every Taskade project. Use built-in AI commands in the editor to work smarter.
📣 AI Chat: No more searching for solutions. Turn to AI Chat for coding and productivity- related questions and guidance. Dig into coding concepts, identify errors, and provides context-based assistance based on your projects or uploadeddocuments.
Ready to boost productivity and supercharge your coding projects?
Frequently Asked Questions About AI in Coding
How does AI work in programming?
AI technology can help developers write better and faster code by leveraging machine learning algorithms that can automatically optimize code performance, catch errors early in the development cycle, and suggest code snippets and autocomplete code based on context and usage patterns. It can also provide suggestions for code structure and style, making it easier for developers to write clean, maintainable, and efficient code.
Can AI write Python code?
There are various AI-powered tools and frameworks available that can generate Python code based on the input and requirements provided by the user. These tools use natural language processing (NLP) techniques and machine learning algorithms to understand the user’s intent and generate the appropriate Python code.
For example, OpenAI’s Codex is an AI-powered coding tool that can generate Python code and other programming languages based on natural language input.
Can AI take over coding?
While AI can assist with code generation, it is unlikely to take over coding completely. AI lacks the creativity and domain knowledge required to write complex and innovative code. Instead, AI can be used to automate repetitive and time-consuming tasks, freeing up developers to focus on more complex and creative aspects of programming.
Can AI solve coding problems?
Yes, AI can solve coding problems to some extent. AI-powered tools and algorithms can be used to help solve coding challenges, particularly for routine or repetitive tasks. One example of an AI-powered tool for solving coding problems is Codota, which uses machine learning algorithms to suggest code snippets and solutions based on the code being written. Another example is Kite, which uses AI to provide intelligent code completion suggestions and error detection.
Can an AI write a script?
Yes, an AI can also write coding scripts. AI models are capable of learning programming languages and writing code based on inputs and requirements. In fact, AI-powered tools are already being used to generate code, particularly for repetitive or routine tasks, allowing programmers to focus on more complex and creative work.
What is the best AI tool to write code?
The best AI tool to write code depends on the specific programming task and requirements. However, popular options include Microsoft’s Visual Studio IntelliCode, which uses machine learning to provide intelligent code completion suggestions, and GitHub’s Copilot, which can generate functional code based on natural language descriptions of programming tasks. Other popular AI tools for writing code include ChatGPT, CodeGuru, DeepCode, and Hugging Face.
Which AI bot writes code?
AI-powered bots that can write code include Codota, Tabnine, Kite, and OpenAI’s Codex. These tools use natural language processing and machine learning algorithms to suggest code snippets, auto-complete code, and generate code based on the input and requirements provided by the user.
🔗 Resources
- https://about.gitlab.com/developer-survey/
- https://about.gitlab.com/developer-survey/
- https://www.unite.ai/how-generative-ai-could-lead-to-a-10x-increase-in-coding-productivity/
- https://www.microsoft.com/en-us/research/uploads/prod/2019/04/devtime-preprint-TSE19.pdf
- https://smartbear.com/learn/code-review/best-practices-for-peer-code-review/
- https://www.businessinsider.com/gpt-4-video-games-coding-chatgpt-childrens-book-ammaar-reshi-2023-3?IR=T
- https://mattturck.com/landscape/mad2023.pdf
- https://www.researchgate.net/publication/318811113_Measuring_Program_Comprehension_A_Large-Scale_Field_Study_with_Professionals
- https://www.gamedeveloper.com/programming/ubisoft-aims-to-help-machine-learning-find-a-place-in-every-stage-of-game-dev
- https://www.bloomberg.com/news/articles/2023-02-24/citigroup-goldman-sachs-join-chatgpt-crackdown-fn-reports#xj4y7vzkg
- https://www.cnbc.com/2023/03/22/goldman-sachs-experiments-with-chatgpt-like-ai-to-help-devs-write-code.html
- https://engineering.fb.com/2022/11/16/culture/meta-code-review-time-improving/
- https://www.computerworld.com/article/3041430/one-in-three-developers-fear-ai-will-replace-them.html
- https://stackoverflow.blog/2023/03/09/after-the-buzz-fades-what-our-data-tells-us-about-emerging-technology-sentiment/
- https://githubcopilotlitigation.com/
- https://kotaku.com/ai-art-stable-diffusion-midjourney-lawsuit-sued-court-1849991363
- https://ethicsunwrapped.utexas.edu/case-study/therac-25
- https://www.datanami.com/2023/01/17/hallucinations-plagiarism-and-chatgpt/
- https://www.washingtonpost.com/media/2023/01/17/cnet-ai-articles-journalism-corrections/