[Scilab-users] Confusion about types (typeof vs. Variabe Browser)

Federico Miyara fmiyara at fceia.unr.edu.ar
Fri Dec 6 23:23:35 CET 2019


Samuel,

Thanks for your lengthy insight. I'll just take up the challenge at the end:

> I do not see reasons to make GUIs labels exactly matching the 
> technical typeofs.
> But, please convince us.

I think the interface should be as transparent and informative as 
possible. It should confirm facts, not obscure them.

It should never create a cognitive dissonance in the user. If I have 
learned that a type is called "constant", which is confirmed by the 
outcome of applying typeof, I'll find it strange, to say the least, to 
see that the type appears as "double" in the variable Browser. At a 
minimum, I'll lose time trying to find out what's going on; I'll 
probably ask on this list, causing others, probably yourself, to lose 
their time answering, and so on.

Finally, there can be certainly no objection to use consistently a 
unique term for a single concept across the program. The only problem is 
that someone would have to change the string (or text :)) in the 
apropriate code, but it wouldn't be much of a burden and, as you said, 
there would be no backward compatibility problems.

By the way, if constant were changed to double (or to number or num.ber 
--I don't get the dot...--), then as this might cause some backward 
compatibility, consider taking the oportunity also to replace "ce" by 
"cell", and "st" by "struct", which are the offical type names,

Regards,

Federico Miyara




On 05/12/2019 19:23, Samuel Gougeon wrote:
> Le 29/11/2019 à 06:57, Federico Miyara a écrit :
>>
>> Dear all,
>>
>> I'm trying to elucidate some details regarding types. The most basic 
>> type, corresponding to real or complex decimal numbers (or vectors, 
>> matrices and hypermatrices with this kind of components) is called 
>> "constant" by the function typeof (and so listed in the documentation).
>>
>> However, the variable browser lists them as "double".
>
>
> Both are sucking legacy (i hope there is no copyright on this 
> expression). But if we should sort awful things, a variable of 
> "constant" is clearly the worst, in my not humble opinion.
>
> "double" is awful as well because personally, as a user in 2019, i 
> strictly don't care about that, 40 years ago, there was a dominating 
> "single precision" encoding, and then came the "double precision" 
> encoding, and everybody was really happy, you know. Still today, we 
> should remember this great event. OK, OK, OK. We are still very happy, 
> indeed.
> In Scilab, there is no single precision encoding. May be we should 
> propose implementing it, to look like our so loved eternal and 
> discrete and exclusive inspirator.
>
> For any normal newby, before being twisted-minded by historical and 
> external habits, a "double" is a number, or even better, for 
> interfaces where short and explicit keywords are welcome, a num.ber
>
> And for the same fresh user, what does a string mean? A rope, a chain.
> Now, when comprehensive normal -- so very creative -- persons ask why 
> we don't name a byte a string of bits, you know which answer they 
> receive? None. Very strange world, isn't it? Very.
> Yet, "Text" is a word even shorter than "String". It tells exactly 
> what this stuff is actually.
> In Scilab, a text is NOT a characters string: the basic block is the 
> text, not the character. And part() helps.
> But anyway, which user really cares about how texts are encoded? Is it 
> really the matter?
>
>>
>> This is somewhat confusing. 
>
>
> Oo yes. Sometimes we pay to get confused. With Scilab, it's free. Get, 
> try, and love it. Or report.
>
>> It seems that "double" refers to the way each individual component is 
>> encoded while constant may refer to the fact that any array 
>> containing doubles is o type constant.
>>
>> In the case of integers, for instance we have int64 as reported by 
>> typeof, but in the Variable Browser it is listed a bit more in full 
>> as "Integer 64". While this is also slightly inconsistent, it is not 
>> to complain very much about.
>>
>> In the case of rationals, typeof returns "rational" while the 
>> Variable Browser callsit "r (Tlist)"
>>
>> Cell array type is called "ce" by typeof but "Cell" in the Variabe 
>> Browser
>>
>> User-defined types in tlists and mlists are designed by the 
>> user-defined type name by typeof, while the variable browser adds 
>> "(Tlist)" or "(Mlist)"
>>
>> Functions, libraries and impliit lists such as $ are not listed in 
>> the variable bowser but are correctly reported by typeof
>
>
> We can add them in the list, through the /Filter/ menu.
>
> Anyway, beside the "constant" typeof, i personally do not care too 
> much about technical typeof names.
> Obviously, it is always highly preferable to choose carefully reserved 
> keywords when creating them.
> Some typeof improvements have been done for Scilab 6. And indeed we 
> could wonder why this "constant" typeof has not been changed.
> Too frequently used in existing codes? Probably.
>
> But the situation in GUIs is quite different. Back-compatibility 
> issues are somewhat less acute than in the code.
> In the variables browser and editor,
>
>   * an array of decimal real numbers could be tagged "num.ber"
>   * an array of complex numbers : "complex", despite it is the same
>     "constant" typeof. It's not the topic.
>   * a sparse array of complex numbers : "sparse complex"
>   * an array of characters string : "text"
>   * an array of int64 integers : "int64". It is definitely clear, and
>     shorter than "Integer 64" or "64 bits integers", that tell nothing
>     more or better than "int64"
>   * an array of rationals: "rational", indeed.
>   * etc
>
> I do not see reasons to make GUIs labels exactly matching the 
> technical typeofs.
> But, please convince us.
>
> Cheers
> Samuel
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

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


More information about the users mailing list