Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce displayBlock and deprecate display. #1500

Merged
merged 2 commits into from Jan 11, 2024

Conversation

Ducasse
Copy link
Contributor

@Ducasse Ducasse commented Dec 27, 2023

This is a block and not a display that we get!

@Ducasse Ducasse merged commit 94061a8 into pharo-spec:Pharo12 Jan 11, 2024
1 of 2 checks passed
@estebanlm
Copy link
Member

Stef, please don't.
This is not a good change .
Some years ago we decided to drop the block suffix in purpose and favour just "display:". The rationale is that it makes a whole family of accessors play better together, and also... is not just a "block" what you should pass there but any valuable.

This changes makes everything more dirty.

@estebanlm
Copy link
Member

I will revert this PR

@estebanlm
Copy link
Member

Stef, please don't. This is not a good change . Some years ago we decided to drop the block suffix in purpose and favour just "display:". The rationale is that it makes a whole family of accessors play better together, and also... is not just a "block" what you should pass there but any valuable.

This changes makes everything more dirty.

also, the idea is that you will set what is going to be display. We don't care the nature of the parameter :)

@Ducasse
Copy link
Contributor Author

Ducasse commented Jan 11, 2024

Your API is not good.
display is not a good API, display: is not a good API.
But you do not listen to your users, else you would ask them.

And display is an order and it conflicts with the display.
You see at the end I do not care but this has also consequences.

@Ducasse
Copy link
Contributor Author

Ducasse commented Jan 11, 2024

And BTW I do not see any evidence about

he rationale is that it makes a whole family of accessors play better together, and also... is not just a "block" what you should pass there but any valuable.

We can always pass a valuable instead of a block so this is a non argument.

@Ducasse
Copy link
Contributor Author

Ducasse commented Jan 11, 2024

With this kind of design it means that we have to constantly check the code to be able to pass an argument. It looks like glamour APIs. Always guessing. Now I do not care but I will not document this .

@Ducasse
Copy link
Contributor Author

Ducasse commented Jan 11, 2024

You see this design

displayUnderline: aBlock
	"If `aBlock` answer true, the cell will be displayed underlined.
	 `aBlock` receives one argument (the model element)."

	underlineAction := aBlock

prevent you to have

displayUnderline: true
and displayUnderlineBlock: [:item | item isxxx ]

Now you force people to guess that this is a block and to always pass a block when true is just enough.

@Ducasse
Copy link
Contributor Author

Ducasse commented Jan 11, 2024

So what is the argument of displayIcon: ... this is not an icon! too bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants