Le 30/11/2019 à 11:30, Samuel Gougeon a écrit :
Le 29/11/2019 à 21:53, Stéphane Mottelet a écrit :
Le 29/11/2019 à 21:21, Claus Futtrup a écrit :

Hi Stéphane

Lazy = not pretty.

Matlab users do not have this possibility, and as a result, programs do not suffer from eventual border effects.

So why do they use "clear" at the beginning of every script? This is like a Matlab signature.
In Scilab, i never use clear (all), and it works.
Neither do I. But I see the same behavior in Scilab programs of users around me and very often in Scilab programs posted by users in the ML, and precisely due to the potential border effect of lazy global variables. The sydrom is:

"I don't understand why my program worked before I quit and relaunched Scilab ?"

Concerning this habit of Matlab users, I have a different theory : until recently, it was tedious to use functions in order to give a decent structure to Matlab programs because each function had to reside in one single .m file. Then may users took the habit to write very long scripts hence with variables living in the main workspace. Then a "clear" at the begining of this kind of script was at least prophylatic, not to say a must !

But I know many Matlab users using a bunch of "global" statements. This is WORSE than lazy globals...

Agreed, and IMO less handy.


users mailing list

Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688

users mailing list

Reply via email to