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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Lets Ban Some Words

1 点作者 tsewlliw将近 13 年前

1 comment

lmm将近 13 年前
Refactoring: sure, it's not specific, but if you spent a day doing it you probably found fifty different things that were duplicated across the codebase and fixed them all. Try and be more specific (in particular, tell other people which areas of code you're touching, so that you won't conflict), but it's not a bad word any more than "programming" is.<p>Framework: yes and no. Sometimes you can separate your concerns much more effectively by declaring that a certain part of the code is only concerned with UI, or database access, or something. At that point, declaring this piece to be a framework helps keep your code clean.<p>Pattern: urgh. I've written code exactly like what I see there, but it was for the case where there are four different cases and I expect there to be more. I hates that code, but it is indeed a way to work around language deficiencies; if you don't like it, use a better language.<p>Abstract: I would agree except that the java syntax for defining a delegate inline is so verbose. The client code for the example given looks like:<p>new Once&#60;Void&#62;() { protected T expensiveCalculation(){ return null;} };<p>If you write it the way the author suggests, this becomes new Once&#60;Void&#62;(new Callable&#60;Void&#62;() { public Void call(){ return null;} });<p>And when the object needs to be Serializable the "reuse existing ecosystem" argument no longer applies, because you have to declare your own SerializableCallable interface and use that, and none of the existing Callable ecosystem implements it.