But when you start writing programs, especially when we get to web-based stuff where you want -- to check the user's input -- is it valid, is it an email address, -- and all these different scenarios -- it's actually often useful to be able to just enumerate them or rattle them off using this switching construct instead.
但是当你看是写程序时,特别是当我们,使用基于网络的东西,你想要,检查用户的输入-,它是合法的吗?它是不是一个电子邮箱地址?,所有的这些场景-,实际上它常常是有用的,当你用枚举结构列举它们,或者用它来快速地来说出它们。
Certainly, yeah. A number of them. Maybe too many to mention.
当然有了,是的。很多。不胜枚举。
Okay, and so on and so on.
诸如此类,不胜枚举。
This thing's nice because rather than do "if" and "and and" or "or or" and all of this, you can instead enumerate things a little more cleanly, albeit apparently at the expense of more white space.
这个东西是不错的,因为它不用“if“和“and,and“,或者“or,or“所有的这些,你可以用枚举来更清楚地表达它,虽然表面上它用了更多的空格。
应用推荐