如果您不只想处理代码,但是又想文档化,那么就使用这种模式。
If you want to work not only in the code but also want documentation, use this mode.
问题就是必须处理代码重入。
首先,实际上您已经编写了错误处理代码。
First and foremost, you've got to actually write error handling code.
I've written a little for loop, which is going to iterate over all of the elements in the list.
让我们先看看这儿的代码,我已经写了一个循环语句,用来迭代处理数组中所有的元素。
I'm much better having an exception get handled at the time of input than to let that prop -- that value rather propagate through a whole bunch of code until eventually it hits an error 17 calls later, and you have no clue where it came from.
不是我期望的格式,这时我最好有一个异常处理,而不是让其传下去,这个值传到代码的整个分支,最终会导致一个错误17调用的发生,并且你不知道这个错误是哪里来的。
So this first line of code, and some of this again we'll be rehashed but at least you can delight in the awkwardness that is this demonstration.
因此,第一行代码,有些地方我们需要重新处理下,但至少看到这次,笨拙的演示你会很高兴。
应用推荐