读书人

Notes on #039;Refactoring#039; - 5.2 Replac

发布时间: 2012-12-23 11:28:15 作者: rapoo

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.

读书人网 >编程

热点推荐