The Art of Coding: A Cruel Optimism?

Sunil Manghani
Electronic Life
Published in
7 min readJan 28, 2024

--

“We are one step closer to having AI generate code better than humans! … The results put AlphaCodium as the best approach to generate code we’ve seen. It beats DeepMind’s AlphaCode and their new AlphaCode2 without needing to fine-tune a model!”
Santiago Valdarrama cited in VultureBeat

I built a custom GPT, The Art of Coding, which helps the user learn to code. But in doing so have I unboxed the ‘cruel optimism’ of AI code?

Recently, I designed a custom GPT — The Art of Codingto act as an AI assistant for learning to code. In principle, it attends to the ‘problem’ of an art professor seeking to learn to code, or to ‘think like a computer scientist’. A step-by-step approach of working with the GPT can be seen via a Google Colab Notebook and anyone can try the GPT for themselves via OpenAI’s GPT store, see: The Art of Coding.

Transcript of The Art of Coding

I have been impressed with the results. Not only can the GPT lucidly and patiently explain the building blocks of Python and set me homework, it also offers cogent feedback and tips for improvement. Furthermore, it has given me the confidence to take Harvard’s open course ‘Introduction to Programming with Python’, which in turn now means I have a Github account and I’m writing my homework in Visual Studio Code!

It is not entirely surprsing that AI is good at coding. There are masses of open-access examples of code, its commentary and reflexive iterations from which AI can learn. And, of course, ‘It makes sense, because ’writing code is a technical process as opposed to one that is more intuitive, like writing poetry’ (AI And The Future Of Coding) Indeed: ‘Code generation problems differ from common natural language problems’ (Ridnik, Kredo & Friedman, 2024)). In fact, it is tempting to suggest that AI coding will democratize the process of creating software (which in turn is leading to a high number layoffs in the tech sector).

We might consider the current circumstance analogous to the rise of the photographic era in the early 20th century, which Walter Benjamin wrote about famously in his essay ‘The Artwork in the Age of Mechanical Reproduction’. Benjamin observed how photography and film altered the nature and perception of art, making it more accessible and reproducible, potentially opening up the means of production (as it turned out, the art world has largely remained an elite domain). Similarly, AI in coding represents a revolution for software development. By automating the coding process, AI tools reduce the exclusivity and mystique traditionally associated with programming, much like how photography democratized art by replicating it beyond the confines of galleries. This shift not only makes coding more accessible to broader audiences but also changes the nature of software creation, potentially leading to new forms of expression and innovation in the digital realm, akin to how film and photography introduced new artistic techniques and perspectives.

In ‘Navigating the New Frontier: The Future of Coding in an AI-Driven World’, Nathan Pakovskie describes AI as an ‘intelligent assistant, handling the routine and repetitive’, and so enabling developers to concentrate on strategic and inventive aspects. ‘This partnership, he writes, ‘is leading to the creation of software that is not just functional but intelligent, adaptable, and deeply aligned with human needs and behaviors’. I would also add here the potential for productive partnership in the context of education. The experience in using The Art of Coding GPT, having access to a never tiring, one-on-one tutor, has been eye-opening and, as I mention, confidence building. The ‘revolution’, Pakovskie argues, ‘is not merely about automating tasks; it’s about redefining how we conceive, design, and deliver software solutions’.

However, is this new, innovative domain of coding tinged with ‘cruel optimism’? The concept of ‘cruel optimism,’ as articulated by Lauren Berlant (2011), refers to an attachment to a potentially harmful object of desire. An example she gives is the the pursuit of a stable and fulfilling career. Individuals are often socialized to believe that the relentless pursuit of a ‘dream job’ will lead to lifelong satisfaction and security. In the reality of fluctuating job markets, economic downturns, and the precarity of many industries, this pursuit can become a form of cruel optimism. Individuals may find themselves in a cycle of overwork, perpetual dissatisfaction, or job insecurity, despite their efforts and dedication. The optimism in securing a dream career can be cruel when it leads to burnout, underemployment, or the neglect of other life aspects. The paradox lies in the fact that the pursuit of career success, intended to bring happiness and security, can in itself result in stress, instability, and unhappiness.

