ODAC code style
Posted: Wed 05 Jun 2013 11:39
I had to look at the source code ODAC to understand what crash my application and I noticed a lot of places where the code can be more optimal.
For example:
1) Use the keyword CONST for parameters of type String.
Gives a gain in resources, as well as good / right style.
2) Change Length (String_Variable)> 0 on String_Variable <>'' and
Length (String_Variable) = 0 on String_Variable =''
gives a decent win, because the Length function generates 10 lines of ASM code to 2 lines if a simple comparison.
To easily find the places I use TotalComander with the search text with the option of regular expressions:
\([a-z.\d/_]+: string
; [a-z.\d/_]+: string
Length\([a-z.\d/_]+\) > 0
Length\([a-z.\d/_]+\) = 0
For example:
1) Use the keyword CONST for parameters of type String.
Gives a gain in resources, as well as good / right style.
2) Change Length (String_Variable)> 0 on String_Variable <>'' and
Length (String_Variable) = 0 on String_Variable =''
gives a decent win, because the Length function generates 10 lines of ASM code to 2 lines if a simple comparison.
To easily find the places I use TotalComander with the search text with the option of regular expressions:
\([a-z.\d/_]+: string
; [a-z.\d/_]+: string
Length\([a-z.\d/_]+\) > 0
Length\([a-z.\d/_]+\) = 0