On Thu, Aug 09, 2012 at 06:34:45PM -0700, Martin Cooper wrote:
> On Thu, Aug 9, 2012 at 5:13 PM, Alan Gutierrez <a...@prettyrobots.com> wrote:
> > Have you ever written Node.js code that counts on the implementation 
> > specific
> > Object behavior that mantains the insertion order of properties?
> >
> > It could be useful in configuration, for example, to specify fallbacks if 
> > the
> > first choice isn't available.
> >
> >     var conf = { database: { pg: "psql://localhost/database"
> >                            , mysql: "mysql://localhost/database" } };
> 
> I'm probably missing something in what you're trying to achieve, but
> at least in this case, why not just use an array?
> 
> var conf = {
>     database: [
>         { id: "pg", url: "psql://localhost/database" },
>         { id: "mysql", url: "mysql://localhost/database" }
>     ]
> };

Thank you all for responding. Asking because I saw the words "de facto standard"
and wondered if that meant that somewhere someone had found a use case for it
that was compelling. This was a suggestion, that maybe people were using it to
create a trailer-park DSL with JSON. I couldn't think of anything more
compelling.

--
Alan Gutierrez - http://github.com/bigeasy - http://twitter.com/bigeasy

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to