[KongchangAI]
· 2 min read· 1,280 words

In the Age of AI Programming, When Do You Still Need to Write Code by Hand?

In the Age of AI Programming, When Do You Still Need to Write Code by Hand?

AI programming agents are efficient, but learning, style development, and prototype validation still require handwritten code.

The article explores the applicable boundaries of AI programming agents and argues that handwritten code is irreplaceable in three scenarios: when learning new knowledge, handwriting exposes the interference of irrelevant details in AI code and helps beginners distinguish core from noise; when cultivating code style, handwriting is the prerequisite for forming personal taste, otherwise you cannot effectively direct AI; during prototype validation, typing code parameter by parameter forces thinking about the meaning of each decision, and only after it runs should you let AI optimize. The author provides a division-of-labor framework: security-sensitive code, architecture design, and deployment configuration require deep human participation, while repetitive low-risk work can be handed to AI. The core principle is—use agents for problems you have already mastered, and personally do new domains once to maintain capability growth.

AI programming agents have become all but standard equipment for developers, but "handing everything over to AI" is not necessarily wise. A YouTube creator deeply versed in machine learning shared his framework for judgment: handwritten code still has irreplaceable value—the key lies in distinguishing between scenarios.

Learning Phase: Handwriting Code Is an Unavoidable Path to Cognition

Take scikit-learn's random forest classifier as an example—the code itself is no more than ten lines. Letting AI generate it directly, it seems you can understand it too: load the iris dataset, split the training and test sets, train, evaluate—the process is clear. But the author points out that this "understanding" is illusory.

Handwriting code makes every keyword relevant

Only when you actually type out every line do the questions surface: why must return be written as x, y? What would you get if you didn't write it that way? Why must you call .frame to get a DataFrame? What happens if test_size is changed? What exactly does n_jobs=-1 control?

More critically, the AI-generated version often mixes in a large number of details that are meaningless to beginners: random_state, n_estimators=100, float formatting, classification_report—these are reasonable in production code, but in a learning scenario they are noise. The author emphasizes that if you don't even understand the basics, you simply cannot tell which parts are core and which are附加 (additional), and you can only blindly trust AI's choices.

The KNN example further illustrates this point. When AI generates code, it automatically adds Pipeline and scaler without explaining why. When writing by hand, however, you are forced to think: why does KNN need standardization? Because it is based on distance metrics and is sensitive to feature scale—this causal relationship is only truly internalized when you write it yourself.

scikit-learn is the most mainstream machine learning library in the Python ecosystem, providing a unified interface for classic algorithms such as classification, regression, and clustering. Its API design follows the fit / predict / transform paradigm: a model first calls fit on training data to learn parameters, then uses predict to output results for new samples. Random forest is an ensemble learning method that improves generalization by building multiple decision trees and voting (classification) or averaging (regression). The train_test_split mentioned in the article is used to split the training set and test set; test_size controls the proportion of the test set; random_state fixes the random seed to ensure reproducibility; and n_jobs=-1 means using all CPU cores for parallel training. These parameters are common in production, but in a learning scenario, being exposed to them too early obscures the core logic of the algorithm itself.

KNN (K-Nearest Neighbors) is a lazy learning algorithm based on distance metrics: it does not explicitly train a model, but compares a new sample with all samples in the training set and takes the nearest K neighbors for voting. Precisely because it relies on distance calculation, differences in feature scale can seriously affect the result—for example, if income is measured in tens of thousands and age in tens, the distance will be dominated by the large-scale feature. Standardization (such as StandardScaler) scales each feature to mean 0 and variance 1, making the distance metric fair. Pipeline is a tool provided by scikit-learn that chains preprocessing and model together, avoiding data leakage caused by manually applying transformations separately on the training set and test set. AI automatically adds these steps when generating code without explaining the causality, so beginners easily know the what but not the why.

Style and Taste: AI Cannot Cultivate Them for You

