Daily Tech Briefing
AI 科技速览
每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。
HackerNoon AI · 2026/7/28 07:29:49

The Microsoft Store Forced Me to Face My 6,533-Line Monolith
AI 中文解读
一位独立开发者将自用的系统监控工具PC Workman上传到Microsoft Store后,突然意识到自己一直在逃避一个长达6533行的Python“代码怪物”。这个文件是AI助手的核心,包含了96个不同功能的响应模块。以前他总觉得多写几行代码无所谓,但当软件正式上架、陌生人可能点击安装后,他不得不正视这个膨胀到让编辑器卡顿的庞然大物。
这事其实很常见:很多个人项目一开始只是为自己写的“小玩具”,代码怎么方便怎么来。但当它变成面向公众的产品后,开发者就得为代码的稳定性、可维护性负责。这个开发者白天打工、晚上写代码,最终被微软商店逼着去重构自己最头疼的部分。
对我们普通用户来说,这个故事揭示了一个隐藏事实——你安装的每个免费工具,背后都可能藏着开发者咬牙清理的“代码债务”。正是这种自我较劲,才让软件从能用到好用,从个人折腾变成可靠的产品。下次看到更新日志里写着“重构代码”时,你大概就能理解这背后有多少个不眠之夜了。
Discover AnythingSignupWrite New StoryThe Microsoft Store Forced Me to Face My 6,533-Line MonolithbyMarcin "HCK" FirmugabyMarcin "HCK" Firmuga|@hucklerHi! I’m Marcin.
22, Poland. Solo dev building PC Workman after retail shifts.
build in public and grind from 11 months!SubscribeJuly 28th, 2026TLDR Your browser does not support the audio element.Speed1xVoiceDr. One Ms. Hacker byMarcin "HCK" Firmuga@hucklerbyMarcin "HCK" Firmuga|@hucklerHi! I’m Marcin.
22, Poland. Solo dev building PC Workman after retail shifts.
build in public and grind from 11 months!SubscribeStory's CredibilitybyMarcin "HCK" Firmuga|@hucklerHi! I’m Marcin.
22, Poland. Solo dev building PC Workman after retail shifts.
build in public and grind from 11 months!SubscribeStory's CredibilityA solo dev, a plastic-welding day job, and the cleanup that a Microsoft Store
listing forced on a script that had quietly become real software.
I Had a 6,533-Line Python File. Then My App Hit the Microsoft Store.
That evening is PC Workman, a Windows system monitor with an offline AI assistant built in.
It started as a small script to watch my own overheating PC, because I could not afford to keep guessing why it throttled, and I could not afford to be wrong about it either. A while later it has a thermal model that learns the norm of my specific machine instead of an averaged spec sheet, an assistant that answers in Polish or English from live sensor data, and a listing on the Microsoft Store.
It runs fully local: no account, no cloud, nothing about your machine ever leaves it. That part matters to me more than any single feature.
Store Listning did not change the code. It changed how I read it.
The day the Store listing went live, nothing in the repository moved.
Same files, functions, and me. And yet I opened the project that evening and saw it differently. A stranger in another country could now click Install and run this on their own machine, their own PSU, their own temperatures. It had stopped being my toy.
That is a quiet, enormous feeling, and it arrived with a bill attached.
Because when you suddenly see your code as something other people depend on, you cannot keep scrolling past the one file you have been avoiding for a year.
The file I had been avoiding
It was called `builder.py`. One class, `ResponseBuilder`, 6,533 lines long. Its job is the heart of the assistant:
take a parsed intent, like "what's my temperature" or "can I run this game",
and turn it into a bilingual answer built from live data.
There are 96 of those handlers, one per intent: `_resp_temperature`, `_resp_why_slow`, `_resp_game_can_run`, and ninety-three more. Every single one lived in the same class, in the same file.I want to be honest about how it got that big, because it is not a dramatic story. It grew one handler at a time. Each new thing the assistant learned to say was ten more lines, and ten more lines never feels like a problem.
You do it a hundred times and one day the file makes your editor pause for a beat when it opens.\A monolith like that costs you in ways that do not show up on any screen. Every change touches a wall of unrelated code, so you stop making changes you should make.
You cannot work near your past self without a merge fight. And bugs love it there, because nobody reads six thousand lines at once, so there is always somewhere dark to hide.
A file you are afraid to open is a file you have already stopped improving.
A facade is a polite lie about where code lives
Here is the constraint that shaped the whole fix. The rest of the app talks to this thing through exactly one method: `
response_builder.build(result, lang)
`.
Chat panel calls it. The proactive monitor calls it. Tests call it.
I did not want to touch that surface at all. A refactor that forces every caller to change is not a cleanup, it is a second project.So the class stayed. Only its body moved out. What is left in `builder.py` is a facade: a class that still answers to every old name, but keeps almost
分享
阅读原文 ↗