[squeak-dev] The Trunk: MorphicExtras-cmm.201.mcz
bert at freudenbergs.de
Wed Dec 14 18:13:13 UTC 2016
On Tue, Dec 13, 2016 at 11:52 AM, Chris Muller <asqueaker at gmail.com> wrote:
> > Instead of checking for "understands" we should use valueOfFlag: (which
> > defaults to false) to get back the old behavior.
> Hmm, I'm not sure "false" makes sense as a universal default value.
False is the default for valueOfFlag:. It is nil for valueOfPreference:.
> Apps typically choose their own lazy-initialized values
> attribute-by-attribute, and usually based on it having been nil.
We're talking about old-style preferences which IMHO used to be a very
convenient, succinct, and highly readable. We just wrote "Preferences
myFlag ifTrue: [...]" and this would universally work *without any other
support code*. This was really nice for live experimenting, you just throw
this expression in somewhere without having to worry about breaking
> Or we recreate the
> > preference.
> > Or we make it into a "pragma" preference on some class (which
> > seems to be the preferred way nowadays, even though it leads to an
> > of pref accessor methods?)
> *Thank you* for leveling a fair critique at pragma preferences. IMO,
> they are preventing the emergence of simple and powerful abstractions
> in our Preferences framework while, as you alluded, making lots of
> code. :( Their real benefits deserve some scrutiny.
> > What would be best?
Agreed, but it doesn't really answer my question of what to write instead
of "(Preferences understands: #foo) and: [Preferences foo]".
- Bert -
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev