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