Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49947 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92693 invoked from network); 21 Oct 2010 08:12:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Oct 2010 08:12:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=sv_forums@fmethod.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sv_forums@fmethod.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fmethod.com from 209.85.161.42 cause and error) X-PHP-List-Original-Sender: sv_forums@fmethod.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:41981] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/A3-03733-5D5FFBC4 for ; Thu, 21 Oct 2010 04:12:06 -0400 Received: by fxm3 with SMTP id 3so3566457fxm.29 for ; Thu, 21 Oct 2010 01:12:02 -0700 (PDT) Received: by 10.103.123.10 with SMTP id a10mr454547mun.119.1287648716938; Thu, 21 Oct 2010 01:11:56 -0700 (PDT) Received: from pc ([83.228.56.37]) by mx.google.com with ESMTPS id 2sm633154faz.14.2010.10.21.01.11.41 (version=SSLv3 cipher=RC4-MD5); Thu, 21 Oct 2010 01:11:42 -0700 (PDT) Message-ID: To: "Richard Lynch" , References: <988651dd53129fdfd1acb905c8161e95.squirrel@www.l-i-e.com> Date: Thu, 21 Oct 2010 11:11:38 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 Subject: Re: [PHP-DEV] Skipping of defaulted parameters. From: sv_forums@fmethod.com ("Stan Vass") >> Option 4 would probably be the worse one to go for. Looking any number >> of languages that support defaults and you will see code like ... >> >> someFunction(param1,,,,,param7,,,,param11) > > It does get ugly fast for large numbers of arguments... > But any function with more than a handful of arguments is already > asking for trouble... > > At that point you should be passing in a data structure / instance / > array or something other than so many parameters. > The above example would have at least 10 arguments, so I'd also say it'd look bad never mind the syntax. Also a subtle thing: if your email reader doesn't use fixed width font, it's hard to appreciate the look of each approach in an actual code editor. And I'd say commas next to each other appear quite readable, self-sufficient in fixed-width font, not to mention self-explanatory. Using 'default' would raise more confusion, such as, is that valid: $foo = default; bar($foo); If it's made valid, i.e. if it acts as a constant, I suspect before long people will be assigning 'default' as yet another alternative to a false/null value, and we'll need yet another concept to resolve that. If it's not made valid, it'll be counter-intuitive as it looks exactly like a constant passed as an argument. Stan Vass