Why we will use obj$func() often

Mike C. Fletcher mcfletch at rogers.com
Fri Apr 23 14:50:15 EDT 2004


Mark Hahn wrote:

>"Mike C. Fletcher" <mcfletch at rogers.com> wrote ...
>
>  
>
>>$ is basically a character as far as glyphs go, it's a
>>full-height glyph with ascenders and descenders, is very similar to a
>>capital S, and generally makes reading code much harder as it obscures
>>word-shape; .this or even self.this is much easier to read because you
>>can pick out the words using your learned vocabulary of word-shapes.
>>    
>>
>
>Well I have a problem now.  I gave people on my mailing list a choice
>between $var, `var, ~var,  and ^var.  The current tally is four votes for
>$var and none for any of the others.  According to your criteria, $var is
>the worst and ~var should be the best.  Am I correct?
>  
>
Depends on the font ;) .  Certainly $ is going to have the most 
(negative) impact on readability, but the other three are all basically 
lightweight enough that they don't read as characters (basically any 
glyph that fills the same space as a lower-case o is going to markedly 
change the shape of a word.  ` is the least likely to be read as a 
character, but is really hard to distinguish from ', so likely not a 
great choice.  ^ doesn't occupy the middle space, so doesn't get read as 
a character either.  ~ doesn't read as one either because it doesn't 
touch the baseline.

$, however, is going to be familiar to your PERL aficionados, and 
familiarity counts a lot for those who are familiar with it, regardless 
of whether it's technically easier to read.  The other three are 
basically just arbitrary punctuation, so people don't have any 
associations built up with them (they don't look at them and 
automatically think "attribute access").  The dot character does have 
lots of attribute-access associations; hence a leading dot (which 
doesn't read as a character) will tend to test favourably on both scales 
(practical and familiar).

Have fun,
Mike

_______________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://members.rogers.com/mcfletch/






More information about the Python-list mailing list