[Cuis-dev] Improvement: Italic abstract classes and methods in Browser
Juan Vuletich
juan at cuis.st
Wed Dec 10 03:22:44 PST 2025
Hi Ernesto,
This is very interesting!
The main problem I see is that #isAbstract is not reliable. I loaded
your code and quickly spotted some classes that were incorrectly marked.
After some quick counting, (see at the end of this message) it looks
that like of about 700 classes in the base system, around 600 are
properly identified, and around 100 are most likely not.
We need a reliable way to identify abstract classes if the Browser is to
show that information. People will rely on it, and assume it is correct.
Does anybody know how to do this? It would be great.
Thank you!
On 2025-12-02 6:00 PM, Ernesto Ittig via Cuis-dev wrote:
> Hey all!
>
> I'm a computer science student at the University of Buenos Aires. I
> started using Cuis for it's Software Engineering course.
>
> I've noticed that when looking at complex class hierarchies for the
> first time (e.g. when opening a package I'm not familiar with), I've
> often wished I could tell at a glance which classes were concrete and
> which were abstract, to know which classes the code author(s) meant
> for me to instantiate.
>
> I'm including a change set which implements a feature where abstract
> methods (those that send #subclassResponsibility) and abstract classes
> (those that have abstract methods) have their names shown in italics in
> the class browser.
>
> I put it behind a preference (#italicAbstractClassesAndMethods) that
> is off by default.
>
> I hope you find it useful!
>
> Cheers,
> Ernesto
>
"Not abstract!"
Smalltalk allClasses select: [ :a | a isAbstract and: [ a allInstances
size > 0 ]] :: size. 8 .
Smalltalk allClasses select: [ :a | a isAbstract and: [ a allInstances
size > 0 ]].
{BitBltBoundsFinderCanvas . BoundsFinderCanvas . BoxedFloat64 .
CuisSourceFileArray . Fraction . LargeNegativeInteger .
LargePositiveInteger . LeafNode}.
"Most likely not abstract."
Smalltalk allClasses select: [ :a | a isAbstract and: [ a allInstances
size = 0 and: [a subclasses size = 0]]] :: size. 10 .
Smalltalk allClasses select: [ :a | a isAbstract and: [ a allInstances
size = 0 and: [a subclasses size = 0]]].
{ClassRenamedChangeRecord . DummyStream . Homography . SmallFloat64 .
SmallInteger . StdIOReadStream . StdIOWriteStream . TestCase .
TestResource . XorShiftRandom}.
"These are most likely abstract, and OK. Need to check, though."
Smalltalk allClasses select: [ :a | a isAbstract and: [ a allInstances
size = 0 and: [a subclasses size > 0]]] :: size. 66 .
Smalltalk allClasses select: [ :a | a isAbstract and: [ a allInstances
size = 0 and: [a subclasses size > 0]]].
"Many (all?) are actually abstract."
Smalltalk allClasses select: [ :a | a isAbstract not and: [ a
allInstances size = 0 and: [a subclasses size > 0]]] :: size. 88 .
Smalltalk allClasses select: [ :a | a isAbstract not and: [ a
allInstances size = 0 and: [a subclasses size > 0]]].
{AbstractHierarchicalList . ActiveModel . AddParameterApplier .
ArithmeticError . ArrayedCollection . AssignmentNode . AutoCompleter .
AutoCompleterMorph . Bag . BasicClassOrganizer . BitBltCanvas .
BorderedBoxMorph . BoxMorph . Categorizer . ChangeSorter . Class .
ClassCategoryReader . ClosureTraceNode . CodeFile . CodeWindow . Cursor
. DataStream . Decompiler . DecompilerConstructor . Encoder .
FileStreamException . FloatArray . FontFamily . HierarchyBrowser .
ImplicitLiteralInstructionClientHook .
InlineMethodImplementorsStepWindow . InlineMethodUsagesStepWindow .
InnerPluggableMorph . InputSensor . Inspector . InstanceVariableNode .
InstructionPrinter . Layout . LayoutSpec . Link . ListItemWrapper .
LookupKey . MessageNodeReference . Morph . MorphicAlarm . MouseEvent .
Notification . ObjectExplorer . ObjectExplorerWindow .
ObjectExplorerWrapper . ParkMiller88Random . ParseNodeEnumerator .
ParseNodeVisitor . ParserNotification . PasteUpMorph . PlacedMorph .
PluggableMorph . PluggableScrollPane . PopUpMenu . ProtoObject .
PseudoClass . RefactoringError . RefactoringWarning . ReferenceStream .
ReferenceTraceNode . ReferencesExplorer . ReferencesExplorerWrapper .
Scanner . StringRequestMorph . SystemWindow . TestFailure . TextAction .
TextAttribute . TextCommand . Theme . ThirtyTwoBitSlotsObject . Timespan
. VariableScopeFinder . VectorEngine . VersionsBrowser . Warning .
WeightTraceNode}.
"Is any of these abstract? Maybe not, and this list is ok. Not sure."
Smalltalk allClasses select: [ :a | a isAbstract not and: [ a
allInstances size = 0 and: [a subclasses size = 0]]] :: size. 334 .
Smalltalk allClasses select: [ :a | a isAbstract not and: [ a
allInstances size = 0 and: [a subclasses size = 0]]].
"These are not abstract and identified as such. Ok."
Smalltalk allClasses select: [ :a | a isAbstract not and: [ a
allInstances size > 0]] :: size. 207 .
Smalltalk allClasses select: [ :a | a isAbstract not and: [ a
allInstances size > 0]].
--
Juan Vuletich
www.cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
More information about the Cuis-dev
mailing list