A Bilibili Video That Made My Palms Sweat
I recently watched a video essay asking: "In the late Ming Dynasty, did anyone realize the empire was about to fall?"
The answer was surprising: almost everyone did. Court officials, farmers, Korean diplomats, European missionaries, literati, enemy generals — they all saw the signs. And yet the Ming Dynasty fell anyway.
After watching, I mapped this framework onto the modern programming profession.
My palms started sweating.
Five Witnesses to an Empire's Death
Forget the textbook version. Here's what five people actually saw.
The scholar Wu Yingji. In 1627, he traveled through Henan and saw forty li of abandoned farmland. The field ridges were still there, but not a single crop grew. Farmers had sold their oxen, abandoned their land, and fled. Their tax burden was redistributed to whoever remained — who then also fled. The county magistrate didn't care. Provincial officials passed through without stopping. The entire base layer was collapsing like dominoes.
Korean envoys. As diplomats from a vassal state, they traveled from Liaodong to Beijing and saw everything clearly. The regional inspector "arrived thin and left fat." Ming soldiers killed their own comrades and claimed enemy kills for promotions. Most damning: Mongol diplomatic delegations were 80-90% composed of escaped Ming citizens — people who preferred being Mongol subjects because "in the barbarian lands, there are no forced labor duties."
The Jesuit Matteo Ricci. This Italian spent over twenty years in China and documented things that horrified him: female infanticide performed openly; slaves everywhere, priced equivalent to a pig; soldiers carrying fake weapons during peacetime; a government that provided zero public services or relief to its people.
The Wanli Emperor (by absence). He reigned for 48 years and skipped court for 30 of them. Memorials went unread, ministers went unseen, state rituals went unperformed. He spent lavishly on royal affairs — 300,000 taels for a prince's wedding, enough to feed the border army for years.
Nurhaci's son Hong Taiji. The Jurchen leader observed from outside and concluded: "By my assessment, the Ming has unmistakable signs of imminent collapse." Self-cannibalizing armies, mutual deception among officials, completely broken reward and punishment systems. He didn't need to defeat the Ming. He just had to wait.
Five perspectives. One conclusion: everyone knew it was ending, and no one could stop it.
An Uncomfortable Role Mapping
Ming Dynasty scholar-officials gained privileged status through the imperial examination, monopolizing the scarce skill of "governing the state" and enjoying compensation far above commoners.
Change a few words: programmers gain high-paying positions through CS degrees and technical interviews, monopolizing the scarce skill of "writing code" and enjoying compensation far above other professions.
Once you accept this mapping, the rest becomes unsettling:
- Imperial eight-legged essays → LeetCode + system design interviews
- Confucian classics → data structures, algorithms, design patterns
- "Ancestral laws cannot be changed" → "master CS fundamentals and you're set for life"
- Jurchen cavalry → AI (the unstoppable external force reshaping the landscape)
- Wei Zhongxian (the powerful eunuch) → Also AI (the internal tool you can wield — useful but "illegitimate")
- Wanli's negligence → Big tech organizational bloat
- Factional infighting → Framework wars, tech stack tribalism
Here's where it gets more absurd than the Ming Dynasty. In the Ming, the Jurchen cavalry and Wei Zhongxian were at least two separate entities — one attacking from outside, one propping things up from within. But for programmers, the thing helping you and the thing killing you are the same thing. Copilot is simultaneously the tool that helps you write code and the force that devalues the act of writing code. Every day you use it to boost your productivity, you're proving that human coding can be replaced — feeding the very system that will eventually make you obsolete.
The underlying logic is universal: when a class's privilege rests on a certain scarcity, and technology eliminates that scarcity, the privilege collapses.
The scholar-officials' scarcity was literacy and classical knowledge. Programmers' scarcity is the ability to write code and understand computers.
Both are being dissolved by new technology. The only difference is speed.
Four Stages of Collapse — Where Are You Now?
Stage 1: Withered Fields
Wu Yingji's forty li of abandoned farmland maps directly to today's job market. Open any job forum: big tech headcount frozen or net negative, new grad offers in freefall, mid-level engineers laid off and unable to find equivalent compensation. The positions still exist — like those field ridges — but nothing grows on them anymore.
And just like the late Ming, the people at the top don't think it's a problem. CEOs casually mention on earnings calls that they're "becoming more efficient with AI." Translation: we need fewer people. They say it lightly, the same way Ming provincial officials drove past barren fields without stopping.
Stage 2: Dominoes
The Ming's chain reaction: one farmer fled → his tax burden shifted to neighbors → neighbors fled too → burden shifted again → entire village emptied.
The programmer version: AI replaces some junior work → companies cut junior hiring → mid-level pipeline breaks → seniors have no one to mentor → AI eats into senior work too → company realizes 5 people + AI can do what 10 did → cuts half the team → survivors double their workload at the same pay → burnout → they leave too.
The most lethal domino is compensation. Tech's high salaries rest on supply-demand imbalance: qualified engineers are scarce, demand is high. AI attacks both sides simultaneously — reducing demand (automation) and increasing supply (letting non-specialists write code). When that equation flips, salaries collapse. And when salaries drop, CS stops attracting the best talent, further weakening programmers' bargaining power.
Stage 3: Fake Weapons and Fraudulent Kills
Ricci documented that Ming soldiers carried fake weapons during peacetime — "fake weapons were issued so that troops wouldn't be completely unarmed during drills." Absurd enough to make you laugh and cry simultaneously.
Today's version: resume-driven development. ChatGPT-generated code on GitHub profiles. AI-memorized interview answers. Using AI at work while pretending you didn't. Code reviews becoming theater because reviewers can't follow AI-generated logic either.
"Killing your own for credit" translates to metrics gaming: inflating PR counts, padding commits, using AI to generate cosmetically useful changes to protect performance ratings. Everyone knows it's theater. The KPI system demands it anyway.
When a system normalizes fakery, it's already consuming itself.
Stage 4: The Chongzhen Paradox
The cruelest stage.
The Chongzhen Emperor was perhaps the Ming's most diligent ruler. He reviewed memorials late into every night, genuinely trying to save the dynasty. But every "correct" move made things worse: executing Wei Zhongxian cost him the one person who could keep military funding flowing; empowering reformists intensified factional warfare; raising taxes to fund the army drove more peasants into rebellion.
Programmers are entering their own Chongzhen Paradox:
- "I should learn AI" → your productivity triples → company realizes one person can do three people's work → two get cut → next round, you're redundant too
- "I should move into management" → middle management is exactly what AI-assisted decision-making compresses first
- "I should go indie" → AI drops the indie dev barrier to zero → competition explodes → red ocean
- "I should specialize deeply" → that specialty might get swallowed by a new model tomorrow
In structural shifts, the direction of individual effort is itself uncertain. Chongzhen's last words before hanging himself: "All my ministers have failed me." Part blame-shifting, part genuine despair — I truly tried everything, but one person can't reverse the direction of history.
The Ming Paradox: Why the "Bad Guy" Kept Things Running
A deeply counterintuitive historical detail.
Wei Zhongxian, the infamous eunuch, supposedly said before his death: "After I die, the Ming will fall." He died in 1627. Chongzhen hanged himself in 1644. Seventeen years.
Wei was corrupt — no debate there. But while he lived, military pay never stopped, the Liaodong front was stable, and there were even counterattack gains. After his death: unpaid armies, mutinies erupting everywhere, Liaodong's rapid collapse.
Why? Because Wei, despite being "bad," was a pragmatist who understood how to keep systems running. He knew how to collect taxes, allocate resources, balance competing interests. Chongzhen was too idealistic. He didn't understand the complexity of reality.
This paradox has a precise analog: AI is the Wei Zhongxian of the programming profession.
It's "illegitimate" — its code is sometimes inelegant, it doesn't understand architectural philosophy, it lacks "taste." Many senior engineers look down on it, just as the Donglin faction looked down on Wei Zhongxian. But it delivers: code runs, bugs get fixed, features ship.
Those trying to resist AI, ban it at work, or insist that "hand-written code is what real engineering means" — they may be accelerating their own collapse. In an ecosystem that has already begun depending on AI, voluntarily cutting that dependency is suicide.
Jensen Huang recently said "don't learn to code — learn your domain." Many programmers were furious. But his underlying logic is identical to what the scholar Gu Yanwu argued four hundred years ago:
We spent three centuries perfecting eight-legged essays, and the country fell.
Eight-legged essays are LeetCode. "Practical learning for real-world application" is domain expertise plus AI leverage.
Who Won: Hong Taiji's Playbook
The late Ming's winner wasn't Chongzhen (struggling on a sinking ship), wasn't Li Zicheng (who toppled the old but couldn't build the new). It was Hong Taiji and Dorgon — they built a new system outside the old one, waited for it to collapse, then took over.
Hong Taiji won with three moves:
Absorb the old system's defectors. Masses of surrendered Ming generals and officials served him. He didn't reject "Ming people" — he integrated their experience into his own system. Today: treat AI as your "defector general." Use it, integrate it, make it work for you.
Don't compete on the old battlefield. The Jurchens didn't try to out-examine the Ming in Confucian classics. They competed on organizational efficiency and execution — the Ming's weakest areas. Today: don't compete with AI on coding speed and accuracy. Build advantages where AI is weakest — understanding business context, navigating ambiguity, making product decisions, handling organizational politics.
Wait patiently for the system to collapse on its own. Hong Taiji didn't rush a decisive battle. He knew the Ming's internal friction would drain it automatically. Today: don't panic into drastic career pivots. The current system (big tech, high salaries, LeetCode interviews) will collapse on its own. Your job is to be standing somewhere new before it does.
Survival Guide
A few specific, uncomfortable suggestions.
Treat domain expertise as your most important asset. AI's greatest weakness is lack of context. It doesn't know which data in your industry is dirty, which customer requirements are lies, which technically elegant solutions won't actually work on your infrastructure. Find a domain you genuinely care about — fintech, bioinfo, game economics, AI infra — and go deep enough that AI can't replace your judgment in three seconds.
Shift from selling time to selling systems. Employment is selling time. AI devalues time. What you want to sell is a system: a product generating recurring revenue, a pipeline that runs without you watching it every hour, any form of passive income. You don't need to quit your job tomorrow. But you should start building something of your own alongside it.
Business intuition is worth more than any tech stack. The scarcest person in the AI era can translate AI capabilities into business value. Identifying which business problems AI can solve, estimating ROI, convincing decision-makers to invest, packaging technical solutions into products people will pay for. Pure engineers can't do this. Pure MBAs can't either. People who understand both will be extremely valuable for the next five to ten years.
Accept uncertainty. Chongzhen's biggest mistake was trying to apply certain strategies to uncertain situations. Admitting "I don't know what will be useful in five years" is actually the only correct starting point. Maintain learning ability and adaptability. Build multiple fallback paths. Stay liquid.
The window is roughly three to five years. After that, the market value of "pure coding" will drop significantly. Before then, you need to shift your value anchor from "I can write code" to "I can create business value with technology." Three to five years sounds like plenty of time — until you realize how fast it passes while you're heads-down writing features, fixing bugs, and chasing OKRs.
Wu Yingji's Choice
Back to Wu Yingji.
He was 33 when he saw those barren fields in Henan in 1627. Still a struggling exam candidate. He went on to fail the imperial examination eight times. By the Ming's own metrics, he was a loser.
But in 1645, when the Qing army swept south, he raised an army in his hometown in Anhui. His militia recaptured most of southern Anhui. He was eventually defeated, captured, and beheaded outside Chizhou city.
The local gazette recorded one detail: after his head was brought through the city gate, "his face appeared lifelike and unchanged for three days."
Wu Yingji didn't win by the old system's rules. He was someone who didn't do well in the old system — and precisely because of that, when the old system collapsed, he wasn't bound by it. He could make his own choice.
That's what really matters after you see the "barren fields": when the moment comes, do you have the ability and courage to walk a new path?
"History doesn't repeat itself, but it does rhyme."
We're hearing the rhyme now.
The question isn't whether it's coming. The question is: when it arrives, will you be sitting in Beijing pretending you don't hear the sand grouse overhead, or will you already be building your own ship?
Written in February 2026, an era when programmers can still command high salaries for writing code. Perhaps not for much longer.