[Scilab-users] Awkward behavior of error handling <= for a too big number of inputs

Samuel Gougeon sgougeon at free.fr
Fri Feb 7 14:33:20 CET 2020


Le 07/02/2020 à 10:30, Federico Miyara a écrit :
>
> Stéphane,
>
> Thanks for the explanation.
>
> I find it already dangerous that a function be aware of the calling 
> level variables of equal name. But allowing so even for input 
> arguments is too much. I agree with you.
>
> Generally, variables inside a function are bound or dummy variables. 
> Any other variable or parameter to be collected from the context 
> should be passed through the arguments. This is much safer and better 
> programming style, I think, since everybody is aware of the previously 
> assigned variables required to be to be able to apply the function.
>
> I guess a macro designed for general use will never ever exploit this 
> feature...


There are always exceptions ;-)
Because, despite its drawbacks, this feature can also be very handy when 
there is an important needed context.

Noticeably in case of recursivity.

So, things are not all white or black.

When you see an Object-Oriented Programming language, almost nothing is 
passed through input parameters.
The major useful and used contents are "implicit" and contextual, in 
classes.

This makes OOP IDEs such Eclipse or others almost mandatory, to easily 
get explicitly the hidden context of any object (or function). 
Otherwise, programming would turn just awful.

Samuel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20200207/9acca91b/attachment.htm>


More information about the users mailing list