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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

A Tale of Two Code Bases ...

43 点作者 TheSandyWalsh将近 15 年前

6 条评论

angelbob将近 15 年前
I don't think it's a coincidence that the multiplatform codebase was cleaner. Very often, things will be written quickly and then you have to clean up a lot of the technical debt as part of porting it.<p>Your assumptions about the compiler/interpreter, file system and so on often break across platforms, so you have to revisit and repair that code as part of the porting process.
评论 #1476054 未加载
评论 #1475794 未加载
tetha将近 15 年前
The major issue with creating clean code is that clean code requires a _lot_ of discpline, at least for me. Of course, if I am fresh and going, creating clean code is easy. Extract a method here, Invert that if, move that around and so on and so on and all becomes nice and cute. But if I am tired and annoyed by the code, I really have to force myself to extract that one convoluted condition, to remove that duplication and such.<p>Furthermore, I have observed that a lot of my co-students often struggle enough with getting stuff to work, and once they got it to work, uh, it works and no one really pulls himself together in order to get it into a nice, readable form, again, "Because it works, and I have other stuff to do.<p>So much to say, I had to debug a number of stuff in their code, and just by cleaning up stuff, I found bugs. <i>sigh</i>
评论 #1475397 未加载
robryan将近 15 年前
Something that can happen is you keep to the standard of the current code when you start working on it, especially when something is contact freelance, no sense in undoing what is already there, just do the best you can to tack on what you need to.<p>One project I was working like this for a while, until it got to the point where it seemed I was going to be spending a lot of time on the code base. I was working around maybe 20% of the code that wasn't mine so I finally decided it would be worth the time to rewrite out the old bad practises.
kiba将近 15 年前
It's a bit of a downer when he end the blog post with a <i>cliffhanger</i>.
kenjackson将近 15 年前
"One feature I needed to remove, which was essentially a boolean check, touched over 40 files across four applications."<p>What does this mean? How does a feature span four applications?
评论 #1475533 未加载
brown9-2将近 15 年前
How is bad code not the original developers' fault?