On 2/16/17, 2:34 PM, "Harbs" <harbs.li...@gmail.com> wrote:
>> Well, that's not PAYG (yes, I'm being picky). > >I disagree. For string it certainly is PAYG. There’s no extra cost. (and >considering the three bytes of ‘=“”’ in the source code is getting petty >IMO) Pretty sure that uninitialized variables do not have any presence in minified JS. So every variable where you do this is adding foo.bar = ""; to the app. > Adding an extra TextModelWithEmptyStringDefaults is totally unnecessary. > >> Again, what >> percentage of the time in production will a label's text property not be >> set to something other than “"? > >More than you’d think. We ran into this because we were using >ImageAndTextButton without text. But it’s quite common to have components >which get text or not at runtime. Then use ImageButton. Or swap in a different model with empty string defaults for ImageAndTextButton. For just one occurrence, you probably won't notice, But after we initialize 100 or 1000 properties to "" you might notice. My 2 cents, -Alex