As every time we introduce a new programming concept, we'll relate it back, as we have been doing consistently, to defensive programming.
我们每次介绍一个,新的编程概念的时候,就会和以前讲的联系起来,就和我们介绍防卫性程序设计一样。
It's the same computation. But this is a nice way of writing it, often called defensive programming.
这跟原来的计算过程没什么不同,但这是写代码的更优秀的一种方式。
But here's where I'm going to practice a little bit of defensive programming.
但是这儿我们要把编程的,防御性做的好一些。
I stress it in particular because I know you're all going to get into this stage; you've got a problem set due in a couple of hours, you're still writing the code, you don't want to waste time, and I'm going to use quotes on "waste time", doing those extra things to do the defensive programming, you just want to get the darn thing done.
我特别强调了这一点,因为我知道你们都会慢慢成为程序员;,你在写代码过程中造成了一系列的错误,你还在写代码,你不想浪费时间,我想把“浪费时间“用引号圈起来,浪费时间来做因为防卫性程序设计,而带来的这些额外的事情,你只想赶紧把程序写完,这不是一个好习惯,因为当你做完回头。
应用推荐