Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.1022.mcz ==================== Summary ==================== Name: Tools-eem.1022 Author: eem Time: 3 January 2021, 11:56:05.837731 am UUID: 67d66d1d-d650-45f4-8a72-1dd88c6d8ba4 Ancestors: Tools-ct.1021 Less verbosity in ObjectExplorer>>#world =============== Diff against Tools-ct.1021 =============== Item was changed: ----- Method: ObjectExplorer>>world (in category 'monitoring') ----- world - | project | + ^(project := Project current) isMorphic ifTrue: [project world]! - project := Project current. - project isMorphic ifFalse: [^ nil]. - ^ project world! |
Thanks for the fast merge!
---
Concerning this refactoring, I'm not sure whether it actually improves readability. :-) It might be a few byte steps faster, but that should not be our ultimate goal in all high-level domain-specific packages. Your version only implicitly shows that nil should be returned if the project is morphic. And the assignment expression ... not convinced, again. There have been enough discussions about it when they added the feature to Python 3, but I think it's true that doing multiple things in one statement is rather confusing than intuitive.
That's no big deal, of course, I'm only mentioning it because you explicitly uploaded this refactoring. I would have rather expect the reciprocal changeset as a refactoring that conforms to my own personal taste of coding style. :-)
Have a nice weekend, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Sonntag, 3. Januar 2021 20:56:08 An: [hidden email]; [hidden email] Betreff: [squeak-dev] The Trunk: Tools-eem.1022.mcz Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.1022.mcz ==================== Summary ==================== Name: Tools-eem.1022 Author: eem Time: 3 January 2021, 11:56:05.837731 am UUID: 67d66d1d-d650-45f4-8a72-1dd88c6d8ba4 Ancestors: Tools-ct.1021 Less verbosity in ObjectExplorer>>#world =============== Diff against Tools-ct.1021 =============== Item was changed: ----- Method: ObjectExplorer>>world (in category 'monitoring') ----- world - | project | + ^(project := Project current) isMorphic ifTrue: [project world]! - project := Project current. - project isMorphic ifFalse: [^ nil]. - ^ project world!
Carpe Squeak!
|
Hi Christoph, On Sun, Jan 3, 2021 at 12:06 PM Thiede, Christoph <[hidden email]> wrote:
I hear you but I feel very very srtingly on the matter. If one does not know that ifTrue: answers nil if the receiver is false, etc, then one is not fully literate. The version you wrote is four times longer and to my eyes much clumsier. So forgive me but I think it important to use the idiom correctly. Not using it is like speaking pidgin. To a great extent the system is a literary construction and we write ugly code at out peril. It is the start of a slippery slope towards newspeak ;-)
_,,,^..^,,,_ best, Eliot |
Free forum by Nabble | Edit this page |