VilmaTech.com > VilmaTech Blog > How will ChatGPT Affect Programming

How will ChatGPT Affect Programming

Technology is an endless river, and how will ChatGPT affect programming?

In the light of ChatGPT, my already diminishing programming skills are melting away. That’s probably a good thing; just as we stopped parsing pinyin to read Chinese characters when we were kids, why chase a seemingly necessary skill that is likely to fade away? Technology is an unending river, always rushing toward an unknown ocean. Our tools are becoming more efficient and easier to use. Laziness is a key driver of progress in human civilization, and with this huge push, computers are becoming smarter and smarter. In the last forty years, the way we communicate with computers has become easier and easier: in the 1990s command line interfaces were still used, and many commands had to be memorized in order to complete daily tasks; in the mid-1990s the emergence of graphical user interfaces (GUIs) allowed the user to simply point and click on icons and menus, and if one wanted to be more efficient, memorizing a few shortcuts was enough. By the first decade of the twenty-first century, we were operating more concisely on mobile devices, with many tasks accomplished with a tap or a long press or two. In the second decade, voice input technology evolved to the point where it was almost enough to replace keyboard input. All of this changed in just one generation. Skills that were once important became irrelevant as time passed.

AI is the next big change
With AI, writing programs is much faster today. While it’s still in its infancy and we still need to review programs and know how to tweak them, it’s already an amazing advancement. Software developers are moving from creators to readers, from authors to editors. Editors don’t necessarily have less work than authors, but it’s much easier to tweak what’s already there than to start from scratch.

Over the past few weeks, I’ve been intensively rewriting some past programs with the assistance of ChatGPT. I enhanced the robustness of those programs and improved the interaction. Those programs helped me automate cyclical routines, probably earned me some extra lives, and had some fun. In this reinvention, I designed features, tracked issues, and solved bugs like a detective following a trail. Each new feature implemented and each bug solved brings satisfaction; ChatGPT accelerates this process, not only by increasing efficiency, but also by making the experience of this activity more like a game.

Writing a program is supposed to be like an adventure game. We can’t solve all the problems at once, we have to iterate and improve step by step. Writing a program is like going on a hero’s journey, where we start with minimal equipment, not knowing where we will end up. It’s not until we’ve explored and traveled, and reached our goal, that we can look back and clearly understand the entire path. The process is a number of iterative steps: identify the problem, analyze the clues, apply the rules, and solve the problem. The key to programming is the design of rules, which transform input into output; and the programming language used is a precise foreign language with a well-defined syntax, which also needs to be learned.

Translating real problems into rules, translating rules into programming languages

So, the challenge of programming is twofold: translating real problems into rules; and translating rules into a programming language. Any deficiency in either of these two areas will prevent the problem from being solved, and ChatGPT can help mostly in the second area, although it can sometimes help in the first.

Computer scientist Edsger W. Dijkstra (Turing Award winner) argued against ‘natural language programming’, arguing that high-level programming languages are more than just code, they are tools for effective communication because they cut out the redundancy of natural language. And today, the reason why programming languages have become the only option for co-creating with computers is a reluctant compromise in an era of technological inadequacy.

Today, with the advent of ChatGPT, Amazon CodeWhisperer and quite a few big open source models, we see slight cracks in that solid wall. AI tools nowadays are not omnipotent and can’t solve complex problems immediately, but they can explore with us and gradually establish a delicate balance. In this balance, human and AI intelligence complement each other, with humans defining goals, breaking down and describing tasks, and AI trying to accomplish them. The new era of human-machine co-existence has never dawned as brightly as it does today.

So I decided to renovate the old program, and ChatGPT did its job well. As a further experiment, I tried writing a new program. I chose a task that I could have written myself, but would have been too intimidated to start: converting Markdown documents with paragraph markup, tables, and image markup into JSON files, and then extracting specific content from the JSON according to a set of rules and populating it into a docx template in a predefined format. In two days, a program of about 1500 lines was completed – of course, I had ChatGPT add a lot of comments to it for my own benefit later on.

