Smalltalk Design Question

Mark Wai mwai at ibm.net
Thu Jan 29 05:16:24 UTC 1998


At 05:54 PM 1/28/98 -0000, Alejandro wrote:
>Hi!
>
>Mark Wai; it is your name.
>you write it as 'Mark Wai'
>not 'MARK WAI'
>nor 'mArk wai'
>why?
>If you think it is the same... consider to change YOUR Smalltalk...

How do you know I prefer my name to write as 'Mark Wai' and not 'Mark WAI'?
Do you know the name ordering rule in Chinese name? (see below section)
What should I do if my friend writes me a letter but print my name in the
envelope as 'MARK WAI'?  Should I ignore my friend until they print my name
correctly and throw the letter in the garbage can because I cannot recognize
my own name?  What should the post office do if the country is printed all
lower case like usa instead of  USA?  Should the post office send it to a
country called usa?  Where is usa?  

Oh my, I am now regretting that I started this thread.  I am also very
disappointed to myself that I did not get my question stated clearly because
9 out of 10 people misunderstand and misinterpret my point.  I would stop
now so that messages won't flooded to everybody mailbox.  I apologize for
creating so many messages.   I should have just quietly changed my own
Smalltalk to do what I think is right (in fact I did just that).  But before
I leave, I want to try my best and clarify for the last time:

1)  I am interested to know from the design and/or implementation point of
view, why Smalltalk method lookup has to be case sensitive and why the
compiler will store case sensitive selectors.

2) Point number one has nothing to do with writing all lower or upper case
method name.  The programmer will still have the freedom to choose any case,
whether it be upper, lower or mixed case.   Again, my question has nothing,
NOTHING, nothing, NOTHING to do with suggesting to write all lower or upper
case method.  NO NO NO NO NO.  

Symbolic based language like Japanese or Chinese, unlike English, does not
have the concept of case and therefore, case related ambiguity would not
exist.  When I write my name in Chinese, there is only *one* and only *one*
way to write it.  But as you use my name in your above example, there could
be 2^7 = 128 ways of writing it with different casing in English for a
simple 7 letter name.  BTW, in any important forms that requires me to print
my name, I always print Mark WAI instead of Mark Wai because I want to 
emphasis that my last name is WAI, not Mark since Chinese writes last name
first instead of first name and sometimes western people confuse with that
and end up putting our last name as first name and our
first name as last name in their record.   Quite a few of us have adopted
printing our last name in all upper case to avoid confusion.   So you see,
there are exceptions, and these exceptions, in my opinion, should not make
the same thing means differently.  These exceptions are purely cosmetic,
personal perference, typo mistake and for readibility reasons.  If you were
to build a simple GUI application that takes customer name as input, would
you ask the customer exactly for each letter of their name, what case do
they pefer?  Or you simply use your common sense and type it?  Could you
make typo mistake?  Could you make wrong common sense that the customer
otherwise would not prefer?  In any case, when you try to retrieve the
customer name from the database in the future, would you match the name
based on case sensitive or you would convert the comparing strings to all
upper or lower case first?  If you insist on case senstive searching and if
you make a typo mistake the first time, are you going to create another
customer record with the "correct" casing but ignoring the fact that you are
in fact creating two *same* customer?  (BTW, most systems that I have seen
will convert the inputted name string to uppercase before storing to the
database regardless how it was typed in the text widget)  Similar to this
example, what I was trying to bring up was the underling storing and
retrieving mechanism of Smalltalk method, not the visual effect.

Ok,  thanks for those who provided me comments on performance aspect
consideration.  This confirm my thinking that performance was *not* the
reason or at the very least, not the contributing factor, well, if this
issue have ever considered..

Thanks.





>Smalltalk evolve with every user. :-)
>People write names always in the same manner (when they want to say the same).
>
>why to work to have less?  (work to be case in-sensitive) :-)
>
>I want to mention some points I consider when writing Smalltalk sentences.
>When I write text in a workspace, I am outside of any context, in the ether.
>But when writing a method for anObject I am "the object" (the receiver) and
writes upon its point of view.
>anObject can name a Global object, it is outside itself and this object
must be named in loud voice (then I write it's name in upperCase).
>If anObject needs a part of it. This part is immediate to it and can be
named in lowercase. As the part is inside itself another object can't name it.
>When an object must name itself or an object known universally (Universal
Concept) it can name it in lowercase because this concepts are known
anywhere (like self, nil, true, false, 1, 10, $a, ...)
>
>And... what about message names?
>When we write a sentence we begin with uppercase and then continue with
lowercase upTo: $.  :-)
>In the case of OOP the first word is the receiver's name and it casing is
governed by the preceding rules...
>Then is normal that all the remaining messages will be in lowercase.
>
>Writing messages in UpperCase is like speaking in loud voice! :-)
>And if you write messages like #ASUPPERCASE many people will be irritated. :^)
>
>Hope this helps.
>Ale.
>
>Alejandro F. Reimondo
>Feel free to visit Smalltalk User Group of Argentina (SUGAR)
>at http://www.sugarWeb.com
>
>Attachment Converted: c:\internet\eudora\attach\RE Smalltalk Design Question
>
--
Mark Wai
Frontier Systems Architecture Inc.	
mailto: mwai at ibm.net or:[ mwai at frontiersa.com]       
__





More information about the Squeak-dev mailing list