Risk comes from not knowing what you're doing.
-Warren Buffett
You might have heard a slight uproar about Jensen Huang, the CEO of Nvidia, claiming that people shouldn't learn to code anymore because AI will take care of it. You can view the video below. What Jensen saying is actually saying is that brain power can have a greater effect from applying AI than from learning to code. That is to say, we are already making it so easy to code, that people should devote more time to learning about specific fields where they can solve problems of value, preferably while applying AI. While it is a bit self-serving to Nvidia based on the amount of GPUs required to run AI models, there is some truth to that. However, the notion of not learning to code is frankly ridiculous. Let's break it down the value of coding into three areas:
Coding as a mental language
Trust and verification
Applying AI
Language
As discussed in a prior post, the languages one speaks influences how one thinks. This is called the Sapir-Whorf hypothesis. Math and programming are their own language. Ask anyone who has gone deep enough into these fields, they combine components as a sort of conversation. Programming, like math, greatly influences the way one thinks. It provides a basis for thinking through problems logically and providing a framework (algorithms) that automate processes. Programming allows you to assess tradeoffs in processes where you can't directly intervene. If the entire population suddenly stopped learning programming, we would lose an entire framework for thinking. Accordingly, we would also lose our ability to fix or modify anything an AI might create.
Only a few will be great authors, but we all still learn to read and write. Only a few will be groundbreaking mathematicians or physicists, but we all still learn math. Perhaps eventually only a few engineers will be able to code better than an AI, but we all should still learn to code. Throwing in the towel simply because someone or something else does it better than you is not a reason to deprive yourself of knowledge.
Let me give an example of why you still need to be able to code. You may have seen Devin, an AI that can write code which supposedly eclipses the top models on the SWE-bench benchmark. It even successfully completed paid software engineering work on Upwork. People have been in awe of Devin this past week. Yet, here's the thing, Cognition labs, the company that made Devin, is still looking for software engineers. Despite how good Devin is, Cognition Labs still needs software engineers to make it better and to improve the product. This tells me that AI has yet to fully encapsulate the way people think, specifically software engineers.
Figure 1. Cognition labs looking for software engineers.
Trust and Verification
The implicit assertion in Jensen's comments is to just trust the machine, do not question, do not verify, it is perfect. Putting aside how foolhardy that is, anyone that has used a machine or tool, knows it is just that, a tool. It requires guidance and understanding of the external context to determine if and how the tool should be used.
We can find inspiration on how to handle AI in other areas where we readily hand off work to computer tools - science and engineering. Scientists and engineers will routinely offload certain design tasks to a computer program for analysis and simulation. For a given problem, such as designing a building or a computer chip, I've seen extensive debate about what the best program is to use for a given problem, how to model things, what settings to use, etc. There is a lot of outside context that is hard to capture explicitly in the tool itself and instead needs to be based on the judgement of the user and their familiarity with how the tool works. Since it won't know all the details you may know about what needs to be done, how you communicate to a tool or an AI matters.
Any sufficiently impactful project requires some level of verification. Even the top engineers at the best companies go through verification and QC processes to make sure their software works correctly. Yet, errors can still get through to end users. There is a continual process of checking that requires a separate party, that is not the creator, to conduct a review. The main reason for a third-party review is to have "fresh eyes" look things over. Coincidentally, this may also provide for the application of a different mindset in verifying correctness. Using the same "mind" to check errors as the one that created the original work is much less likely to catch errors because they think the same. Being purely reliant on AI without verifying its outputs is a road to pain. However, in order to verify the methods and outputs, one needs to have a functional understanding of how something is constructed and what is expected.
I was judging a science fair recently, and one of the criteria was to determine if the teenager did the work themselves or if they had extensive outside help. The main way to determine this is to probe for understanding of concepts and why certain decisions were made. Similarly, when using AI to code, one should have a good understanding of what the code is doing, otherwise you won't have a basis for knowing if it is actually accomplishing what you want or how to debug it.
I recently encountered a good example of this. I was playing with the code generation of some large language models and wanted them to create a function that could detect if the word red
was present in a sentence. This is a very simple coding problem. Here is the function that multiple models consistently created:
def check_for_red(text):
return "red" in text.lower()
This simple function is incorrect and the LLMs I used continuously failed to create a passing function on the first attempt. Why? The reason is a little subtle. The function is only looking for the presence of the letters "red" instead of providing spaces around the characters to ensure it is a word - a la " red ". Why does that matter? Because the above function will incorrectly assert that the word "red" is in the following sentence:
His life was spared by the robot.
The word "spared" has "red" in it. The AI naively created the function even with explicit instructions. It was only by understanding why the code was making mistakes that I could create suitable test cases and better prompt modifications to fix this behavior. To be able to trust AI, we need to be able to adequately verify it. And to do that, one needs to be able to understand what the AI is creating through the mental framework that programming provides.
Applying AI
Math and programming are beautiful and worthwhile endeavors for exploring the truth of the universe. However, a majority of the external value derived from these pursuits lies in what you can do with them and the value they can provide to the world. At the same time, while these fields can assist with many things, they can't solve everything. You would be hard-pressed to use code to resolve a political dispute or to comfort a sad friend.
Outside of improving the field and artistic purposes, programming is not itself an end point. Programming needs to be applied to solve a particular problem of value. When Jensen talks about spending more time learning other domain areas, he's making the following assertion - AI will reduce the amount of time required to spend programming much more than the amount of time it takes to understand a domain deeply. When you understand a domain, such as microbiology or aerospace engineering, it is be much easier to know if an AI or program is giving you nonsense outputs. However, understanding how to code allows you to troubleshoot bad outputs and pinpoint where the errors are occurring yourself. This requires knowledge in and experience of how to apply your tools well. In engineering school, if you ever automate something, there needs to be a hand calculation that backs it up.
What examples can we find where people use complex technology, but we don't expect them to know how to code? How about creative designers and Photoshop? Photoshop has a wealth of tools for editing images, some of which use highly advanced algorithms to modify images such that you can't tell they've been edited. We don't expect the designers to know how these tool algorithms work in order to apply them well. We only expect them to understand how different settings can affect the output from the tool. However, for advanced usage it can be helpful for a designer to understand how the algorithm works so that they can better understand the situations of when to apply a tool, why it is working well, or why it is failing without having to go through lots of trial and error. Sometimes, this knowledge can be gained through extensive experience.
When we look at applying AI to create code for a problem, we need to think about a few questions. First, disregarding the code itself, what are the outputs we would expect from the created program, and can we verify the outputs with hand calculations? Second, does the AI actually solve the problem we have in a meaningful way? Third, how will we identify or flag erroneous results and what mitigations should we put in place to prevent them? Fourth, what process should we follow to update the program if the AI continues to make repeated errors? These questions should help guide in the application of AI in creating code to help solve problems.