What exactly is learned when learning to code?
Recently, I saw a very interesting case about an engineer named Matt Pocock from an international community who, after seeing Anthropic's prompt engineering examples, wrote a createPrompt function to express the core points of a prompt using function parameters.
This case is interesting because it embodies what one truly learns when learning to code.
On the surface, learning to code seems to be about learning the syntax of different programming languages, and then implementing a certain function through lines of code. But in fact, beyond these superficial aspects, what's more important behind coding is the ability for decomposition, pattern recognition, and abstraction.
In this example, when encountering a concrete prompt, one must first be able to decompose it into its constituent elements; then identify the meaning each of these elements represents. Therefore, when seeing a specific prompt, what is seen is not just the concrete form, but its core structure.
After identifying the core elements, through abstraction, repetitive natural language structures can be converted into program parameters, for example, the phrase 'You should maintain a friendly customer service tone' would be abstracted into toneContext to represent the 'tone style' element.
When one can achieve this, one can create a createPrompt function that, by simply inputting corresponding parameters in different scenarios, can construct high-quality prompts.
After the popularization of AI coding assistants, many people ask whether they still need to learn coding; even the founders of major AI coding tool teams (including Cursor, Devin, etc.) have mentioned in interviews that they believe learning is still necessary, because by learning to code, one can acquire a more important way of thinking.
When one can master these problem-solving ways of thinking, writing code itself becomes easy. This might also be why for most senior engineers, even if they switch to a different programming language today, they can quickly get started; because although the syntax differs, the underlying thought patterns are universal.