Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80205 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79645 invoked from network); 5 Jan 2015 22:25:04 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2015 22:25:04 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.43 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.43 mail-pa0-f43.google.com Received: from [209.85.220.43] ([209.85.220.43:63515] helo=mail-pa0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 58/3B-21693-F3F0BA45 for ; Mon, 05 Jan 2015 17:25:04 -0500 Received: by mail-pa0-f43.google.com with SMTP id kx10so29555138pab.16 for ; Mon, 05 Jan 2015 14:25:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=9m8KbAlCrrER2YJ6/6LCtCUUyOzVHm6E55hhkKrxyo8=; b=ilFgNIxe8wvw2eKRYoUpkHpU6H95UTcOFvrmL7BIbE+lXar0DINpnNu6Rbld4GbBFg 5Qs8+4nlEchl2nFQ4nqfLQcYaYXqR73rQeYbOV7/8Z/NlK36YjOYlbv0JpXu0u2X1KyL e2kCYD6QsT6aEZBY6yGJBpRYSydNeo9Ge/V5w3CZpqweFS2RbeAMIlW96AxHP0zCuuqB 7BOgVcjtK0NZosW0owWAtPUPGBHxwsfhpsNakNqjjG1w4BIOjq65ppTVEfMXRaJIVTsw Dr7z0f+ivGTQGm7OocXJ+culTFk+e4rb2+pXKmu2BNnQVXR2n1h5VGbAhSJaSzp5Pl+X kLKQ== X-Received: by 10.68.135.136 with SMTP id ps8mr104728179pbb.130.1420496700752; Mon, 05 Jan 2015 14:25:00 -0800 (PST) Received: from stas-air.corp.wikimedia.org (tan4.corp.wikimedia.org. [198.73.209.4]) by mx.google.com with ESMTPSA id gs2sm23007178pbc.68.2015.01.05.14.24.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jan 2015 14:25:00 -0800 (PST) Message-ID: <54AB0F3A.5020606@gmail.com> Date: Mon, 05 Jan 2015 14:24:58 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Andrea Faulds CC: PHP Internals References: <54AB0A10.4010709@gmail.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Parameter skipping, take 3 From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Yes, they complement one another. Both exist because of horrible > APIs. But I don’t think we should encourage horrible APIs. You can create horrible APIs with this, but you can also create them without this. This doesn't make it any more likely, it just makes working with optional parameters easier. > For well-designed functions, there is no need to skip parameters, > either with a default keyword or with named parameters. I disagree with that and in general I disagree with the stance "I don't need this so the language does not need that". We can and should have a wider look than personal needs and preferences. There are many cases where optional parameters have their place, and making them more convenient is a good thing. As a witness to that, most of the languages with this syntax model (I'm not talking about the likes of Lisp of course) do allow optional parameters, and making it easy to work with them is a very frequently requested (and implemented) feature. You can, of course, say these all people are wrong and their code is horrible, but this is the reality of what people want and what they use. They'll do it whether you like it or not, but with this RFC it would be less painful. For me, it is a clear win. -- Stas Malyshev smalyshev@gmail.com