Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70688 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45502 invoked from network); 17 Dec 2013 00:30:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Dec 2013 00:30:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.49 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.49 mail-wg0-f49.google.com Received: from [74.125.82.49] ([74.125.82.49:60635] helo=mail-wg0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 36/44-32483-F1B9FA25 for ; Mon, 16 Dec 2013 19:30:24 -0500 Received: by mail-wg0-f49.google.com with SMTP id x12so5256142wgg.28 for ; Mon, 16 Dec 2013 16:30:20 -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:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=dGhNMX2iL/qdpll4XlyL91pwtwnrz8PaW2bqqa9Zvdk=; b=Yfkzqr1v7mp7ojV2uLTII29f+72AF2Yho/Besb/i+oMpPZ2e1Sn4P1bEkyYWgk8Via yalCLdBFoopPSfSZfKo+EI9XuOjjdxusP/Zgpr8YWENfjpMChrmVqqzLpFxaQXb/Q0uE xjx5niCLJU8Qz/plo4Fsn7WRtXgRPGToJZ0kC0hgWUwIDa9IKqWo20msUof0hOiXY3zE MgIGyyaWJwqf69OREmkXCMDuFtSrR/aDgYekLccn+HP9Pj5JIQZ8aq7kS1s3ncwP4+Wy wahUIfZ8vWQTO90f7u8LxTHmbEBDm4URTt+ujMNkJa65OWm9GSWjGqpvtQGAqwTnD5SR TuSw== X-Received: by 10.194.1.139 with SMTP id 11mr16326322wjm.33.1387240220820; Mon, 16 Dec 2013 16:30:20 -0800 (PST) Received: from [192.168.0.2] (cpc19-brig17-2-0-cust25.3-3.cable.virginm.net. [81.101.201.26]) by mx.google.com with ESMTPSA id q8sm30613698wiy.8.2013.12.16.16.30.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 16:30:20 -0800 (PST) Message-ID: <52AF9B10.9020301@gmail.com> Date: Tue, 17 Dec 2013 00:30:08 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: internals@lists.php.net References: <52ABFE84.8010404@cerny-online.com> <52AF4383.3070406@gmail.com> <52AF4DD3.1090609@cerny-online.com> <52AF5C5F.5020101@gmail.com> <52AF7044.5080001@cerny-online.com> In-Reply-To: <52AF7044.5080001@cerny-online.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Flexible function naming From: rowan.collins@gmail.com (Rowan Collins) On 16/12/2013 21:27, Robert Cerny wrote: > > If you look at the core PHP functions (e.g. array) and some important > new additions like DateTime, you will see that there is mainly two > styles competing: Underscore and Camelcase, so in most cases it will > be one synonym, sometimes two, but never what you were enumerating. That's not inconsistency, that's a convention in its own right: class and object methods are in camelCase, standalone functions are underscore_separated. This seems to be pretty well established in the PHP community now, and if you pick a different convention, then you will be going against the tide of libraries you integrate with. The core functions which follow neither rule include C-style abbreviations like "strptime" which couldn't be automatically swapped to either format, and complete anomalies like "nl2br". If you named those functions as part of a consistent style, you would probably also follow stronger naming conventions than Rasmus did when he named "htmlspecialchars". At the end of the day, integrating 3rd party code will always expose you to their design decisions in all sorts of ways - whether they use underscores is a pretty simple thing to remember compared to how they structure dependencies, what patterns they expect you to use when integrating / extending the code, etc. Regards, -- Rowan Collins [IMSoP]