Path: csiph.com!1.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail From: Stefan Weiss Newsgroups: comp.lang.javascript Subject: Re: not "autovivification", but ...? Date: Wed, 1 Jun 2016 19:49:54 +0200 Organization: albasani.net Lines: 26 Message-ID: References: <1dc7bd11-343d-4cbb-b75d-1db8516666a0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net lpoioGHlMmLldEgsoQIkVQVQ5B1o3MxBXI5y792h07Gpe0HX7YwoaBKl81IbeOqlFGFBVFyH41rhI+uDp7p+Uw== NNTP-Posting-Date: Wed, 1 Jun 2016 17:49:55 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="730uq+FOTZYaswD6JUjpkSFwM3wtFP4VTYmVjNejiWpLRhhkgjmHtMO497lvLR3dK1WqUjl6Fdhr/cv8gmD6aQ6V0xcnS7BB0oVwYNj9xI28VDgdD2nvONLDz/71ntD6"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 In-Reply-To: <1dc7bd11-343d-4cbb-b75d-1db8516666a0@googlegroups.com> Cancel-Lock: sha1:gJ05STHWqkkr3ajSryo7yECHmk4= Xref: csiph.com comp.lang.javascript:30596 Michael Haufe (TNO) wrote: > IME, multi-level implicit creation is a sign that something is wrong > with your architecture. It makes me ask: "Why were these undefined in the first > place?" > > The dual issue for implicit creation is accessing a nested structure > where one or more of the intermediate members may not exist. My same > question above applies there as well: Why don't these already exist? > > [snip examples of workarounds] > > Where fundamentally people should take a step back and take a moment to > think at a higher level about what they are trying to accomplish. I sort of agree with this, to a point, but only if I created the data structure myself (or my application did). In many situations we simply don't have that level of control over data. Examples for this would be external APIs, JSON config files, or any other external tree-like structure mapped to nested objects. Are you saying that all data exchange formats with optional components are badly designed, or that at least all known container nodes should be present? I don't think that's a realistic requirement. - stefan