Login  Register

Why do we separate class/instance methods in the browser?

Posted by Tim Mackinnon on Jul 22, 2017; 1:02pm
URL: https://forum.world.st/Why-do-we-separate-class-instance-methods-in-the-browser-tp4956231.html

Hi - this week I was asked to run a mob programming session with Smalltalk - and show a group of experienced developers Smalltalk so that they could practice mobbing around a new idea.

It worked really well, a 20 min talk explaining a bit of the ethos and a few key features and some quick syntax and they were able to charge ahead and really enjoy themselves.

It was interesting however to see what things confused them the most (and also what things impressed them - there were many).

The one that stuck out for me (and is actually mentioned in another thread this week) was the class/instance method difference. They conceptually understood the difference coming from other languages but our UI is tricky to understand with the Class button toggle we have, and if you get methods on the wrong side, like with a test, it's quite confusing.

Anyway - this got me thinking - why do we bother having a toggle in our UI for this these days? Of course we know there is a class and a metaclass but given that we have icons for methods now (and also have a
Protocol pane ) why don't we just show all the methods we have in one list and let you filter them or even see them all? It seems much easier and way more efficient to rapidly code this way.

The only question then would be how to create methods of the right type - whether to have a button to create the right template (and put the  browser code pane in the right context) or whether to indicate it by convention of the method name when creating it like + new: aSize etc. (Or even: class new: aSize etc).

The more I think about it, the more it seems like something we should consider trying both for making ourselves more efficient (I'll bet everyone has written a method on the wrong side by mistake) and also helping newcomers.

I'll bet it's quite easy to do in Calypso as well if I've understood Denis' model story properly.

Has this been tried before? Is it heretical?

Tim

Sent from my iPhone