Does the arrival of AI-assisted code generation tools such as Microsoft’s GitHub Copilot or OpenAI’s ChatGPT mean the end of human creativity?
Here’s a spoiler for the worried programmer: It does, not.
There’s no need to fear for your job just yet—given that your employer appreciates creative human ingenuity compared to the AI generation of (partial) solutions that, admittedly, could also be viewed as creative. Or can it?
In this article, we take a closer look at what it means to be a creative programmer in an age of AI code generation. In the ever-changing world of software development, creativity is more than ever needed to ideate, critically evaluate, and collaborate. AI can help with this, and its outcome can even be called creative, but it is important to distinguish between AI creativity from true human creativity.
But first, we need to set up some ground rules: What exactly does it mean to be creative, or to write (or let AI generate) a piece of code that is viewed as creative? In the field of cognitive psychology, researchers have been debating the very definition of the term for decades. Earlier work by Kaufman et al. emphasized three key parts of a creative endeavor: Something had to be (1) original, meaning not thought of before, (2) of high quality, and (3) relevant to the task at hand. Obviously, this definition of creativity comes with many problems: If I as a junior Java programmer employ reflection for the first time, it could be viewed as original to me, but not at all to the seasoned developer next to me. Next, who determines the quality? A static code analysis tool? A colleague? Which one? The same goes for relevance, as deciding what is or is not relevant could be the start of endless bickering in technical code sessions.
Fortunately, recent research developments by psychologists have evolved the definition of creativity to a more contextual approach. In a 2020 manifesto to advance creativity theory and research, co-authored by multiple authorities in the field, researchers conclude that creativity is a socio-cultural construct. In other words, it’s a social verdict: Your peers decide whether or not your programming efforts are to be called creative. That sounds like a very vague theory: What exactly does this mean for software development? Good question! That’s why my colleagues and I conducted several studies ourselves to come to a clear picture of what is perceived as creative by expert programmers in the industry.
Our studies dissected creativity for programmers, revealing seven distinct themes: technical knowledge, communication, constraints, critical thinking, curiosity, a creative state of mind, and the usage of specific creative techniques. My recent book The Creative Programmer, published by Manning Publications, explains these themes in more detail. For the purpose of this article, you should be aware that creativity entails much more than coming up with an original idea: That’s only one of the seven aspects!
Use the “CodeMotion35!” discount code to purchase The Creative Programmer by Wouter Groeneveld
When it comes to gauging creative potential, instead of evaluating the amount of original solutions (thus measuring divergent thinking), we should also look for effective collaborations that facilitate cross-pollination of ideas, usage of different levels of constraints to help move a project forward instead of backward, trigger our curiousness and creative thinking skills, and much more. The aforementioned book contains ample examples to help put this theory into practice.
Does (semi-)automatically generating code put our creativity and thus our programming jobs in danger? This is a valid question. Different studies reveal that many students and professionals struggle with the trade-off between improving abilities and facilitating the development of skills through IDE syntax templates, autocomplete coding features, and more recently, AI-assisted code generation. Let’s take a closer look at these code-generation language models to help put things into perspective.
What is Microsoft’s Copilot actually capable of? Can we rightfully deem its output as creative, taking all the seven themes of creativity in the context of programming into account? Copilot is trained with thousands of GitHub’s code repositories–without taking license issues into account, I might add, but that’s another matter. The system outputs code that can be seen as a combination of its input. This code can certainly be viewed as original. We as humans also approach novelty by combining existing knowledge into new knowledge. If Copilot suggests a piece of code you might never have thought of, you yourself deem it as a creative solution. Remember, creativity is a socio-cultural verdict.
But AI-assisted code generation tools rarely go beyond that. They do not (yet) learn on the fly or communicate live with other subsystems to adapt to the context of your programming problem like a seasoned developer would do. They do not (yet) trim, remix, summarize, and reinvent knowledge in the same way as our human brain is capable of. They do not (yet) explicitly introduce constraints to force our thinking off the beaten path. They are not (yet) capable of critically evaluating their own proposals, taking into account the various hundreds of parameters such as the satisfaction of your clients, your boss, and your peers, picking the best fit. They are not (yet) capable of pulling in an idea outside the world of programming. In summary: code generation models are a tool that can help us as programmers to come up with a solution when we lack the energy or originality to do so. But their creative potential is very much limited to one or two domains of what we can call creative problem-solving in software engineering.
We should not be afraid of these tools. In a recent study by Shraddha et al. inspecting how programmers interact with code-generating models, researchers discovered that most programmers bet on Copilot to increase the number of possible solutions for a code snippet. But the programmers still had to critically evaluate whether or not the proposed code was the best fit. Some programmers even combine multiple proposed solutions – in a, dare I say it, creative way, that Copilot could not do. Shraddha’s team discovered that programmers use these tools in two ways: to accelerate their coding, when they already know the solution but just want the tool to generate code more quickly than they can type (boilerplating, database connection setup, …), or to explore, where they are unsure how to proceed and let Copilot help generate possible solutions.
Code-generation tools are very much blind to context. The context of the problem, the project, the team, and the company. It’s up to us as programmers to elevate our skills and become creative programmers in order to correctly judge whether or not a specific proposed snippet can indeed be deemed appropriate. In other words: precisely because of the arrival of AI-assisted code generation tools, we more than ever need creative programmers!
The problem then becomes: How does a programmer level up into a creative programmer? The solution is simple. Creativity is a skill that can be learned, just like effective programming in Java or C++. Creativity is a muscle. By training in creative problem-solving techniques such as the strategic appliance of constraints or mixing and matching patterns and solutions from other domains, we can gradually become creative.
Frequent reliance on AI does not have to mean that our coding brains will eventually grow numb as long as we still critically evaluate when to reach for it and how to fit the generated solution into the whole. This is also a part of creative training.
Tools that exist to help make the life of a coder easier might reduce the need for expertise in for example certain design patterns since we could rely on Copilot for these, but the amount of creative effort has not changed: It has merely shifted from less technical knowledge to more critical thinking.
In some cases, AI-assisted coding facilitates both coding and creativity skills. For example, researchers Druga and Otero recently investigated how these tools can help families become familiar with the basics of coding through Scratch. Seeing AI generate solution proposals combined with smart quizzes on debugging and control blocks established a learning environment that fosters understanding and creativity in the coding process. If you don’t know a Scratch sprite can change appearance and color, but the AI tool suggests it, a whole new world of creative possibilities suddenly opens up.
To conclude, remember that there are multiple domains of creativity. Divergent thinking or technical knowledge are parts of creative problem-solving, but they’re not the whole picture. In addition, you can foster and grow your creative programming skills, which you will need to critically evaluate whether or not the generated solution is applicable to the task at hand. If you view AI-assisted code generation tools as just a tool that can be employed to help you get out of that creative rut instead of the beginning of the end of your programming career, you’re on the road to becoming a better (and more creative!) programmer!