In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Smylers) wrote: >No! Avoid synonyms. They're initially tempting, because then everybody >gets to pick the one he/she wants to use, but then it turns out you need >to learn all of them so as to read other people's code, and that's worse >than not having them at all.
In one way I agree, but I think there's a better (right!) way to use synonyms. In natural language, you don't use a synonym to avoid learning some other word; you learn both and choose whichever one has the more appropriate connotations, the more suitable flavour under the given circumstances. (Computers care only about denotations, so typical computer languages don't bother with synonyms, but that's one of the reasons why Perl has a better flavour than your typical language.) Perl already has lots of synonyms, really: "zip" and "¥", "or" and "||", "unless" and "if not". Nobody learns <= *instead* of > -- you expect everyone to be familiar with both, and use whichever one reads better in its particular context. So some synonyms (perhaps like "has" for "is") I'm all for: people would use both on a regular basis and I don't see any problem with that. On the other hand, I do think your point applies to things like, say, suggesting "put" as a synonym for "unshift". The only reason to do that is not to have to use "unshift" at all, but you have to know it anyway because if it's available, you're going to run into it sooner or later. - David "a rose by any other name would parse as sweet" Green