如何找出代码库中隐藏的复制?
How do you find the duplications that have crept into your code base?
如何实现可以进行重大重构的代码库?
How do you get your code base in a place where major refactorings are possible?
对于一个代码库来说,存在相似的问题。
痛苦本身在于使用大型代码库的复杂度。
我将讨论如何发现代码库中隐藏的设计。
In it, I'll discuss how to discover design already lurking in your code base.
重复代码可能在代码库中悄然发生。
Duplicate code can creep into a code base unbeknownst to anyone.
NDepend可以比较代码库的两个版本。
代码库的可维护性直接影响着软件的整个成本。
The maintainability of a code base directly affects the overall cost of software.
首先,可以通过它们比较自己和别人的代码库。
First, they allow you to compare your code base to others along several dimensions.
这部分代码很快就会出现在代码库中。
限制通常来自于现有的代码库或来自于客户需求。
The limitations often come from the existing code base or from customer requirements.
熟悉你经常使用的代码库。
但是缺点是它仍是一个大代码库,不是真正的模块。
But the downside is that it's still one big codebase, not really modular.
虽然不用访问代码库,这仍然是一个非常困难的过程。
Although, without access to the code base, this is a much more difficult process.
首先,需要下载NDepend,然后分析你的代码库。
退出程序,如需要,会提示保存当前代码库。
Quits the program after prompting to save the current library, if necessary.
增加过多灵活性将使对代码库的每一次更改都变得更加复杂。
Adding too much flexibility makes every change to the code base more complex.
Gem是封装起来的Ruby应用程序或代码库。
A gem is a packaged Ruby application or library. It has a name e.g.
这可以让维护变得更轻松同时让你拥有一些代码库。
This will make them easier to maintain and afford you some economies of scale.
解决方案:对源代码库上应用的每个修改都运行构建。
Solution: A build is run with every change applied to a source code repository.
这不错,因为我们的作业可以引用代码库中的任何其他代码。
This was kind of cool, in that our jobs could reference any other code in our code base.
对任何项目来说,值得称赞的一点就是拥有可以轻松进行重构的代码库。
A laudable goal for any project is a code base that is easy to refactor.
任何大面积流行的公共代码库或多或少都会被认为是不可变的。
Any widely public library can be considered more or less unchangeable.
我们可以向代码库进行提交和推送,就和其他Git系统一样。
We can commit and push to our repository, much like any other Git system.
这次提交的代码是经常用到的代码库,没有什么新的了,对么?
This submission is your average, run of the mill, code library. Nothing new there, right?
我们在代码库中采用一种@public、@semipublic和@private的标准规范。
We have adopted a standard in the code base of @public, @semipublic and @private specs.
通过参考资源中的链接可以找到完整的库代码。
The full library code is available from the link in Resources.
如图3所示,可以下载三个不同版本:源代码、库和二进制。
As shown in Figure 3, you can download three different versions: source, library, and binary.
基本代码:该代码应存储在某类源代码管理存储库中。
Code base: The code should be stored in some kind of source control repository.
唯一错误的回答是手工编写代码—不使用任何库。
The only wrong answer is coding everything by hand-not using any library.
应用推荐