整理下目录,看了这个文件,幸好未删除. 以下是<write solid code>中的原文摘录. 1.How could I have prevented this bug? 2.How could I have automatically detected this bug? 3.If a programmer believes that a bug can simply "go away", or that fixing bugs "later" w…
原题: 4.When programmers add new elements to an enumeration, they sometimes forget to add new cases to the appropriate switch statements. How could you use assertions to help detect this problem? 附录中的答案: . . . default: ASSERT(FALSE); /*We should never…