[squeak-dev] The Trunk: MorphicExtras-cmm.201.mcz
Chris Muller
ma.chris.m at gmail.com
Wed Dec 14 20:17:57 UTC 2016
On Wed, Dec 14, 2016 at 12:13 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:
> 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 anything.
Even though I struggle with seemingly arbitrary default, I can
actually appreciate that point. Its like, better "usability" for the
programmer. And with the #valueOfPreference: maintaining access to
the true internal value, seems like a good balance with functionality
needed for other use-cases. +1
Best,
Chris
More information about the Squeak-dev
mailing list
|