OpenAI – ChatGPT and Codex – Coding with AI

“In recent years, there has been an increasing interest in using artificial intelligence (AI) to improve the way we teach and learn. One promising application of AI in education is in coding, where tools like OpenAI Codex are changing the way students and teachers approach programming. OpenAI Codex is a state-of-the-art language model that can understand natural language and generate high-quality code in a variety of programming languages. In this blog post, we’ll explore the potential of OpenAI Codex as a powerful tool for coding in education, and how it can be used to enhance the learning experience for students and teachers alike.” 

This is how ChatGPT introduces Codex given the prompt “write an introduction to a blogpost about using openAI codex for coding in education

It would be tempting to let it write the remaining blog but I will take it from here…

I have shown Codex to some of the kids that come in the lab and they have made different programs with it. At the time we didn´t save the code so I have only a picture from one of the games they made
I have since then learned that it’s fairly easy to save it as HTML and embed it on a website. I made this little program out of only 3 prompts:
The code could be a part of an escape room game (that was the idea). Click on the screen and type “Morpheus”, see what happens. I have written down the 3 prompts, and will try to feed it the same prompts in a couple of weeks to see the difference. You can see the prompts and the code generated here:
Besides the turtle jumping game you can see in the picture (cookie clicker style), they made an “what’s the meaning of life game” a game where 42 is the answer. The AI itself chooses 42 as the answer (if you know it, you know).
They also tried to have it make horrible games like “killing babies game with fire”, which it had no ethic problems in programming. Midjourney on the hand would not let me prompt it to create a image of the game.

One thing that I have observed is that a lot of them seem to have fun with trying to mess with the AI. They told me about convincing the AI that 10+9 is 21, which is some meme, and when trained enough will accept that answer.
Same kid wrote a paper on ChatGPT using ChatGPT to write it and got a 12 (highest grade possible i Denmark), he was transparent about using the tool.
I think AI´s like Codex, which is actually only a limited beta at the moment, is showing us a small peek into the future of programming. And actually watching the code being generated, reading it and making changes to the generated code, has given me insight into java that I have had little knowledge about prior to using codex.
In the “Enter the matrix” code I have linked to, I was changing some variables to have the green text background move a bit different than it suggested in the first place. I also changed the string for the correct password in the code. This was done by trial and error, but Codex is genrally good at naming functions and variables that makes sense.
In the lab I have a software developer, who tried out codex as well. He had a hard time making it work, he was talking to “programmy” to it. Setting up variables, naming them and doing all the stuff you would normally do. But it seems to work better when it has to be creative about what to do.
Another programmer I talked to uses Codex to start his projects now. According to him Codex gives him a 5 hours head start of the software he is writing. He also used ChatGPT to look at some piece of a code that was flawed and it solved the issue right away.
Codex is already changing the way professionals do their work, but it is just as potent in the hands of students. Just imagine when it gets good at 3D-modelling and microcontroller programming! One of my students succeeded in setting up an Arduino with code generated from ChatGPT. And with the AI functioning together with any API, that will be really interesting.
In April I will be having a workshop at the Danish Fablearn conference, that will use Codex or similar tools.
It is not just about using the tool for programming, AI also raises a lot of good questions and debates that I think is important to have with our students.
I also thought about creating an afterschool AI-club where we play around with the different engines and discuss pro´s and con´s of the tools.
In Denmark, the debate about ChatGPT as a tool for cheating with school assignments is ongoing. The debates range from banning the tools, restricting WiFi and so on. Probably not a good approach. One of the better suggestions is about changing the assignments and working together with AI instead:  Analyzing the output that is generated. Checking the facts and statements that is generated. Letting the students prompt ChatGPT to writes about a topic that is well known to the student… will they agree with what is being generated? Or how about becoming a bias-detective?
How this technology will affect education in general will be interesting to see. I predict that it holds the potentiel to strengthening creativity, critical thinking and empowerment.
Lastly, I have been thinking about the role of humans and technology. I am not concerned or frightened by the technology, but I understand most of the concerns. Will programmers be unemployed in the future? Well, they will probably have a different task. I could imagine it being something like this image I have stitched together from three AI generated images made with Midjourney.
Almost 200 years ago Morse made the telegraph, and it required special knowledge to send and receive the code that enabled us to communicate. Today everyone can communicate over distance without that special skill. One could say that the morse code has evolved a better GUI – The telephone.
Coding has for a long time also been a special skill, and a lot of mysticism has been around coding. Now code can be generated by an AI, anyone can code if they can prompt their idea.
Imagine the AI being allowed, or being able, to write code that a human never would be able to think through or have the great overview in – which could give us software that is unimaginable today. Let us say that the telegrafist should morse the code that is running a zoom meeting, he would be hopelessly slow of course. Maybe that is how it would look for programmers in the future looking back at their colleagues in the 2020´s.
But where does that leave us as educators? Is it worth teaching them to code python for example? Is it more a question of learning to create prompts and think of algorithms?