Introspection and statistics are a fun game to play with a Smalltalk image. I've posted a number of these before. Here's todays query:
allCodeSymbols := Set new.
Root
enumerateMethods:
[:class :selector :code |
code
allSymbolLiteralsDo:
[:each | allCodeSymbols addAll: (each runsFailing: [:char | char = $:])]].
allCodeSymbols
groupedBy:
[:each | (each piecesCutWhere: [:a :b | a isLowercase and: [b isUppercase]]) size]
Ever noticed how you have a hard time coming up with a good method name? Or maybe a good user message key? So you end up typing out something that rivals a novella to explain what it does, all in camelCase? I was doing so earlier, and decided to see how close I was getting to a default development environment's worst offender. I was at 8 at the time. I was beat out by a the method checkForNameSpaceAndDataInZeroOrMultiplePackagesOn: which has 12 words in there.
Have a better one? Leave a comment and share your worst offender.