[squeak-dev] The Inbox: Sound-wiz.17.mcz

Bert Freudenberg bert at freudenbergs.de
Wed Apr 28 14:40:35 UTC 2010


On 28.04.2010, at 06:32, commits at source.squeak.org wrote:
> 
> A new version of Sound was added to project The Inbox:
> http://source.squeak.org/inbox/Sound-wiz.17.mcz
> 
> ==================== Summary ====================
> 
> Name: Sound-wiz.17
> Author: wiz
> Time: 28 April 2010, 2:31:56.883 am
> UUID: 0ea1e8e2-7a94-44cd-8db8-5e01002db31a
> Ancestors: Sound-nice.15
> 
> Ok this is a resubmission of String>>sound.
> 
> I have fixed the nits. 
> 
> I have discussed why I believe this is the right word rather than asSound on the mailing list. Squeak-dev 2010. I have not heard back from Bert yea of nay. So as not to undermine my own cause I am assuming my arguments were successful.

Well, I can see the satisfying smile in being able to write "'croak' sound play". In particular if you're a native speaker. That makes my objection to it not absolute, and in any case, my opinion isn't the only one that counts ;)

But knowing the naming conventions of the system as we have it, I could never guess that selector. The name that comes to my mind when thinking "I've got a String and I want it to be a Sound, wonder if there's a direct method for that" is "asSound". Because I know the pattern of asInteger, asDate, asTime, etc. It just is more in line with the other conversion methods. For reference, I copied this list from a Protocol Browser on String:

asActionSequence     (Object)
asActionSequenceTrappingErrors     (Object)
asAlphaNumeric:extraChars:mergeUID:     (String)
asArray     (SequenceableCollection)
asBag     (Collection)
asByteArray     (String)
asByteString     (String)
asCharacter     (String)
asCharacterSet     (Collection)
asColorArray     (SequenceableCollection)
asCommaString     (Collection)
asCommaStringAnd     (Collection)
asCubic     (SequenceableCollection)
asDate     (String)
asDateAndTime     (String)
asDecomposedUnicode     (String)
asDigitsAt:in:do:     (SequenceableCollection)
asDigitsToPower:do:     (SequenceableCollection)
asDisplayText     (String)
asDraggableMorph     (Object)
asDuration     (String)
asExplorerString     (String)
asFileName     (String)
asFloatArray     (SequenceableCollection)
asFourCode     (String)
asHex     (String)
asHtml     (String)
asIdentifier:     (String)
asIdentitySet     (Collection)
asInteger     (String)
asIntegerArray     (SequenceableCollection)
asLegalSelector     (String)
asLowercase     (String)
asMorph     (String)
asNumber     (String)
asOctetString     (String)
asOop     (Object)
asOrderedCollection     (Collection)
asPacked     (String)
asParagraph     (String)
asPluralBasedOn:     (String)
asPointArray     (SequenceableCollection)
asPostscript     (String)
asPrecomposedUnicode     (String)
asSet     (Collection)
asSetElement     (Object)
asSignedInteger     (String)
asSmalltalkComment     (String)
asSortedArray     (ArrayedCollection)
asSortedCollection     (Collection)
asSortedCollection:     (Collection)
asSqueakPathName     (String)
asString     (String)
asStringMorph     (String)
asStringOn:delimiter:     (Collection)
asStringOn:delimiter:last:     (Collection)
asStringOrText     (String)
asStringWithCr     (SequenceableCollection)
asSymbol     (String)
asText     (String)
asTextMorph     (Object)
asTime     (String)
asTimeStamp     (String)
asTraitComposition     (SequenceableCollection)
asURI     (String)
asUVersion     (String)
asUnHtml     (String)
asUnsignedInteger     (String)
asUppercase     (String)
asUrl     (String)
asUrlRelativeTo:     (String)
asVersion     (String)
asVmPathName     (String)
asWideString     (String)
asWordArray     (SequenceableCollection)

To me, the little "as" prefix is not superfluous at all. It makes a selector visibly belong to a familiar class of methods.

I really really want to encourage you making Squeak easier to play with interactively. It's what makes Squeak special. But "as close to natural language as possible" is not the only criterium for that. Discoverability and consistency are important, too. And in that department, "asSound" wins, IMHO.

- Bert -





More information about the Squeak-dev mailing list