有时我编写了一点代码,然后编写一点测试,这样两者可以一起并进。
Sometimes I write a little code, then write a little test, and they evolve together.
在重写产品代码的时候,我们用了同样的办法:在几周的时间里,每碰到一点代码,就重写一点。
We took the same approach when converting the main code: over a number of weeks, as we touched a bit of code, we converted it.
如果查看RCP上下文(参见清单4)和RAP上下文(参见清单5)中的典型入口点代码,您会发现存在相似之处。
If we look at the typical entry point code in an RCP context (see Listing 4) vs. the RAP context (see Listing 5), you'll notice that there are similarities.
Thing I've got a little procedure that could do that, but you know the simplest thing I could do is to say well, gee, wait a minute, why don't I just check to see if these are the same thing?
这两个点是同一个点么?,我已经写了一小块代码,可以提供这个功能,但是你知道的我可以做的,最简单的事情就是说好,嗯?,等等,我为什么不直接去看看,这两个东西相等不相等呢?
Once your programs get fairly complex, it becomes harder and harder to find things and to tweak things if you're not being organized.
一旦代码稍微复杂点,而你又不规范你的代码,那么你想找什么东西就很困难了。
And when I do this test, what I want to do, is say I'm going to pick the middle spot, and depending on the test, if I know it's in the upper half, I'm going to set my start at the mid point and the end stays the same, if it's in the front half I'm going to keep the front the same and I'm going to change the endpoint.
如果我知道目标数可能,再比中值点大的区间里,我可能就会把开始点设为中值点,而尾点不变,如果在小的那个区间里,就保持开始点不变而把尾点设为中值点,你们可以看到这儿的代码,就是这么做的,对不对?它是怎么做的?
应用推荐