If I were just going to change a method name in my code, I'd just do it.
如果我想要改变我的代码中某个方法的名称,改就好了。
Here the exception was a result of a bug in my code, which was easy to fix.
这里的异常是因我的代码中的一个bug引起的,修复起来非常容易。
A graduate developer, Jerry, asked me, "How will I know that my code works?"
一个刚毕业的开发人员,Jerry,问我:“我怎么才能知道我的代码是正确的?”
In strong code ownership, there's my code and your code. I can't change your code.
在强代码所有权中,严格区分我的代码和你的代码,我不能改动你的代码。
The assertion works fine, and has the bonus that it doesn't cause my code to crash.
断言工作的很正常,也不会导致我得代码崩溃。
Many times I found bugs when trying to explain what my code is doing to a reviewer.
我好几次都是在跟检视者解释程序码时发现错误。
Up until then, I had been refactoring my code (and even other's code) without knowing it.
在此之前,我一直都在重构我的代码(或者其他人的代码),但是却不知道自己做的就是重构。
The count in Table 1 has been approximated somewhat since I experimented a bit with my code.
由于我对代码进行了一些实验,表1中的计数是近似的。
Download my code at bottom of the article for loading the Type 4 JDBC driver for SQL Server.
下载本文底部的我的代码,用于加载用于SQLServer的Type4JDBC驱动程序。
AOP modularizes crosscutting concerns, so I should look for crosscutting concerns in my code.
AOP模块化了横切关注点,因此我要在代码中寻找横切关注点。
Since I've captured early requirements in the form of test cases, I can easily refactor my code.
由于我已经通过测试用例捕获了早期需求,我可以轻松地对代码进行重构。
I like to modularize my code, so I allow separate controllers for different parts of the application.
我要对我的代码进行模块化,这样就可以有单独的控制器来处理应用的不同部分了。
The complexity of my code would increase greatly, which is obviously detrimental to the final product.
代码的复杂性将会大大提高,很明显,这会损害最终的产品。
Simply having the discipline to think about how to test my code before writing it makes it better.
只要记住这条规程—在编写代码之前考虑如何测试代码—就可以使代码变得更好。
When I learn design patterns and apply them as part of my design process, it makes my code more robust.
当我学习设计模式并将它们作为我设计过程中的一部分时,它使我的代码更优秀。
AOP modularizes crosscutting concerns, so I should look for code that is scattered and tangled in my code.
AOP模块化横切关注点。因此应该寻找那些分散和纠缠在代码中的代码。
There may be some better coding tricks to shorten this a bit, but I like to keep my code somewhat readable.
也许有一些更好的编码技巧来将代码缩短一点,但我喜欢让我的代码保持相当的可读性。
The small steps also let me keep up with my code coverage as I develop, and build a richer specification.
这些步骤还能使我在开发期间跟踪代码覆盖情况,从而构建更加丰富的规范。
In my code journeys and programming adventures I've encountered many strange foes, and even stranger Allies.
在我的编程生涯中我碰到过很多奇奇怪怪的对手和同盟。
I use the EJB 3.0 specification in my code examples; the concepts are the same for the Spring Framework and JOTM.
我在代码示例中使用EJB 3.0规范;同样的概念也适用于SpringFramework和JOTM。
I wanted my code to be short and maintainable since I would probably be adding additional features to it later on.
我试图使代码短小并具可维护性,因为稍后我还要加入一些其他特性。
With weak code ownership, there's my code and your code, but it is accepted that I could go in and change your code.
弱代码所有权中,还是会区分代码的所有者,不同的是它允许开发者改动其他人的代码。
And in my experience, my code is much simpler when tests drive it, and I'm always in the market for greater simplicity.
根据我的经验,在测试推动代码时,我的代码就会简单得多,而且我一直在设法使它们更为简单。
Now, because of this simple test, the overall design of my code is better because I've discovered a more appropriate abstraction.
现在,由于这项简单的测试,我编写的代码的整体设计更好了,因为我已经发现了更合适的抽象。
As an application developer, I cared more about what an application end-user could do rather than what my code could do inside the JVM.
作为应用开发者,我更关心应用最终用户能做什么,而不是我的代码在JVM中能做什么。
I recognize that my code will be used in ways I cannot anticipate, in ways it was not designed, and for longer than it was ever intended.
我知道我的代码会以我没有预期到的方式使用,会以与其当初设计目标不同的方式使用,使用期限也会超出最初预期。
But Hansel assured me that all my code was being executed by the original JUnit tests, so why didn't this problem show up in those tests?
但Hansel让我可以确信,通过最初的JUnit测试,所有代码都将得到执行,那么为什么在那些测试中这个问题没有暴露出来呢?
This is similar to trying to answer the question "how can I refactor my code and how much refactoring is appropriate for a given situation?"
这与试图回答“如何重构代码,在给定情形下多大程度的重构才是合适的?”
Through the course of releasing my code, I have received a number of valuable Suggestions and enhancement patches from users of these modules.
在将代码公开的过程中,我从这些模块的用户那里得到了许多有价值的建议和增强性补丁。
I want the idiomatic patterns that I harvest to stand out from the rest of my code, and DSLs provide a compelling mechanism for achieving this goal.
我想让我捕获的惯用模式从其余的代码中脱颖而出,DSL提供一个令人信服的机制来实现这一目标。
应用推荐