AI 時代的程式設計思維仍然重要
Programming as a Way of Thinking Still Matters in the Age of AI
作者認為,AI 雖能代寫程式,程式設計仍是把人的想法外化、拆解並形式化,再檢視實作是否符合需求的思考活動。文章從人類計算員、λ 演算、圖靈機及 Lisp 的歷史出發,主張計算可先以形式系統表達,毋須預設特定電腦。作者建議以 AI 製作小型作品,配合圖表、決策表等表示方式檢視行為,並按觀察調整實作和需求。
About This Translation
This is an English translation of an article I originally published in Japanese on Zenn. I am sharing it here on DEV Community for English-speaking readers.
Has Programming Become Unnecessary?
Over the past few years, AI has begun writing code. The practice of humans writing programs as text is disappearing. Learning the syntax of a programming language, looking up how to use libraries, building up code one line at a time. These kinds of tasks are disappearing.
Seeing this change, some people may feel that programming skills themselves have become unnecessary.
But AI does not have your thoughts and ideas. You need to externalize them and put them in a form AI can take in. Then you have to check how they came across to the AI and what form they took, and judge whether the result meets your requirements. In fact, activities like these are the essence of programming.
In this article, I want to reconsider what programming is and discuss what we should learn from here on, and how.
What Is Programming in the First Place?
Is It About Giving Instructions to Computers?
What is programming in the first place?
Open an introductory programming book, and you will often find it described as writing code that a computer can execute. That certainly fits the modern image of programming, and I think it is a reasonable explanation for beginners. When I was teaching programming, I sometimes gave that explanation in the first lesson myself (although I personally felt it did not do much to explain what programming actually is).
But is it reasonable to explain programming on the assumption that its purpose is to operate a machine called a computer? Does “something you do to operate a mysterious machine called a computer” adequately explain programming?
The problem is that a computer is also sometimes described as “a machine built to execute programs.” “Programming means creating programs for a computer to execute.” “A computer is a machine that executes programs.” If these are our only explanations, each refers to the other, leaving us with a circular definition in which the meaning goes round and round.
So I would like to look back through the history of computer science and consider how computers and programming came about.
The History of Computer Science
“Computer” Was a Human Occupation
The word “computer” originally referred to a human occupation. In Japanese, these workers are called keisanshu, or human calculators. Before machine computers became widespread, theorists in science, engineering, the military, space exploration, and other fields constructed huge, complex mathematical formulas, while separate groups of people divided up the work of calculating them.
It is interesting to look at how those complex formulas were calculated.
For example, when a formula was broken down into repeated addition, the process would look like this:
- Scientists or researchers devised a complex mathematical formula.
- The complex formula was broken down into simple addition and laid out in an instruction manual and specially designed calculation sheets.
- Dozens of human computers added the numbers in the specified boxes and wrote the results in the neighboring boxes.
What is interesting is that the people responsible for step 3 could get on with the work as long as they could add, even if they did not understand what the original formula meant. They only had to write the results of the additions in the designated boxes. They did not need to interpret the meaning of the original formula at every step.
This division of labor was probably necessary not only because the formulas themselves were complex, but also because of the enormous volume of calculations involved. Even a small mistake along the way would affect subsequent results. To divide that huge amount of work among people, the complex formulas had to be reduced to simple calculation procedures that others could follow.
So a “computer” was not originally a machine at all. What mattered here was the ability to perform simple calculations by following a prescribed procedure. It did not have to be a human, and it did not have to be a machine.
Lambda Calculus
Just as human computers followed procedures for addition and subtraction, we can also perform computations by following rules for rewriting symbols. Next, I would like to look at lambda calculus.
Lambda calculus is a system that expresses computation through function definition and application, and the transformation of expressions. By combining lambda expressions, which are anonymous functions, we can represent numbers, operations on numbers, conditional branching, iteration, and recursion.
Here, let us use notation similar to JavaScript arrow functions and work through substitutions on paper. const is shorthand for giving an expression a name, and A and B are symbols for which we do not specify concrete values.
For example, we can express Boolean values and conditional branching as follows:
// Boolean values (Church Booleans)
const TRUE = x => y => x; // Take two arguments and select the first
const FALSE = x => y => y; // Take two arguments and select the second
// Select one of two alternatives according to the condition
const IF = cond => thenExpr => elseExpr => cond(thenExpr)(elseExpr);
TRUE takes two arguments in succession and returns the first. FALSE returns the second. IF uses the function passed as its condition to select one of the two alternatives.
Once we have constructed these expressions, we rewrite them according to the rules to obtain a result. Obtaining a result from an expression in this way is called evaluation.
The basic rule is to replace occurrences of a function's parameter with the argument supplied to it. Consider this expression, for example:
(f => x => f(x))(A)
The outer function takes f and returns x => f(x). Since we pass it A, we replace the occurrence of f in that body with A.
x => A(x)
This kind of substitution is called β-reduction.
Now let us use the conditional we defined earlier.
IF(TRUE)(A)(B)
We can rewrite this expression as follows. Each line shows the expression obtained from the preceding one.
// Expand IF to its definition
(cond => thenExpr => elseExpr => cond(thenExpr)(elseExpr))(TRUE)(A)(B)
// Replace cond with TRUE
(thenExpr => elseExpr => TRUE(thenExpr)(elseExpr))(A)(B)
// Replace thenExpr with A
(elseExpr => TRUE(A)(elseExpr))(B)
// Replace elseExpr with B
TRUE(A)(B)
// Expand TRUE to its definition
(x => y => x)(A)(B)
// Replace x with A
(y => A)(B)
// Pass B as y. The body is A, so A remains unchanged
A
Sure enough, when the condition is TRUE, we obtain the first alternative, A. With FALSE, following the same rules gives us B.
Here, the meaning of Boolean values and conditional branching is defined through combinations of functions and transformation rules. The behavior “select the first if true, and the second if false” is represented in the form of an expression. These representations are also discussed in Peter Selinger's lecture notes on lambda calculus.
There are expressions that represent computations and rules for transforming those expressions. By constructing expressions, we can create a program; by following the rules, we can carry out its computation. In this sense, we can view lambda calculus as a very small programming language.
What is interesting is that no particular computer has appeared in the explanation so far. By constructing lambda expressions and rewriting them according to the rules, we have been able to explain a program and its execution.
In this case, we could call the activity of constructing a lambda expression for what we want to compute programming.
Why Lambda Calculus Was Developed
Why, then, was lambda calculus conceived?
In his papers of 1932 and 1933, Alonzo Church worked with expressions using λ and their transformations, with the aim of establishing foundations for logic.
Later, in his 1936 paper, he used lambda calculus and other approaches to define what it means for something to be computable, and showed that there are problems that no general computational procedure can solve.
What kinds of expressions can we construct? By what rules can we transform those expressions? How far does that allow us to compute?
The discussion thus progressed from establishing foundations for logic to giving a precise account of computation itself.
Turing Machines and Mechanical Objectivity
There is another model that, like lambda calculus, addresses the question “What is computation?” It is the Turing machine.
In a paper submitted in 1936, Alan Turing developed the concept of an abstract machine that would later be called the Turing machine.
The background was the decision problem in mathematics. To discuss whether a general computational procedure exists for answering a given problem, it was first necessary to define precisely what it means to compute by following a procedure.
Turing therefore analyzed the calculations humans perform on paper and represented computation through basic operations such as reading a symbol, rewriting it, moving the position being read, and changing the internal state.
The machine here is conceived as something that faithfully executes prescribed rules. Starting from the same initial state and following the same rules determines the same behavior. Whoever carries out the procedure does not need to reinterpret its meaning or introduce independent judgments along the way.
I see “mechanical objectivity” here.
A method that makes sense only inside someone's head is difficult to examine as a computational procedure. If it is clear what to read, which rule to apply, and what to do next, other people can follow and check the process too.
The abstract machine called a Turing machine was thus a model for describing computation precisely and discussing what computation can and cannot do.
Lambda calculus and Turing machines both attempt to define precisely what computation is. Lambda calculus constructs computations through expressions and their transformation rules; Turing machines do so through symbol manipulation and state transitions.
flowchart TB
Q("What is computation?")
subgraph L["Lambda calculus"]
LE["Lambda expressions"]
LR["Transformation rules"]
LC["Rewrite expressions"]
LE --> LC
LR --> LC
end
subgraph T["Turing machine"]
TS["State and symbols"]
TR["Transition rules"]
TC["Update symbols and state"]
TS --> TC
TR --> TC
end
O("Define computation precisely")
Q --> L
Q --> T
LC --> O
TC --> O
classDef question fill:#293F54,stroke:#293F54,stroke-width:2px,color:#FFFFFF,font-weight:600
classDef object fill:#E9F5F2,stroke:#2F827A,stroke-width:1.5px,color:#205F59
classDef rule fill:#EAF0FA,stroke:#536DA6,stroke-width:1.5px,color:#293F69
classDef process fill:#FFF1E4,stroke:#C7762E,stroke-width:1.5px,color:#8A4C1E
class Q,O question
class LE,TS object
class LR,TR rule
class LC,TC process
style L fill:#F8FAFC,stroke:#D5DFEB,stroke-width:1px,color:#293F54
style T fill:#F8FAFC,stroke:#D5DFEB,stroke-width:1px,color:#293F54
linkStyle default stroke:#78908C,stroke-width:1.5pxFigure 1. Different formal systems answer the same question: “What is computation?” Each defines the objects and rules it works with, precisely expressing how a computation proceeds.
Lisp
I like Lisp. Let me finish this section by talking about it.
In Some Work on Arc, Paul Graham describes Lisp as something John McCarthy “discovered rather than invented.”
If we open McCarthy's 1960 paper, we find that the formalism for expressing computation and its implementation on a physical machine are discussed separately. Broadly speaking, the paper has the following structure:
- A machine-independent formal system It defines symbolic expressions, or S-expressions, and the S-functions that operate on them, and shows how to represent recursive functions symbolically.
- An implementation on the IBM 704 It explains how to represent S-expressions as list structures in memory and how to implement the functions that operate on them as programs.
The opening of the paper also explains that these representations of functions are independent of the IBM 704 or any other electronic computer.
First, it defines a formalism for expressing computation, then describes how to realize it on an actual computer. The Lisp paper reflects a perspective that treats these as two separate matters.
A Computer Is Not a Prerequisite
Tracing the origins of programming in this way, we can see that the original aim was to express computation precisely, break it down into simple operations, and construct it.
We can define expressions and rules that represent computation without assuming the existence of a particular computer. We can also examine on paper what happens when we follow those rules. And if a computation is constructed so that its steps can be followed mechanically, we can entrust it to a computer.
First comes the activity of constructing a computation, and a program is its result. The program is in a form that a machine can execute, or has been constructed so that a machine can execute it.
I see a computer as a device for executing computations constructed through programming.
What Is Computation in the First Place?
In light of all this, if someone asked me what a computer is, I would answer, “Something that computes.”
But what is computation in the first place?
In lambda calculus and Turing machines, computation has been rigorously constructed as the manipulation of expressions or symbols. Still, I feel that simply presenting those formalisms is not yet enough to explain programming in this article. Modern computers do more than calculate mathematical expressions: they process text, construct graphics, search data, and change the state of applications. If we include these tasks, what does it mean to compute? I want to reconsider computation as an activity in relation to the various kinds of work modern computers perform.
I think of computation as obtaining a new result from information currently available by carrying out a procedure with some form of mechanical objectivity.
For example, suppose our current information consists of 3 and 5. Applying the rule of addition to these two numbers gives us a new result, 8.
Applying a rule that converts the string "abc" to uppercase gives us the result "ABC". Earlier, IF(TRUE)(A)(B) likewise gave us A as the result of selecting from two alternatives based on a condition.
In each case, we apply a rule to current information and obtain a new result.
Here, let us think of a computation as a function that takes arguments and returns a value. The current information becomes the arguments, and the new result obtained from it becomes the return value.
flowchart LR
subgraph I["Current information / arguments"]
N["Numbers 3, 5"]
S["String abc"]
end
subgraph C["Applying a rule"]
A["Addition"]
U["Convert to uppercase"]
end
subgraph R["New result / return value"]
V["8"]
W["ABC"]
end
N --> A --> V
S --> U --> W
classDef input fill:#E9F5F2,stroke:#2F827A,stroke-width:1.5px,color:#205F59
classDef rule fill:#EAF0FA,stroke:#536DA6,stroke-width:1.5px,color:#293F69,font-weight:600
classDef result fill:#293F54,stroke:#293F54,stroke-width:1.5px,color:#FFFFFF,font-weight:600
class N,S input
class A,U rule
class V,W result
style I fill:#F5F9F8,stroke:#C6DAD5,stroke-width:1px,color:#546C68
style C fill:#F6F8FC,stroke:#D5DFEB,stroke-width:1px,color:#536DA6
style R fill:#F5F7F9,stroke:#C9D3DC,stroke-width:1px,color:#293F54
linkStyle 0,1,2,3 stroke:#78908C,stroke-width:2pxFigure 2. A computation takes current information as arguments, applies a rule, and produces a new result as its return value.
Sorting a collection of data, extracting data that meets a condition, and determining the next state from the current one can all be understood as computations of this kind.
Complex computations can produce results I had not anticipated. Even so, each step proceeds according to the rules. The novelty of a result and whether each step of execution requires creative judgment are separate questions.
What Is Programming?
So, what is programming?
I believe the essence of programming lies in expressing human thought, breaking that expression down, simplifying it, and making it precise—and giving it the form of computations and combinations of computations as a means to that end. In other words, it is the activity of formally constructing computations.
Through those computations, the activity extends further, to constructing effects on the world. I see programming as an activity with that broader reach.
Externalizing Human Thought
Try expressing what you are thinking in words, diagrams, or formulas. You may discover that a single word carries several meanings, or that you are unclear about what you want to happen. You then break that expression down, dividing its complex parts into simpler elements. You make explicit what is related to what, and what you expect to happen under which conditions.
To make that expression precise, you give it the form of computations or combinations of computations. By clarifying what is given, which rules are applied, and what is obtained, you can express your ideas in a way that other people can follow and check.
In this way, you externalize the thoughts inside your mind and work on their expression. By looking at or running what you have expressed, you can notice ambiguities in your thinking and relationships you had not anticipated. Those discoveries lead you to reconsider both the expression and your own ideas.
A program is the result of this activity, and a machine can execute the computations constructed within it. A programming language can thus be understood as a means of externalizing thought and expressing it in the form of computation.
Let me return to the earlier discussion of human computers. Many people would regard translating a formula into simple computational procedures as programming. I consider devising the formula itself to be part of programming, too. This includes both the What—what you want to achieve—and the How—how to achieve it. The formula is the What, and the computational procedure is the How.
Today, some people may regard deciding the What as an upstream activity, separate from programming. I do not see it that way. I believe the very idea that What and How can be separated independently is an illusion. Thinking about how to achieve something, and actually trying to build it, also changes what you want to achieve. I will return to this relationship in “Reconciling Requirements and Implementation.”
Expressing Thought as Combinations of Computations
As you break your thoughts down, you can express each part in greater detail and with greater precision. To express the relationships between those parts as well, you combine the computations that represent them. One computation produces a new result from current information, and that result is passed to the next computation. This produces another new result. These connections express the overall mechanism you had in mind.
Consider attacking an enemy in a game. You determine damage from attack power and defense, then use that damage and the enemy's current HP to determine its HP after the attack. From that HP, you then determine whether the enemy has been defeated. One result is passed to the next computation, composing a coherent behavior.
Constructing Effects on the World
The next step is to connect the results of those computations to effects on the outside world.
For example, you determine a string to display, then actually display it on the screen. You decide which sound to play, then play it through a speaker. You assemble the content to save, then write it to a file. The results obtained through computation lead to displays, records, and the operation of devices.
In a game, you receive the player's actions as input and determine the next state from the current state. From that state, you determine what to display and which sounds to play, then output them as an actual display and sound. The player responds to those results with another action.
flowchart TB
I("Player action")
subgraph C["Composing computations"]
S["Current state"]
U["Compute next state"]
N["Next state"]
V["Compute display content"]
A["Choose sound to play"]
end
O("Actual display and sound")
I -->|Input| U
S --> U
U --> N
N --> V
N --> A
V -->|Render| O
A -->|Play| O
N -. "Carry forward" .-> S
O -. "Next action" .-> I
classDef human fill:#293F54,stroke:#293F54,stroke-width:2px,color:#FFFFFF,font-weight:600
classDef process fill:#EAF0FA,stroke:#536DA6,stroke-width:1.5px,color:#293F69
classDef state fill:#E9F5F2,stroke:#2F827A,stroke-width:1.5px,color:#205F59
classDef effect fill:#FFF1E4,stroke:#C7762E,stroke-width:2px,color:#8A4C1E,font-weight:600
class I human
class U,V,A process
class S,N state
class O effect
style C fill:#F8FAFC,stroke:#D5DFEB,stroke-width:1px,color:#293F54
linkStyle 0,1,2,3,4 stroke:#536DA6,stroke-width:1.5px
linkStyle 5,6 stroke:#C7762E,stroke-width:2px
linkStyle 7 stroke:#2F827A,stroke-width:1.5px
linkStyle 8 stroke:#293F54,stroke-width:1.5pxFigure 3. Computations are combined, and their results act on the outside world through rendering and playback. Computation continues from the new state and the next input.
I see programming as an activity that combines individual computations into larger ones and can extend further to encompass effects on the world.
What is received as input? What is retained as state? What results are obtained, and what do those results act on? By constructing these relationships, you can also build applications and systems that people can continue to use.
Looking at Modern Programming
In developing modern applications and systems, too, you express your requirements and ideas outside your mind, break that expression down, simplify it, and make it precise by giving it the form of computation.
Suppose you think, “I want to make a game where characters grow.” The word “growth” may give you a rough sense of the experience you want. To clarify that idea, you can distinguish between the kinds of change you regard as growth.
Does it mean accumulating experience points (XP)? Increasing stats? Gaining access to more abilities? You distinguish between these and consider how to relate them to one another.
For example, you distinguish XP from level and make the level increase when a certain amount of XP is reached. You also distinguish stats from available abilities and make them change according to level. The concept of “growth” is then expressed as information that computation can work with, together with rules that change that information.
flowchart TB
I("The idea of growth")
subgraph C["Externalized concepts"]
X["XP"]
L["Level"]
P["Stats"]
A["Available abilities"]
end
subgraph R["Rules to specify"]
G["Add XP; determine level"]
E["Update stats; learn abilities"]
end
I --> X
I --> L
I --> P
I --> A
X --> G
L --> G
P --> E
A --> E
classDef idea fill:#EAF0FA,stroke:#536DA6,stroke-width:2px,color:#293F69,font-weight:600
classDef concept fill:#E9F5F2,stroke:#2F827A,stroke-width:1.5px,color:#205F59
classDef rule fill:#FFF1E4,stroke:#C7762E,stroke-width:1.5px,color:#8A4C1E
class I idea
class X,L,P,A concept
class G,E rule
style C fill:#F5F9F8,stroke:#C6DAD5,stroke-width:1px,color:#546C68
style R fill:#FFFAF5,stroke:#E3CBB5,stroke-width:1px,color:#8A4C1E
linkStyle 0,1,2,3 stroke:#536DA6,stroke-width:1.5px
linkStyle 4,5,6,7 stroke:#78908C,stroke-width:1.5pxFigure 4. Concepts are drawn out of the idea of “growth” and expressed explicitly, and the rules for working with each are made concrete.
The same applies to time and attendance tracking. You break down the requirement “I want to record the time I have worked” into concepts such as clocking in, clocking out, and breaks, and express each as a point in time or an interval. By defining their relationships, you can construct a computation that determines working hours.
If you consider how to handle an incorrect clock-in or clock-out entry, you may also need concepts such as corrections to records, requests for corrections, and approval. The states you represent and the operations you make available will depend on whether people can correct their own records directly or whether changes take effect only after approval.
In this way, you express the ideas inside your mind, distinguish the concepts they contain, and organize their relationships. By giving that expression the form of computations or combinations of computations, you make your ideas precise.
Programming in the Age of AI
Now AI can suggest how to decompose those concepts, organize their relationships, make the rules concrete, and even write the code. People do not need to work out every detail in advance before handing it over. You can develop a representation through conversations and prototyping with AI, then look at it and consider what it is you want.
The externalized concepts and rules also include interpretations supplied by AI. The next step, then, is to reconcile that representation or implementation with your own requirements.
Reconciling Requirements and Implementation
AI's ability to distinguish concepts and make rules concrete is a separate matter from whether the resulting representation fits your requirements.
Even with the same requirement, “a game where character growth is fun,” the structure will differ depending on what growth means. AI might build a mechanism centered on XP, level, and attack power, in which attack power increases as you defeat more enemies.
But when you actually play it, you may find that repeating the same actions just to make numbers go up feels unsatisfying. Perhaps what you wanted was a wider range of abilities and ways to fight, more than simply higher numbers for strength.
By looking at the externalized structure and the behavior it produces, you begin to understand for yourself what your requirement to “enjoy character growth” actually means.
AI can turn vague requirements into concrete proposals. But making a proposal concrete does not mean that human thinking has been corrected and put on the right track. What has been created also includes interpretations and judgments supplied by AI. You need to examine the result in light of your own purpose and check where it differs from your requirements.
If you find a mismatch, you express that difference and adjust the conditions or structure. For example, you might add conditions for gaining access to new abilities to a mechanism that previously only increased attack power.
At the same time, requirements are not fixed from the outset.
Playing the game that has been built may reveal how enjoyable it is to try several abilities in a short time. Even if you originally imagined a game in which characters grow over a long period, you might incorporate that enjoyment and rethink it as a game that lets you enjoy character growth within a short play session.
You bring the implementation closer to your requirements while also updating your requirements and understanding through what has been built.
You choose what to change and what to take on board in light of your own purpose. That process of reconciliation is also part of programming.
Internalizing and Externalizing Thought
In this back-and-forth, both what we build and our understanding as its creators change.
You put the requirements in your head into words, diagrams, and models. You interact with what you have built and observe what happens. You interpret the results for yourself and reorganize your understanding. Then you express that updated understanding again.
This is a repeated cycle of externalizing and internalizing thought.
flowchart TB
T("Requirements and understanding")
subgraph E["Externalized artifacts"]
direction TB
R["Words, diagrams, models"]
P["Working system"]
end
O("Interact, observe, compare")
T -->|Externalize| R
R -->|Build with AI| P
P --> O
O -. "Adjust" .-> R
O -. "Internalize and update" .-> T
classDef human fill:#EAF0FA,stroke:#536DA6,stroke-width:2px,color:#293F69,font-weight:600
classDef model fill:#FFFFFF,stroke:#2F827A,stroke-width:1.5px,color:#205F59
classDef artifact fill:#E9F5F2,stroke:#2F827A,stroke-width:1.5px,color:#205F59,font-weight:600
classDef observe fill:#293F54,stroke:#293F54,stroke-width:2px,color:#FFFFFF,font-weight:600
class T human
class R model
class P artifact
class O observe
style E fill:#F5F9F8,stroke:#C6DAD5,stroke-width:1px,color:#546C68
linkStyle 0,1,2 stroke:#78908C,stroke-width:2px
linkStyle 3 stroke:#2F827A,stroke-width:2px
linkStyle 4 stroke:#536DA6,stroke-width:2pxFigure 5. We adjust the representation and implementation while also updating our requirements and understanding in light of the results.
I have also worked in programming education. What I ultimately hoped for was this repeated cycle of internalization and externalization, more than proficiency in a formal language.
Express an idea, make it run, and think again in light of the result. I saw learning a programming language as a means of making that activity possible.
This view also connects to Piaget's constructivism and Papert's constructionism, which builds on it.
In Genetic Epistemology, Piaget discusses how people construct knowledge by acting on objects. In Situating Constructionism, Papert and Harel emphasize the relationship between constructing knowledge and building external, shareable things, such as programs and models.
You do not have to understand everything before you start building. There is also value in interacting with something unfinished, trying it out, and rethinking it as you build.
This back-and-forth happens when creating products and when designing ways of working. In the process of building something, previously vague requirements become clearer, and we find new ways of understanding the subject. What we have externalized becomes something we can think about next.
This Article Also Grew Out of Internalization and Externalization
This article grew out of a cycle in which I asked AI to write drafts to help clarify my vague thoughts, then reconsidered those thoughts as I read what it produced.
I did not simply publish the AI's first output as-is. I read the drafts, pointed out where they differed from my intentions, supplied missing ideas, and adjusted the structure.
In a sense, I kept adding my intentions to the AI's proposals. In the process, those intentions themselves changed. That is how this article came together.
Why Learning Formal Representations Still Matters
At this point, I want to consider why we should learn programming at all.
I believe there is still value in learning programming as a way of representing things so that we can think about them ourselves.
We can communicate requirements in natural language. But other forms of representation can help when thinking about decisions involving many conditions, relationships among pieces of information, or behavior that changes with state.
| What you want to think through | Possible representation | What becomes easier to examine |
|---|---|---|
| Relationships among concepts and information | Conceptual models and data models | What you distinguish and what you connect |
| Decisions that depend on conditions | Decision tables | Combinations of conditions and missing cases |
| Actions that depend on state | State transition diagrams | Which actions are possible in each state |
| Relationships among operations | Dataflow | Which information each operation needs |
These representations let us examine specific ambiguities and decisions that do not match our requirements. We can use the same representations to think through designs proposed by AI.
A programming language is one such means of representation. Describing states and rules precisely makes it easier to think about things that are difficult to work with while they remain vague. The same language can both instruct a machine and serve as a tool for human thought.
What changes is our purpose in learning it.
There is less need to master the notation ourselves simply to make a machine carry out a process. At the same time, there is still value in choosing and using suitable representations to understand a subject, examine mismatches with our requirements, and work with the structure.
Nor does everything need to be formalized in minute detail. Some things can be thought through with a rough diagram; others become clear only when we actually run them. What matters is being able to change the form and level of detail of a representation according to what we want to think about.
Why I Want to Work on Visual Programming
This is also why I want to work on visual programming.
I want to create an environment where people can put their ideas into an external structure, then keep thinking by looking at it, manipulating it, and observing what changes.
Programs contain many kinds of structure: relationships among pieces of information, dependencies between operations, and changes in state. Visual representations can use layout, connections, and grouping to show these structures on screen.
For example, we might represent a game's character growth system as follows. In this game, total experience points and a table of experience requirements determine the current level, which in turn determines stats and available abilities.
flowchart TB
X["Total XP"]
R("XP requirements table")
J["Determine level"]
L["Current level"]
subgraph E["Linked to level"]
P["Stats"]
A["Available abilities"]
end
X --> J
R --> J
J --> L
L --> P
L --> A
classDef data fill:#E9F5F2,stroke:#2F827A,stroke-width:1.5px,color:#205F59
classDef process fill:#EAF0FA,stroke:#536DA6,stroke-width:1.5px,color:#293F69
classDef focus fill:#FFF1E4,stroke:#C7762E,stroke-width:2px,color:#8A4C1E,font-weight:600
class X,L,P,A data
class J process
class R focus
style E fill:#F5F9F8,stroke:#C6DAD5,stroke-width:1px,color:#546C68
linkStyle 0,2,3,4 stroke:#78908C,stroke-width:2px
linkStyle 1 stroke:#C7762E,stroke-width:2pxFigure 6. Changing the experience requirements affects both stats and available abilities through the character's level.
If you lower the experience requirements to speed up growth, stats will increase faster, and powerful abilities will become available sooner. A diagram makes it easier to see how a single rule affects several aspects of the game's behavior.
After playing, you might realize that you wanted stats to grow faster while keeping the pace at which abilities become available unchanged. You could then tie the unlocking of abilities to a condition other than level. You look at the structure, choose what to change, and check the result.
Or you might enjoy gaining access to abilities sooner and rethink how the game should progress around that. A change produced by manipulating the structure can help you reconsider what you wanted in the first place.
Being able to act on a representation and use the result to inform your next thought. That is the value I see in visual programming.
The same applies to things built by AI. We can represent the distinctions between concepts and the combinations of operations that AI has chosen in a form people can grasp. From there, we can find mismatches with our requirements and choose what to change. Or understanding that structure may change how we see the problem.
For this to work, we need to be able to examine how the structure on screen corresponds to actual behavior. We should be able to view the whole at a broad level, then inspect detailed operations or runtime values wherever something catches our attention. It is also important to be able to move between diagrams, natural language, and code as needed.
Putting everything into a single diagram does not automatically make it easier to understand. What should be shown? What should be grouped together? Which parts should people be able to manipulate? Designing these representations is what I want to work on.
Precisely because AI can now take on implementation, there is value in reconsidering how people can perceive, think about, and act on what has been built.
How to Learn Programming
You can start by choosing one thing you want to make and building a small version of it with AI.
As you do, go beyond listing features: describe concrete situations and how you want the system to behave in them.
For a game, examples might be, "Defeating an enemy increases experience points," or, "A new ability becomes available when experience points reach a certain threshold." Then consider what happens when the required amount is reached exactly, or when the player gains a large amount of experience at once. Examples like these make it easier to compare what has been built with your requirements.
When you run it and notice a difference, investigate where the mismatch lies. Are the controls different from what you expected? Was a condition interpreted differently? Were the concepts divided up in a way you did not intend? Even when the rules work as specified, the experience of playing may differ from what you imagined.
You can learn the forms of representation you need along the way. If the relationship between experience points, levels, and abilities is hard to understand, draw it. If you want to organize the conditions for using abilities, put them in a table. You can also ask AI to explain the structure or suggest another design.
Before making a change, predict what will change and how. Compare your prediction with the result, and revise your explanation. Try other inputs or situations to see whether that explanation still holds.
Sometimes you will change the implementation; sometimes you will change your requirements or how you use it. Reflect on what you wanted, what you observed that changed your mind, and why you chose that particular change.
Through this practice, you can acquire concepts such as decomposition, abstraction, state, dependencies, and verification as tools for your own thinking. If you need a programming language or more rigorous formal representations, learning them is a continuation of the same activity.
Programming Skills Will Still Matter
AI can now help not only with writing code, but also with refining requirements and designing systems. The burden of writing things in a form suited to a machine will continue to decrease.
What becomes more important is how we express what we want, how we understand what has been built, and how we bring the two into alignment.
We externalize human thought, then break down, simplify, and make those representations precise. To do so, we express them as computations and combinations of computations. As we examine and interact with what has been represented, we also update our requirements and understanding. I believe programming will remain relevant as a skill that supports this back-and-forth.
The visual programming work I want to pursue is also about building an environment that supports this cycle. I want what we and AI build to be something we can look at, manipulate, and keep thinking with.
References
- NASA, When the Computer Wore a Skirt: Langley's Computers, 1935–1970, 2016. Reprinted from the first-quarter 2012 issue of NASA History News & Notes.
- Alonzo Church, A Set of Postulates for the Foundation of Logic, 1932.
- Alonzo Church, A Set of Postulates for the Foundation of Logic (Second Paper), 1933.
- Alonzo Church, An Unsolvable Problem of Elementary Number Theory, 1936.
- Peter Selinger, Lecture Notes on the Lambda Calculus, Sections 2 and 3.
- Alan M. Turing, On Computable Numbers, with an Application to the Entscheidungsproblem, submitted in 1936 and published in 1937.
- John McCarthy, Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I, 1960.
- Paul Graham, Some Work on Arc, 2003.
- Jean Piaget, Genetic Epistemology, 1970. The linked page reproduces the first lecture.
- Seymour Papert and Idit Harel, Situating Constructionism, 1991.
來源:DEV Community · dev.to