hpi-swa-lab / SqueakByExample-english

An introductory book about the Squeak/Smalltalk programming system, guiding students and developers through the environment, language, tools, and the Morphic framework by means of a series of examples and exercises.
https://www.lulu.com/shop/patrick-rein-and-christoph-thiede/squeak-by-example-60/paperback/product-8vr2j2.html
Other
25 stars 7 forks source link

Discourage usage of global variables #37

Closed LinqLover closed 3 years ago

LinqLover commented 3 years ago

Global variables should be used as seldom as possible; their usage is not considered idiomatic for the most time. Emphasize this aspect in the relevant sections. Nuke description of Morphic globals (World and ActiveHand) that are meant to be deprecated and should not accessed manually at all. See also: [squeak-dev] Changeset: Eliminating global state from Morphic

codeZeilen commented 3 years ago

Yes, I saw that paragraph and I think that the location could work for the discussion. I will try in the next few weeks to write it. If you feel like it and are willing to endure the review cycles you can also give it a try. :)

Am Fr., 25. Sept. 2020 um 17:55 Uhr schrieb Christoph Thiede < notifications@github.com>:

@LinqLover commented on this pull request.

In Model/Model.tex https://github.com/codeZeilen/SqueakByExample-english/pull/37#discussion_r495082120 :

@@ -858,17 +858,10 @@ \subsubsection{Other useful global variables} (Smalltalk at: #Smalltalk) == Smalltalk --> true \end{code}

+% ct: TODO DISCUSS: Shall we really recommend the usage of \ct{Sensor} any longer?}

Later in this section, there is already a paragraph discouraging the use of global variables, but it's probably not precise enough: https://github.com/codeZeilen/SqueakByExample-english/blob/b8470833881043eafd33f06de62b51fee38e1313/Model/Model.tex#L880

World, ActiveHand, and Sensor are all Morphic-specific. Would the new description of #currentWorld and #currentHand maybe belong there?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/codeZeilen/SqueakByExample-english/pull/37#discussion_r495082120, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEI3YBQBFHLJVMG5Y7FQH3SHS4Q5ANCNFSM4RXGLRFA .

LinqLover commented 3 years ago

If you feel like it and are willing to endure the review cycles you can also give it a try. :)

I'm trying my luck now :-)

LinqLover commented 3 years ago

@codeZeilen Hmm, didn't the "request review" button trigger a notification, or didn't you have time yet? 😅

image

LinqLover commented 3 years ago

@codeZeilen Thanks for the detailed review! Two open questions are left. :-)

LinqLover commented 3 years ago

@codeZeilen Looks like there are no open change requests, anything left to do, or can you merge this?