[Devel] LCR and avps

Dan Pascu dan at ag-projects.com
Tue Jan 2 18:25:52 CET 2007


On Tuesday 02 January 2007 18:41, Juha Heinanen wrote:
> Dan Pascu writes:
>  > 2. If you do not add this fallback capability, then the behavior
>  > will not be unclear but you need to test yourself the cases in the
>  > script and call the function accordingly:
>  >
>  > if (have_avp) {
>  >   from_gw($avp);
>  > } else {
>  >   from_gw($si);
>  > }
>
> dan,
>
> i consider the above code easier to read and understand than implicit
> assumptions from where the address to be checked comes.

What you call implicit assumption is a module parameter with a default 
value which is clearly documented. I find it as clear as an unnamed 
function parameter.

However my point was about complexity. If I have to write 5 lines of code 
to express every action I want to perform, the script will become 5 times 
bigger, more complex and harder to read.

-- 
Dan



More information about the Devel mailing list