Interesting… I am curious about the purpose of this analysis (other than the ‘interesting-ness’ of it). Sure, some names read like sentences, but that beats the ’strcpy()’, doesn’t it? I love that in Smalltalk / Pharo, I don’t have to remember cryptic function names and can make the code optimally verbose (if there is such a thing) to express intent. If that means a method is rather long, so be it.
Jerry Kott This message has been digitally signed. PGP Fingerprint: A9181736DD2F1B6CC7CF9E51AC8514F48C0979A5 > On 21-06-2019, at 2:35 AM, Ben Coman <b...@openinworld.com> wrote: > > > > On Fri, 21 Jun 2019 at 12:43, K K Subbu <kksubbu...@gmail.com > <mailto:kksubbu...@gmail.com>> wrote: > Nice graph, Ben! The larger test names (selector size > 100) look more > like sentences than names ;-). > > On 21/06/19 6:50 AM, Ben Coman wrote: > > classes := Object allSubclasses select: [ :cc | cc isKindOf: > > TestCase class ]. > > methods := c flatCollect: [ :c | c allMethods ]. > > Ahh, yes. Blame evolution of the Playground code between when I used it and > when I copied it here. > > > Did you mean "classes" flatCollect: here? > > > tests := methods select: [ :m | m selector beginsWith: 'test' ]. > > lengths := tests collect: [ :m | m selector size ]. > > select:thenCollect: can also be used here. > > yes. but I was checking each stage as it grew incrementally. > > > > lengths asBag keysAndValuesDo: [ :len :count | Transcript crShow: > > len; show: ','; show: count ] > > I find the in: selector very handy for quick commands without having to > use undefined temps. e.g. > ```` > (Object allSubclasses select: [ :cc | cc isKindOf: TestCase class ]) in: > [ :classes | > (classes flatCollect: [ :c | c allMethods ]) in: [ :methods | > (methods select: [ :m | m selector beginsWith: 'test' > ] thenCollect: > [ :m | m selector size ]) in: [:lengths | > lengths asBag keysAndValuesDo: [ :len :count > | Transcript crShow: > len; show: ','; show: count ]]]] > ```` > > cool > > cheers -ben