
Fun: Refactoring a Complex Delphi Boolean Function
http://zarko-gajic.iz.hr/fun-refactoring-a-complex-delphi-boolean-function/
here’s what my first (virtual) solution was:
|
1
2
3
4
5
6
|
function Refactored(const someInputParameters : integer): boolean;const returnValue : array [0..1] of boolean = (false, true);begin result := returnValue[GetTickCount MOD 2];end; |
From the first look, the above implementation of a boolean function is as good as any. After all, it would return either true or false, there’s no 3rd option with booleans ![]()

Fun: Refactoring a Complex Delphi Boolean Function
http://zarko-gajic.iz.hr/fun-refactoring-a-complex-delphi-boolean-function/
原文:http://www.cnblogs.com/fanbbs/p/4298571.html