Prompt Engineering is Programming
Tags: chatgpt, openai, programming, beginners
Published: 2023-08-30 07:06:28

Prompt engineering is a fairly new word. Before December of 2022 barely anyone knew what it meant. Today most people clearly understands what prompt engineering implies - But is it a new thing? Let's follow that thought down the rabbit hole a bit.

When I started programming at the age of 8 back in 1982 it was the largest kick I had experienced in my life. Here I had this _"thing"_ (the computer) that I could provide instructions to, and if my instructions were clear, it would actually do what I told it to do.

> 40 years later and I'm arguably back where I started

## Prompt Engineering defined

Prompt Engineering is the art of making a large language model return the correct output given some input. You start out with input, you apply some _"function"_, resulting in output. If the output is what you expected, you have created a correct _"function"_. In programming we supply our functions using complex programming languages such as Python, C# and Java. With prompt engineering we supply our _"functions"_ as humanly readable text. Really, that's the only difference.

Fundamentally there exist two distinct different personality types; Technical minds and social minds. Some few of us are able to move into both of these spheres. However, it requires a technical mind to do prompt engineering, the same way it requires a technical mind to create computer programs.

> To excel at prompt engineering you need a technical mind

When we create a [ChatGPT chatbot](https://ainiro.io/chatgpt-website-chatbot) what we're really doing is arguably prompt engineering. A lot of this prompt engineering is automated by for instance [scraping your website for training data](https://ainiro.io/blog/have-chatgpt-scrape-your-website), or by [integrating with your Shopify account](https://ainiro.io/blog/integrating-chatgpt-with-shopify). However, we consume [OpenAI](https://openai.com)'s APIs with system messages and context data. The context data and system messages provides instructions to ChatGPT informing it how to use our data. Our data again is the question asked by users to our chatbots.

If our prompt engineering is good and high quality, ChatGPT will return the correct output. The training data your chatbot is created from, and its system messages, becomes _"the function"_ we apply to transform input to output. Hence, our training data and our system messages becomes the equivalent for ChatGPT as a Python program is to your local computer.

## Lessons for the future

We as software developers messed up programming at some point. We _"forgot"_ what computer programming was all about, and we started creating new axioms and idioms making our own jobs much more complex. Examples are OOP, design patterns, and SOLID programming. OOP of course is nothing but the software equivalent of a mass psychosis. Instead of focusing on _"the verb"_ it moves all focus to _"the subject"_. Regardless of what process you've got, there are no _"subjects"_ in it. A process is by the very definition of the term _"a verb"_.

This created mountains of garbage code. I would know, I'm typically the guy they send out to salvage this garbage once its complexity has reached a threshold beyond the point where the average human mind can comprehend it. 41 years of experience as a programmer tends to result in such things.

I probably shouldn't complain too much. After all, it's what makes me _"useful"_, allowing me to live a fairly decent life, with more money than large portions of the world's population, enjoying respect for my skills, being able to ask for more salary than most. I also still enjoy my work, which is weird considering there are literally close to zero human beings alive today with more programming experience than me, since most programmers tends to move into other roles after some 5 to 15 years of coding.

However, there are lessons to be learned here. The primary lesson is **keep shit simple**! Where we went wrong, was by believing in our own rubbish, being that software development was difficult and complex, and therefor needed abstractions such as OOP, Design Patterns, and SOLID architectural principles to simplify it.

> Such ideas were of course nothing but a software development mass psychosis

## KISS

KISS, and I don't mean the band here, is an acronym that means _"Keep It Stupid Simple"_. It basically implies making sure you use the simplest possible solution for your problem at hand. At [AINIRO](https://ainiro.io) we've spent mountains of cognitive energy to ensure our stuff is as simple as possible. Paradoxically, the simpler it becomes, the more cognitive energy have usually been applied at the problem to ensure its simplicity.

> Simplicity is **HARD**

Which probably explains why so many programmers tends to give up the craft after some 5 to 15 years. They simply become tired of trying to simplify other people's garbage complexity after a decade, realizing their jobs are basically no different than the guy washing the toilets in the same office building.

![Gene Simmons from KISS](https://ainiro.io/assets/images/gene-simmons-kiss.jpeg)

## Conclusions ...?

According to science you need to apply 10,000 hours of programming before you're a genius. I'm not sure if I'm a genius, but I've got roughly 97,000 hours of programming behind me. Maybe if you look very hard, you'll find 5 to 10 people alive today on the planet with more hours of coding. I guess I feel responsible for future generations you might argue, so I feel obligated to come up with some sort of conclusion here ...

... and I guess the conclusion is please keep stuff simple. Avoid OOP at any cost, don't believe in Micro Services, it's anyways a cult. NoSQL is _"the new rubbish and software development's equivalent of 'get rich fast BitCoin schemes'"_, and message brokers are _"organized madness"_!

> Please, let's keep _"smart"_ out of prompt engineering, and **keep stuff simple**!

Even though prompt engineering is programming, don't believe you can learn anything from programmers. Programmers messed up the world to the point where 20,000 software developers at Facebook couldn't even make their app's _"Submit"_ button work on a Thursday ... 🤪

> I would know, my phone's Facebook app haven't worked for a month! 😂

And I'm tired of cleaning up other people's mess, so I simply stopped using Facebook from my phone. If you want a single sentence conclusion about how to approach prompt engineering, let me sum it up for you in one sentence.

> Once in doubt, ask the programmer what to do - Then **do the exact opposite**!! 😂