首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Notes on 'Refactoring' - 5.2 Replace Exception with Test

2012-12-23 
Notes on Refactoring -- 5.2 Replace Exception with TestBefore Refactoringif(index list.size())

Notes on 'Refactoring' -- 5.2 Replace Exception with Test
Before Refactoring

   if(index >= list.size()){      return null;   }   return list.get(index);



Benefits: Avoid too many exceptions since it is not so good to read and it should only be used for an exception flow.

热点排行