Programming in the age of AI
Table of Contents
Recently, I had a big debate with a few friends about teaching programming to kids. I was talking to them about a Python coding exercise that I was working on with my son. Several of these friends insisted that there is no point in learning programming anymore, since AI is going to write the code. Now, these are all very smart people, some of whom are in the tech industry, and whose opinions I value a lot. However, I strongly disagreed with their statement on prograaming, and this post outlines the argument I made in favor of learning to code.
##
Reason 1: Programming is about Problem Solving
I view programming really as a problem solving exercise. The actual act of typing code is but a small part of programming. You still do have to break the problem statement into small manageable pieces, and then solve each piece individually. Then you assemble all the smaller pieces into the final solution. These steps are common in programming, but it is also true for solving problems in any domain (see earlier post: “On Debug”). I work on other, non-programming, problems with my kids – but often those are limited to thought experiments because we don’t have the materials we need to prove out the solution.
Programming is a relatively accessible way to get exposure to this process of problem solving. All you need is a computer with an editor and a compiler or interpreter for the language of your choice. When I work with my son, we usually start with the steps to solve the problem and the baiscs of program structure. We might discuss different ways to solve the problem and conisder which solution would be more efficient or easier to program. Then I leave it to him to use any tools he wants to actually help write the code – web searches or Github/Stackoverflow code samples are fair game at this point. If he copies code from somewhere, I’ll ask him to explain what the code does.
So, the actual part of writing the code isn’t the focus – it is the problem analysis and decomposing it into smaller, solveable pieces. This part doesn’t go away even if some AI engine were to spit out the code. A human will still need to come up with an idea and prompt the AI bot to generate code and later, the human has to check that the generated code solves the problem correctly.
##
Reason 2: Programming with AI is just a different level of abstraction
The first programmers were true bit twiddlers – they programmed the early computers using physical switches and wire connections. The programs were written in machine code: the binary stream of ones and zeroes that the machine understood. Obviously, this was very tedious, error-prone, and could only be done by individuals who had intimate knowledge of the machine architecture.
Next, we invented assemblers, and we could write the code in assembly mnemonics instead of binary machine code. The assembler converted the assembly code into machine code – so writing assembly, while still tedious, was less prone to human errors. The burden eased when compilers arrived on the scene, and could convert “high level” computer languages into assembly, which the assembler converted into machine code. The actual method of input of programs into the computer was via punched cards, which had it’s own set of challenges.
As languages and compilers evolved, the languages became more expressive and got more specialized for certain use cases. While compiled languages still dominated, a lot of interpreted languages also gained popularity. One could input code directly into the computer via keyboard and output could be seen visually on a screen rather than via line printer output. Programmer productivity improved drastically with a combination of better tools like language aware text editors and IDEs. The programmer could get more immediate feedback from the compiler or interpreter, tightening the iteration loop. Debuggers became very capable and one could pinpoint the line of incorrect code.
As programmer productivity improved, the demand for programmers didn’t decrease. The creation and use of software to solve various problems exploded, especially with the rise of Internet adoption across the world. The knowledge and tools to create programs became more and more accessible. I think AI is the next step in this evolution of programming – AI will raise the level of abstraction at which the programmer operates. More of the tedious details will be taken care by the AI engine and the human can express the “code” in a language more resembling natural language rather than the computer languages. The AI engine will convert from natual language to computer language, which is then compiled and assembled down to machine code.
I believe AI will unleash the next step function jump both in programmer productivity as well as bring in more “programmers” as you won’t need experience with computer languages in order to create software. The programmer can prompt the AI engine via typed text or voice commands and get to a solution via a dialogue. Even complex programs can be created in a matter of minutes and be tested quickly. The human will still have to specify edge cases and deal with error conditions that the AI engine may not have anticipated.
##
Conclusion
The second reason convinced a few of my skeptic friends, but they still argued based on some technicalities: namely programming is not going to be programming as we know it, more about prompting. I argued that prompting will be the new programming language, but we eventually were more in agreement than before - so I consider that a minor victory.