TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

AI code is legacy code?

165 点作者 krrishd6 天前

20 条评论

kachapopopow6 天前
Forget AI &quot;code&quot;, every single request will be processed BY AI!<p>People aren&#x27;t thinking far enough, why bother with programming at all when an AI can just do it?<p>It&#x27;s very narrow to think that we will even need these &#x27;programmed&#x27; applications in the future. Who needs operating systems and all that when all of it can just be AI.<p>In the future we don&#x27;t even need hardware specifications since we can just train the AI to figure it out! Just plug inputs and outputs from a central motherboard to a memory slot.<p>Actually forget all that, it&#x27;ll just be a magic box that takes any kind of input and spits out an output that you want!<p>--<p>Side note: It would be really interesting to see a website that generates all the pages every time a user requests them, every time you navigate back it would look the same, but some buttons in different places, the live chat is in a different corner, the settings now have a vertical sidebar instead of a horizontal menu.
评论 #43889073 未加载
评论 #43888978 未加载
评论 #43889713 未加载
评论 #43889120 未加载
评论 #43889003 未加载
评论 #43889202 未加载
评论 #43924979 未加载
评论 #43888866 未加载
评论 #43889015 未加载
评论 #43890280 未加载
评论 #43890126 未加载
评论 #43890793 未加载
评论 #43888924 未加载
评论 #43888937 未加载
评论 #43900761 未加载
评论 #43890067 未加载
评论 #43888987 未加载
评论 #43889602 未加载
评论 #43889985 未加载
评论 #43888887 未加载
评论 #43888855 未加载
评论 #43889815 未加载
peteforde6 天前
My hot take is that using Cursor is a lot like recreational drugs.<p>It&#x27;s the responsibility of the coder&#x2F;user&#x2F;collaborator to interact with the code and suggestions any model produces in a mindful and rigorous way. Not only should you have a pretty coherent expectation of what the model will produce, you should also learn to default&#x2F;assume that each round of suggestions is in fact not going to be accepted before it is. At the very least, be prepared to ask follow-up questions and never blindly accept changes (the coding equivalent of drunk driving).<p>With Cursor and the like, the code being changed on a snippet basis instead of wholesale rewriting that is detached from your codebase means that you have the opportunity to rework and reread until you are on the same page. Given that it will mimic your existing style and can happily explain things back to you in six months&#x2F;years, I suspect that much like self-driving cars there is a strong argument to be made that the code it&#x27;s producing will on average be better than what a human would produce. It&#x27;ll certainly be at least as consistent.<p>It might seem like a stretch to compare it to taking drugs, but I find that it&#x27;s a helpful metaphor. The attitude and expectations that you bring to the table matter a lot in terms of how things play out. Some people will get too messed up and submit legal arguments containing imaginary case law.<p>In my case, I very much hope that I am so much better in a year that I look back on today&#x27;s efforts with a bit of artistic embarrassment. It doesn&#x27;t change the fact that I&#x27;m writing the best code I can today. IMO the best use of LLMs in coding is to help people who already know how to code rapidly get up to speed in domains that they don&#x27;t know anything about. For me, that&#x27;s been embedded development. I could see similar dynamics playing out in audio processing or shader development. Anything that gets you over that first few hard walls is a win, and I&#x27;ll fight to defend that position.<p>As an aside, I find it interesting that there hasn&#x27;t been more comparison between the hype around pair programming and what is apparently being called vibe coding. I find evidence that one is good and one is bad to be very thin.
评论 #43889016 未加载
评论 #43888983 未加载
评论 #43901772 未加载
dang6 天前
The opening of the article derives from (or at least relates to) Peter Naur&#x27;s classic 1985 essay &quot;Programming as Theory Building&quot;. (That&#x27;s Naur of Algol and BNF btw.)<p>Naur argued that complex software is a shared mental construct that lives in the minds of the people who originally build it. Source code and documentation are lossy representations of the program—lossy because the real program (the &#x27;theory&#x27; behind the code) can never be fully reconstructed from them.<p>Legacy code here would mean code where you still have the artifacts (source code and documentation), but have lost the theory, because the original builders have left the team. That means you&#x27;ve lost access to the original program, and can only make patchwork changes to the software rather than &quot;deep improvements&quot; (to quote the OP). Naur gives some vivid examples of this in his essay.<p>What this means in the context of LLMs seems to me an open question. In Naur&#x27;s terms, do LLMs necessarily lack the theory of a program? It seems to me there are other possibilities:<p>* LLMs may already have something like a &#x27;theory&#x27; when generating code, even if it isn&#x27;t obvious to us<p>* perhaps LLMs can build such a theory from existing codebases, or will be able to in the future<p>* perhaps LLMs don&#x27;t need such a theory in the way that human teams do<p>* if a program is AI-generated, then maybe the AI has the theory and we don&#x27;t!<p>* or maybe there is still a theory, in Naur&#x27;s sense, shared by the people who write the prompts, not the code.<p>There was an interesting recent article and thread about this:<p><i>Naur&#x27;s &quot;Programming as Theory Building&quot; and LLMs replacing human programmers</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=43818169">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=43818169</a> - April 2025 (129 comments)
评论 #43890614 未加载
评论 #43889269 未加载
gregwebs6 天前
One definition of legacy code I have seen is code without tests. I don&#x27;t fully agree with that, but it is likely that your untested code is going to become legacy code quickly.<p>Everyone should be asking AI to write lots of tests- to me that&#x27;s what AI is best at. Similarly you can ask it to make plans for changes and write documentation. Ensuring that high quality code is being created is where we really need to spend our effort, but its easier when AI can crank out tests quickly.
评论 #43889041 未加载
评论 #43889267 未加载
评论 #43891878 未加载
lacker6 天前
It&#x27;s tough to generalize about &quot;AI code&quot;, there&#x27;s a huge difference between &quot;please make a web frontend to this database that displays table X with some ability to filter it&quot; and &quot;please refactor this file so that instead of using plain strings, it uses the i18n api in this other file&quot;.
评论 #43888893 未加载
nialv76 天前
&gt; It can infer why something may have been written in a particular way, but it (currently) does not have access to the actual&#x2F;point-in-time reasoning the way an actual engineer&#x2F;maintainer would.<p>Is that really true? A human programmer has hidden states, i.e. what is going on in their head cannot be fully recovered by just looking at the output. And that&#x27;s why &quot;Software evolves more rapidly under the maintenance of its original creator, and in proportion to how recently it was written&quot;, as is astutely observed by the author.<p>But transformer based LLMs do not have this hidden state. If you retain the text log of your conservation with an LLM, you can reproduce its inner layer outputs exactly. In that regard, an LLM is actually much better than humans.
评论 #43889312 未加载
mrweasel6 天前
My old boss and I used to defend ourselves to younger colleagues with the argument that &quot;This is how you did it back in the day&quot;. Mostly it was a joke, to &quot;cover up&quot; our screw-ups and &quot;back in the day&quot; could be two weeks ago.<p>Still, for some things we weren&#x27;t wrong, our weird hacks where do to crazy edge cases or integrations into systems designed in a different era. But we where around to help assess if the code could be yanked or at least attempt to be yanked.<p>LLM assisted coding could technically be better for technical debt, assuming that you store the prompts along side the code. Letting someone what prompt generated a piece of code could be really helpful. Imagine having &quot;ensure to handle the edge case where the client is running AIX 6&quot;. That answers a lot of questions and while you still don&#x27;t know who was running AIX, you can now start investigating if this is still needed.
评论 #43892257 未加载
评论 #43889213 未加载
OnlyMortal6 天前
All code is legacy. Business needs shift.<p>The likes of Copilot are ok at boiler-plate if it has an example or two to follow. It’s utterly useless at solving problems though.
评论 #43888708 未加载
colesantiago6 天前
We are going to get more of it anyway.<p>Plenty of new jobs from AI because of AI code, vibe coding.
DevKoala6 天前
I’ve been very successful with AI generated code. I provide the requirements and design the system architecture, and AI generates the code I would usually delegate. If any specific part requires me to dig in, I do it myself.<p>PS: Also, some people act as if they have to remove their common sense when using Gen AI code. You have to review and test the generated code before merging it.
评论 #43889142 未加载
hollerith6 天前
All this legacy code is going to be hell on the AIs that will have to maintain it in the future
评论 #43889152 未加载
closewith6 天前
Legacy code is invariably the highest earning code for any business, so this is not the angle you want to take with management if your intention is to dissuade them from AI coding tools.
评论 #43889204 未加载
评论 #43888915 未加载
TZubiri6 天前
&quot;AI is “stateless” in an important way, even with its context windows. It can infer why something may have been written in a particular way, but it (currently) does not have access to the actual&#x2F;point-in-time reasoning the way an actual engineer&#x2F;maintainer would.&quot;<p>CoT fixes this. And in a way, non CoT can retrigger its context by reading the code.<p>In a similar fashion, engineers remember their context when reading code, not necessarily by keeping it all in their head
ozim6 天前
Every piece of code is legacy code a week later.<p>Real issue is that AI code is not your code in terms of copyrights so if you want to run a company on that code and someone makes a copy you don&#x27;t even have grounds to argue.
nikanj6 天前
I believe one of the biggest growth steps on the path from junior intern to senior fellow is recognizing that code does not rot, and refactoring code biweekly because someone thought of yet another way to organize it brings zero business value.<p>&quot;That code is old and the paradigms are dated&quot; is uttered with the same disdain as &quot;That shed is old and the floorboards have dry rot&quot;<p>The best thing that happens to a startup is actual traction and paying customers, because once that happens the refactoring churn is usually shoved to the back burner
评论 #43889187 未加载
rufius6 天前
All code is legacy code from day one.
BSOhealth6 天前
Current state is temporary. What’s coming next is organic, living code. Think less testing, more self-healing. Digital code microphages.<p>Soon our excitement over CICD and shipping every minute will look very naive. There’s a future coming where every request execution could be through a different effective code path&#x2F;base.
评论 #43888769 未加载
评论 #43888914 未加载
评论 #43888832 未加载
评论 #43888902 未加载
评论 #43888960 未加载
评论 #43889402 未加载
评论 #43888815 未加载
评论 #43888736 未加载
评论 #43888822 未加载
评论 #43888861 未加载
评论 #43888908 未加载
评论 #43888770 未加载
评论 #43888735 未加载
j456 天前
Most if not all code will be legacy code, if it gets to live long enough.
vips7L6 天前
All code is legacy code.
manojlds6 天前
Every code is.
评论 #43889927 未加载