[Cuis-dev] Improvement: Italic abstract classes and methods in Browser
Ernesto Ittig
e.ittig at gmail.com
Wed Dec 10 10:04:55 PST 2025
On Wed Dec 10, 2025 at 8:22 AM -03, Juan Vuletich wrote:
> 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.
Hi!
Firstly, thank you for taking the time to look at my submission!
I think I made an assumption when making this code that maybe we should
examine. My definition of an abstract class was very cutthroat: if a
class has any method that sends #subclassResponsibility in its protocol,
then it's an abstract class; if it doesn't, then it's concrete.
This did lead to some unexpected results. Why is SmallInteger abstract?
Well, it doesn't implement #adaptToInteger:andSend:. It doesn't matter
that this method shouldn't ever be sent to it, it's a method in its
protocol and it's abstract. On the other hand, Object and ActiveModel
are concrete; it's strange because you're not supposed to create
instances of them, but nothing stops you from doing it, and--most
importantly--all the methods in their protocol are concrete.
In this view, abstract classes are a syntactical category (you can't
make instances of then and use all their protocol) rather than semantic
(you shouldn't make instances of them).
I don't think the number of instances is a very reliable way to check
this, it depends on too many moving factors. In general, I don't think
you will find any automatic method to tag classes as abstract that
respects semantic categories. The only way to do this is to manually tag
each class.
I did find my change set to be useful, especially for finding bugs. This
is likely only because I know how it works, so I'm aware there are many
false negatives. But I'm ready to claim all the "false positives" are
actually bugs; if a class is concrete then there shouldn't be any
abstract methods in its protocol, and I imagine that an omission to
implement such methods is caused by the lack of a tool like this one.
Cheers,
Ernesto
More information about the Cuis-dev
mailing list