The whole process was not difficult. I didn’t have a clear idea at the beginning, just an idea of where the approximate end point would be. I simply broke the process down into three parts, and then discussed each part with ChatGPT. Even if my descriptions were vague, I was able to find the right path through multiple rounds of conversation.

Of course, the right Prompt is essential. I’ve found a set of methods that are arguably ancient, originating this past March, if not earlier. It includes roleplaying, characterization, and some jailbreak tips. In general, this set of Prompts can be used for similar tasks with a few tweaks.

Working with ChatGPT has validated my view that ‘writing the program’ doesn’t quite capture all that we do; rather, we’re ‘rewriting the program’. Like sculpting an article, most of the time is not ‘writing’ but ‘rewriting’. We need to spend most of our time revising to create something we are happy with. Revision is especially critical in programming because it can literally kill you – after all, it’s because the human brain doesn’t work.

A programmer decides not to let his kids learn programming anymore

I read in the New Yorker today about a programmer who decided not to let his kids learn programming anymore. He believes that programming is not just about knowledge and skills, but an extreme test of patience. He compared programming to explaining how to assemble furniture in an unfamiliar language to a clumsy person on the phone, whose reaction always made things worse. So the feeling of relief when it was all finally done was like finally seeing the end of the road after a long and arduous journey.

In other words, computers in the past were so stupid that they had to be made to act with clear instructions. Now, times have changed.

Led by CAN, programming has become a word game. Describe the goal to ChatGPT and it will ask questions to lead to deeper thinking. Clear thinking is the key to expression, and it’s especially important in this part of the process. Through constant dialog, we can develop a deeper understanding of the idea. This is often not achieved when programming alone. Pair programming embodies this idea; now with ChatGPT, one can do it, and the pair is a master.

In the past, writing a program required you to grow a “programmer’s brain” to translate your thoughts into machine language. “The programmer’s brain is very different from the natural mind – the natural mind tends to use uncensored chunks of the mind, ignoring details. Writing programs, on the other hand, requires the detailed elaboration of every operation, every specific step, every variation of a variable, and the refinement of the task to the extreme.

When programming with ChatGPT, our chunks of thought can be expanded appropriately. Just describe the idea accurately and ChatGPT will give us the appropriate code. If the code doesn’t work, we can tweak it ourselves, or we can feed error messages back to ChatGPT mindlessly.

Familiarizing ourselves with this pattern makes everything much easier: copy the code, paste it, run it, diagnose the problem, and return to ChatGPT to paste the error message. Using iTerm2 and Vim, this process is quite efficient with a full keyboard, and thinking without assignments, loops, and branches seems to have left me with no place for my “programmer’s brain”.

When I first started to develop my “programmer’s brain”, I was attracted by the magic of computers. To me at the time, writing programs was like using spells to achieve magic and using simple everyday language to create miracles. But now, tasks that once required painstaking research, lots of practice, and deep thought can be accomplished quickly with a few simple commands.

Who can resist the temptation to be lazy?
I find myself relying more and more on tools like ChatGPT to use my own time and brainpower when I can use the arithmetic power of a machine. There are better uses for human time and brainpower: walks, books, serious meals, and long naps in the afternoon sun.

Sometimes there’s a bit of worry that my programming skills, which can’t be considered grainy in the first place, will soon become grainy. We all know that writing a program and reading code are two different things; just as we can read Leaning on the Dragon, but with great probability cannot write it ourselves. Writing programs takes practice; you can’t improve your code skills just by reading code. Writing programs, like writing articles, is good training for the mind; and that can’t be given up; after all, it’s what makes us distinctive as human beings.

So there are times when I’m tempted to find a balance between automation and creative endeavors; ChatGPT is a useful companion, but that’s about it; it can’t cross the line. But then there’s a force pulling me in the opposite direction: ChatGPT and its ilk will soon outperform human capabilities on specific tasks, and programming is likely to be the first to be outperformed. So is there really any point in continuing to practice this whole writing programs thing? Yes, what is truly valuable is an unquenchable curiosity and a spirit of exploration that is not afraid to get its hands dirty.

Comments are closed.

Latest Posts

Categories

Archives