In the case of the using AI for coding, with its apparent ease of use, the cruelty comes from an impending reliance on AI (which in turn replaces the need or ability to learn). While AI-driven tools, like The Art of Coding, promise accessibility and ease, they may inadvertently erect barriers to the deeper, more nuanced understanding that traditional, human-centric education offers. This paradox highlights the potential pitfalls of over-reliance on AI, where the very tool that promises liberation also constrain critical thinking and creativity. With all good intentions, my development of The Art of Coding has been aimed at those outside the domains of science and computing; its aspiration to democratize coding knowledge, to equip artists, philosophers, and humanists with the tools to think like computer scientists (even if many in these domains might fight vigorusly not to think like a computer scientist!). Inevitably, the venture is not without its dilemmas, which go beyond mere efficacies of learning.

Recent developments in AI coding tools, such as GitHub Copilot and CodiumAI’s AlphaCodium, amplify concerns. Various studies and expert opinions tend to agree that there will be increased productivity and a democratization of coding. Yet, equally there is the potential for a decline in code quality and originality. Unsurprisingly, GitHub’s own study of the effects of its so-called ‘AI pair programmer’ Copilot, the embedding of an AI coding assistant, sets out a positive assessment. The tool is clearly shown to enhance productivity and developer satisfaction. Yet, a study by GitClear reveals a trend towards decreased code quality and maintainability. A key passage sets out the problem:

We find disconcerting trends for maintainability. Code churn — the percentage of lines that are reverted or updated less than two weeks after being authored — is projected to double in 2024 compared to its 2021, pre-AI baseline. We further find that the percentage of ‘added code’ and ‘copy/pasted code’ is increasing in proportion to ‘updated,’ ‘deleted,’ and ‘moved ‘code. In this regard, AI-generated code resembles an itinerant contributor, prone to violate the DRY-ness [don’t repeat yourself] of the repos visited.
GitClear, Coding on CoPilot

We face a dichotomy, or cruel optimism: Does the convenience of AI-assisted coding sacrifice the rigour and depth integral to the art of programming?

The ‘evolution’ of AI coding reflects a deeper philosophical quandary. It challenges the nature of creativity and intuition in the coding process. As AI begins to undertake tasks ranging from routine code generation to complex problem-solving, the ‘crafting’ of code risks being overshadowed. This shift not only impacts the technical quality of code but also the philosophical essence of programming as a creative and intellectual pursuit.

The Art of Coding viewed simply as a custom GPT stikes a precarious balance. It seeks to widen access to coding, but is itself devised on a platform that allowed me to ‘code’ it using mere natural language prompts. It is a meta-example of the very dilemma of ‘learning’ to code that leads predominately to a mode of mere copy and paste. Nonetheless, I want to believe it represents a step in making coding more accessible (at least to those without any prior coding experience or know-how).

Viewed more broadly, The Art of Coding as a performance — as a form of homeopathic strategy (to echo Fredric Jameson’s account of Postmodernism) — hopes to offer a contemplative approach and a ‘makerly’ approach to ponder the implications of AI’s role in education and creativity. The journey of integrating AI into coding education, thus, becomes an exploration of the balance between technological enablement and the preservation of the human art of programming.

References

Lauren Berlant (2011) Cruel Optimism. Duke University Press.

Tal Ridnik, Dedy Kredo, & Itamar Friedman (2024) ‘Code Generation with AlphaCodium: From Prompt Engineering to Flow Engineering’, Arxiv (Computer Science > Machine Learning).

--

--

Sunil Manghani
Electronic Life

Professor of Theory, Practice & Critique at University of Southampton, Fellow of Alan Turing Institute for AI, and managing editor of Theory, Culture & Society.