The second value of handwriting code is cultivating personal style. The author shows his handwritten PyTorch CNN training code—from variable naming and the trade-off between single-line and multi-line, to the placement of blank lines—all reflect personal preference.

Handwriting code cultivates personal style and taste

These preferences have no right or wrong, but they matter. When you use an agent, only if you clearly know what style you want can you explicitly ask AI to follow it. Otherwise, you can neither judge the output quality nor make the code look "like something you wrote." Taste comes from practice, and the smallest unit of practice is typing code by hand.

The author does not advocate that once you are proficient you should still handwrite neural networks from scratch. On the contrary, he himself heavily uses voice input to describe requirements to agents. But the premise is—you must be proficient enough to describe efficiently and accept accurately.

Prototype Validation: Thinking Is Completed Through Typing

The third scenario is prototype development. When facing non-repetitive new problems, the author recommends manually writing proof-of-concept code.

The premise of describing requirements to an agent by voice is sufficient proficiency

Take MNIST data loading as an example. When you input datasets.MNIST(root='data', train=True, download=True, transform=ToTensor()), each parameter is a decision: what directory does root create? What does train=True mean? Why ToTensor? Is normalization needed? The process of typing is the process of asking questions—thinking happens at your fingertips.

After the POC runs successfully, let the agent step in to optimize: "Is this good enough? Is there a better solution?" At this point you are thinking together with AI, rather than outsourcing thinking.

PyTorch's torchvision.datasets.MNIST is the loading interface for the handwritten digit recognition dataset. root='data' specifies the root directory for data download and storage; train=True means loading the training set (setting it to False loads the test set); download=True means automatically downloading if it does not exist locally; transform=ToTensor() converts PIL images or NumPy arrays into PyTorch tensors and automatically scales pixel values from [0, 255] to [0.0, 1.0]. Normalization (such as Normalize((0.1307,), (0.3081,))) further adjusts the data to a distribution with mean 0.1307 and standard deviation 0.3081 to accelerate training convergence—whether to add this step depends on the model and training strategy, and it is precisely a decision point that you are forced to weigh when writing by hand.

Division of Labor Framework: What to Give to AI, What to Keep for Yourself

The author gives clear boundaries:

Scenarios that should be handwritten or deeply参与 (participated in):

  • Learning new knowledge and building professional capabilities
  • Cultivating code style and aesthetics
  • Prototype validation and experimental exploration
  • Complex design such as system architecture and data models
  • Security-sensitive code—must be reviewed line by line
  • Configuration files, Docker Compose, and deployment-related scripts

Scenarios that can be safely handed to agents:

  • Repetitive, low-risk work
  • "Cosmetic" changes such as front-end style adjustments
  • Scaled implementation of already clear solutions

Repetitive work can be safely handed to agents for batch completion

The author's core attitude is clear: using agents to handle problems you already know how to solve is extremely efficient; but when facing new domains, do it yourself once. "Don't let your brain atrophy"—this sentence runs through the entire sharing. Handwriting code is not resistance to AI, but a foundational capability for engineers' continuous growth—first learn to walk yourself, then let AI run for you.

"Agent" here refers to AI programming assistants with capabilities such as code generation, file operations, and command execution (such as large-model-based programming agents). Unlike simple code completion, agents can accept natural language instructions, autonomously plan multi-step operations, and directly modify project files. This capability amplifies efficiency, but also amplifies risk: agents may introduce dependencies that seem reasonable but hide errors, or make destructive changes without fully understanding the context. Therefore, security-sensitive code (such as authentication, encryption, and permission checks) must be manually reviewed line by line; while repetitive, low-risk tasks with clear acceptance criteria are suitable for batch processing by agents. Understanding the boundaries of an agent's capabilities is the prerequisite for a reasonable division of labor.

#AI programming#handwritten code#AI agents#machine learning learning#code style#prototype validation#developer skills
Share:

Related articles