Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37965 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 24051 invoked from network); 28 May 2008 13:13:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2008 13:13:44 -0000 Authentication-Results: pb1.pair.com header.from=rquadling@googlemail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=rquadling@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 72.14.220.157 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@googlemail.com X-Host-Fingerprint: 72.14.220.157 fg-out-1718.google.com Received: from [72.14.220.157] ([72.14.220.157:5314] helo=fg-out-1718.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7D/C1-15519-78A5D384 for ; Wed, 28 May 2008 09:13:44 -0400 Received: by fg-out-1718.google.com with SMTP id 16so1893923fgg.23 for ; Wed, 28 May 2008 06:13:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=S6knOsd3qSOfM7tsm1AxgStZKzRxqtJ40O2VRd8G1Ow=; b=byJw2c8fRqI9ed2z+cB6DEg+bXn7vM7bT0G9JQP72BOPKc1SOYc41djV0SC9scj5nVwCESE4ncwIEwUZZ3Evc7YIG2TV4kRdAiD8FcXYbm6k8MiQ3KkmZFT+YgO6mjABG1ystqnYogINAmWqltPRGNWyY4j9lCNiAPDK8kfPjCc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=eb1Kur7+mE1wKR2AxlAavCZe1780rFbNWGldHPcW6LBXvekG51oHiTgTvovTtXOlmHU2Ov0rF3Qag07iXniJQ/mvN49dIGCDPKOUzo1QkVo1YaYzSdDSgDGPndBdLwfdvfiE+3ZQ4+azXEKTopzSPa+2yjFMRpGPXBuSH+Z3z2U= Received: by 10.86.84.5 with SMTP id h5mr9556099fgb.11.1211980420482; Wed, 28 May 2008 06:13:40 -0700 (PDT) Received: by 10.86.90.12 with HTTP; Wed, 28 May 2008 06:13:40 -0700 (PDT) Message-ID: <10845a340805280613v484d482bh6829f00b80661dc0@mail.gmail.com> Date: Wed, 28 May 2008 14:13:40 +0100 Reply-To: RQuadling@GoogleMail.com To: "Stan Vassilev | FM" Cc: internals@lists.php.net In-Reply-To: <235A5092989F44D081FD64011EB5F5DC@pc> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <0412F6FE505049F7901EAB8C61774839@pc> <483CFF33.6060302@lerdorf.com> <483D05B6.30804@daylessday.org> <200805281032.49016.et@php.net> <345fd5cd0805280147q73b46807vc9b6ad0778a96f9@mail.gmail.com> <235A5092989F44D081FD64011EB5F5DC@pc> Subject: Re: [PHP-DEV] Re: Short syntax for array literals [...] From: rquadling@googlemail.com ("Richard Quadling") 2008/5/28 Stan Vassilev | FM : > var array = new Array(); -- same as -- var array = []; > var object = new Object(); -- same as -- var object = {}; > > And when people have both of those, guess which one they use in more than > 90% of the cases. > > Regards, > Stan Vassilev I've moved from PHP to JS and I found this confusing. I don't any more, but I was used to saying I wanted an array by using the Array keyword (makes sense - no shortcut - no confusion). I still say Array() and Object() as they explicitly declare my intentions and others that would find [] and {} confusing (at least initially) don't have to struggle with my code. [] is fine for accessing an array. That's very common in many languages. {} was confusing as that is that is used to wrap a function's code. I don't see any real benefit in using $a = [] over $a = array() So, for a userland developer (rather than a core developer) -1. -- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"