pharo-graphics / Bloc

Low-level UI infrastructure & framework for Pharo
MIT License
83 stars 40 forks source link

No need to have id in BlSpace, BlTask and BlParallelUniverse #639

Closed tinchodias closed 1 month ago

tinchodias commented 1 month ago

Instances of BlSpace, BlTask and BlParallelUniverse are initialized like this:

initialize
    super initialize.
    id := UniqueIdGenerator generateUniqueId.

where this id is an integer and the generator is initialized on class-side, like:

initialize
    UniqueIdGenerator := BlUniqueIdGenerator new

(each of the 3 classes has it's own generator).

I propose to remove this, as it mostly adds noise to the code. Pharo and Smalltalk objects have identityHash and this should be more than enough for a developer to identify instances while debugging, reading logs, etc.

tinchodias commented 1 month ago

Related:

tinchodias commented 1 month ago

@plantec @labordep I'm not talking of removing BlElement's ids. I think element id makes sense, and I think they are used in Toplo and Stylesheets. But what's your opinion on ids on BlSpace, BlTask and BlParallelUniverse?

labordep commented 1 month ago

Hi @tinchodias, I agree with you :-) I use it to identify an instance during debug but if the hash is working this is the same thing.